ID3DXAnimationCallbackHandler : base class undefined
hi all,
i am trying to use this interface of dx but it always gives me an error 'ID3DXAnimationCallbackHandler' : base class undefined. I have VC6 with directX SDK 9.0c.
please guide me what to do
thanks
Part of me says, you might have forgotten to include D3dx9anim.h. Part of me believes, since I don't know a damn thing about how COM works, that you might need to do more than just inherit from this class to implement the interface.
ID3DXAnimationCallbackHandler its a kind of abstract class, its methods dont have 'bodies'. You must create a class which is derived from this and then implement the method inside of ID3DXAnimationCallbackHandler(its just one: ID3DXAnimationCallbackHandler::HandleCallback()) inside this class.
D3dx9anim.h is included inside the program and the class has body like this
class AnimatedObject : public SceneObject, public ID3DXAnimationCallbackHandler
{
public:
AnimatedObject( char *meshName, char *meshPath = "./", unsigned long type = TYPE_ANIMATED_OBJECT );
virtual ~AnimatedObject();
virtual void Update( float elapsed, bool addVelocity = true );
void PlayAnimation( unsigned int animation, float transitionTime, bool loop = true );
ID3DXAnimationController *GetAnimationController();
private:
virtual HRESULT CALLBACK HandleCallback( THIS_ UINT Track, LPVOID pCallbackData );
private:
ID3DXAnimationController *m_animationController; // Controller for managing mesh animation playback.
unsigned int m_currentTrack; // The track of the currently playing animation.
float m_currentTime; // Timer used for animation.
};
class AnimatedObject : public SceneObject, public ID3DXAnimationCallbackHandler
{
public:
AnimatedObject( char *meshName, char *meshPath = "./", unsigned long type = TYPE_ANIMATED_OBJECT );
virtual ~AnimatedObject();
virtual void Update( float elapsed, bool addVelocity = true );
void PlayAnimation( unsigned int animation, float transitionTime, bool loop = true );
ID3DXAnimationController *GetAnimationController();
private:
virtual HRESULT CALLBACK HandleCallback( THIS_ UINT Track, LPVOID pCallbackData );
private:
ID3DXAnimationController *m_animationController; // Controller for managing mesh animation playback.
unsigned int m_currentTrack; // The track of the currently playing animation.
float m_currentTime; // Timer used for animation.
};
D3dx9anim.h is included inside the program and the class has body like this
class AnimatedObject : public SceneObject, public ID3DXAnimationCallbackHandler
{
public:
AnimatedObject( char *meshName, char *meshPath = "./", unsigned long type = TYPE_ANIMATED_OBJECT );
virtual ~AnimatedObject();
virtual void Update( float elapsed, bool addVelocity = true );
void PlayAnimation( unsigned int animation, float transitionTime, bool loop = true );
ID3DXAnimationController *GetAnimationController();
private:
virtual HRESULT CALLBACK HandleCallback( THIS_ UINT Track, LPVOID pCallbackData );
private:
ID3DXAnimationController *m_animationController; // Controller for managing mesh animation playback.
unsigned int m_currentTrack; // The track of the currently playing animation.
float m_currentTime; // Timer used for animation.
};
class AnimatedObject : public SceneObject, public ID3DXAnimationCallbackHandler
{
public:
AnimatedObject( char *meshName, char *meshPath = "./", unsigned long type = TYPE_ANIMATED_OBJECT );
virtual ~AnimatedObject();
virtual void Update( float elapsed, bool addVelocity = true );
void PlayAnimation( unsigned int animation, float transitionTime, bool loop = true );
ID3DXAnimationController *GetAnimationController();
private:
virtual HRESULT CALLBACK HandleCallback( THIS_ UINT Track, LPVOID pCallbackData );
private:
ID3DXAnimationController *m_animationController; // Controller for managing mesh animation playback.
unsigned int m_currentTrack; // The track of the currently playing animation.
float m_currentTime; // Timer used for animation.
};
Hi there had the same prob, try this link out it helped me a lot
http://www.toymaker.info/Games/html/load_x_hierarchy.html#HierarchyConcept
http://www.toymaker.info/Games/html/load_x_hierarchy.html#HierarchyConcept
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement