Jump to content
  • Advertisement
Sign in to follow this  
Endar

The difference between animated and static

This topic is 4428 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I'm loading models in my engine, I currently have a bunch of animated meshes and (at the moment) a single class that just loads a static model. Right now, when loading models, I have to open a file object to the model file and then send it to the constructor, where the file is loaded. I'm trying to create a single function where I can just call "getMesh(path)" or something of the sort. But obviously the problem in C++ is that you can't overload a function based on the return value. So, I either have to have more than a single function, or I have to incorporate static models into my animated mesh class and differentiate between having animation and having no animation. Is this a usual thing? Having an animated mesh class which can either be animated or not?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by BoReDoM_Inc
Melbourne, Australia... Good Work!

I'm pretty sure you could use void pointers to solve this problem.


[grin]

I could use void pointers, but then, after I've loaded a model, how do I know if it's animated or not? Any couldn't that potentially stuff up the vtable of an object with inherited member functions?

Edit:: I didn't mean that using void pointers will corrupt the vtable of an object, I just meant that when casting an object address to a void pointer, the vtable will lose meaning.

[Edited by - Endar on July 2, 2006 3:47:12 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Instead of simply returning the value, have it call a callback to pass the information back, and which callback it calls depends upon whether it's animated or not.

Share this post


Link to post
Share on other sites
I like doing what the D3DX functions do (like D3DXIntersect). If I want more than just the HRESULT, I pass a pointer to the additional return data:

HRESULT LoadMesh(BOOL* IsSkinned, .....);

Share this post


Link to post
Share on other sites
A non-animated thing can be seen as an animated thing whose animation happens not to actually result in any apparent movement.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!