2007-05-20 11:03:49 -07:00
|
|
|
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __I_SCENE_NODE_ANIMATOR_H_INCLUDED__
|
|
|
|
#define __I_SCENE_NODE_ANIMATOR_H_INCLUDED__
|
|
|
|
|
2007-09-06 23:11:47 -07:00
|
|
|
#include "IReferenceCounted.h"
|
2007-05-20 11:03:49 -07:00
|
|
|
#include "vector3d.h"
|
|
|
|
#include "ESceneNodeAnimatorTypes.h"
|
|
|
|
#include "IAttributeExchangingObject.h"
|
2008-04-24 14:39:22 -07:00
|
|
|
#include "IEventReceiver.h"
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace io
|
|
|
|
{
|
|
|
|
class IAttributes;
|
|
|
|
} // end namespace io
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
class ISceneNode;
|
|
|
|
class ISceneManager;
|
|
|
|
|
|
|
|
//! Animates a scene node. Can animate position, rotation, material, and so on.
|
|
|
|
/** A scene node animator is able to animate a scene node in a very simple way. It may
|
|
|
|
change its position, rotation, scale and/or material. There are lots of animators
|
|
|
|
to choose from. You can create scene node animators with the ISceneManager interface.
|
|
|
|
*/
|
2008-04-24 14:39:22 -07:00
|
|
|
class ISceneNodeAnimator : public io::IAttributeExchangingObject, public IEventReceiver
|
2007-05-20 11:03:49 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! destructor
|
|
|
|
virtual ~ISceneNodeAnimator() {}
|
|
|
|
|
|
|
|
//! Animates a scene node.
|
|
|
|
//! \param node: Node to animate.
|
|
|
|
//! \param timeMs: Current time in milli seconds.
|
|
|
|
virtual void animateNode(ISceneNode* node, u32 timeMs) = 0;
|
|
|
|
|
|
|
|
//! Creates a clone of this animator.
|
2007-09-06 23:11:47 -07:00
|
|
|
/** Please note that you will have to drop (IReferenceCounted::drop())
|
2007-05-20 11:03:49 -07:00
|
|
|
the returned pointer after calling this. */
|
|
|
|
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0)
|
|
|
|
{
|
|
|
|
return 0; // to be implemented by derived classes.
|
|
|
|
}
|
|
|
|
|
2008-04-24 14:39:22 -07:00
|
|
|
//! Returns true if this animator receives events.
|
|
|
|
//! When attached to the an active camera, this animator will be able to respond to events
|
|
|
|
//! such as mouse and keyboard events.
|
|
|
|
virtual bool isEventReceiverEnabled() const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//! Event receiver, override this function for camera controlling animators
|
|
|
|
virtual bool OnEvent(const SEvent& event)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2007-05-20 11:03:49 -07:00
|
|
|
//! Returns type of the scene node animator
|
|
|
|
virtual ESCENE_NODE_ANIMATOR_TYPE getType() const
|
|
|
|
{
|
|
|
|
return ESNAT_UNKNOWN;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|