2007-09-04 11:51:42 -07:00
|
|
|
#ifndef __I_BONE_SCENE_NODE_H_INCLUDED__
|
|
|
|
#define __I_BONE_SCENE_NODE_H_INCLUDED__
|
|
|
|
|
2007-09-09 15:04:52 -07:00
|
|
|
// Used with ISkinnedMesh and IAnimatedMeshSceneNode, for boned meshes
|
2007-09-04 11:51:42 -07:00
|
|
|
|
|
|
|
#include "ISceneNode.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
|
|
|
//! Enumeration for different bone animation modes
|
|
|
|
enum E_BONE_ANIMATION_MODE
|
|
|
|
{
|
|
|
|
//! The bone is usually animated, unless it's parent is not animated
|
|
|
|
EBAM_AUTOMATIC=0,
|
|
|
|
|
|
|
|
//! The bone is animated by the skin, if it's parent is not animated
|
|
|
|
//! then animation will resume from this bone onward
|
|
|
|
EBAM_ANIMATED,
|
|
|
|
|
|
|
|
//! The bone is not animated by the skin
|
|
|
|
EBAM_UNANIMATED,
|
|
|
|
|
|
|
|
//! Not an animation mode, just here to count the available modes
|
|
|
|
EBAM_COUNT
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2007-10-01 21:01:08 -07:00
|
|
|
enum E_BONE_SKINNING_SPACE
|
|
|
|
{
|
|
|
|
//! local skinning, standard
|
|
|
|
EBSS_LOCAL=0,
|
|
|
|
|
|
|
|
//! global skinning
|
|
|
|
EBSS_GLOBAL,
|
|
|
|
|
|
|
|
EBSS_COUNT
|
|
|
|
};
|
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
//! Names for bone animation modes
|
|
|
|
const c8* const BoneAnimationModeNames[] =
|
|
|
|
{
|
|
|
|
"automatic",
|
|
|
|
"animated",
|
|
|
|
"unanimated",
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class IBoneSceneNode : public ISceneNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
IBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1) :
|
2008-02-12 07:31:35 -08:00
|
|
|
ISceneNode(parent, mgr, id),positionHint(-1),scaleHint(-1),rotationHint(-1) { }
|
2007-09-04 11:51:42 -07:00
|
|
|
|
|
|
|
//! Returns the name of the bone
|
|
|
|
virtual const c8* getBoneName() const = 0;
|
|
|
|
|
|
|
|
//! Returns the index of the bone
|
|
|
|
virtual u32 getBoneIndex() const = 0;
|
|
|
|
|
2007-10-01 21:01:08 -07:00
|
|
|
//! Sets the animation mode of the bone. Returns true if successful. (Unused)
|
2007-09-04 11:51:42 -07:00
|
|
|
virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) = 0;
|
|
|
|
|
|
|
|
//! Gets the current animation mode of the bone
|
|
|
|
virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
|
|
|
|
|
|
|
|
//! returns the axis aligned bounding box of this node
|
|
|
|
virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
|
|
|
|
|
|
|
|
//! Returns the relative transformation of the scene node.
|
|
|
|
//virtual core::matrix4 getRelativeTransformation() const = 0;
|
|
|
|
|
|
|
|
virtual void OnAnimate(u32 timeMs) =0;
|
|
|
|
|
|
|
|
//! Does nothing as bones are not visible
|
2007-09-16 16:41:55 -07:00
|
|
|
virtual void render() { }
|
2007-09-04 11:51:42 -07:00
|
|
|
|
2007-10-01 21:01:08 -07:00
|
|
|
//! How the relative transformation of the bone is used
|
|
|
|
virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0;
|
2007-09-04 11:51:42 -07:00
|
|
|
|
2007-10-01 21:01:08 -07:00
|
|
|
//! How the relative transformation of the bone is used
|
2008-02-12 07:31:35 -08:00
|
|
|
virtual E_BONE_SKINNING_SPACE getSkinningSpace() const =0;
|
2007-09-04 11:51:42 -07:00
|
|
|
|
|
|
|
//! updates the absolute position based on the relative and the parents position
|
|
|
|
virtual void updateAbsolutePositionOfAllChildren()=0;
|
|
|
|
|
|
|
|
s32 positionHint;
|
|
|
|
s32 scaleHint;
|
|
|
|
s32 rotationHint;
|
|
|
|
};
|
|
|
|
|
2007-09-16 16:41:55 -07:00
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|