2008-05-22 04:51:37 -07:00
|
|
|
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
2008-03-04 16:02:00 -08:00
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
#ifndef __C_BONE_SCENE_NODE_H_INCLUDED__
|
|
|
|
#define __C_BONE_SCENE_NODE_H_INCLUDED__
|
|
|
|
|
|
|
|
// Used with SkinnedMesh and IAnimatedMeshSceneNode, for boned meshes
|
|
|
|
|
|
|
|
#include "IBoneSceneNode.h"
|
|
|
|
#include "irrString.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
|
|
|
class CBoneSceneNode : public IBoneSceneNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
|
|
|
CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr,
|
|
|
|
s32 id=-1, u32 boneIndex=0, const c8* boneName=0);
|
|
|
|
|
|
|
|
//! Returns the name of the bone
|
|
|
|
virtual const c8* getBoneName() const;
|
|
|
|
|
|
|
|
//! Returns the index of the bone
|
|
|
|
virtual u32 getBoneIndex() const;
|
|
|
|
|
|
|
|
//! Sets the animation mode of the bone. Returns true if successful.
|
|
|
|
virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode);
|
|
|
|
|
|
|
|
//! Gets the current animation mode of the bone
|
|
|
|
virtual E_BONE_ANIMATION_MODE getAnimationMode() const;
|
|
|
|
|
|
|
|
//! returns the axis aligned bounding box of this node
|
|
|
|
virtual const core::aabbox3d<f32>& getBoundingBox() const;
|
|
|
|
|
2008-02-12 07:31:35 -08:00
|
|
|
/*
|
2007-09-04 11:51:42 -07:00
|
|
|
//! Returns the relative transformation of the scene node.
|
|
|
|
//virtual core::matrix4 getRelativeTransformation() const;
|
2008-02-12 07:31:35 -08:00
|
|
|
*/
|
2007-09-04 11:51:42 -07:00
|
|
|
|
|
|
|
virtual void OnAnimate(u32 timeMs);
|
|
|
|
|
|
|
|
virtual void updateAbsolutePositionOfAllChildren();
|
|
|
|
|
|
|
|
//! Writes attributes of the scene node.
|
2007-09-14 15:25:59 -07:00
|
|
|
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
|
2007-09-04 11:51:42 -07:00
|
|
|
|
|
|
|
//! Reads attributes of the scene node.
|
|
|
|
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
|
|
|
|
|
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 )
|
|
|
|
{
|
|
|
|
SkinningSpace=space;
|
|
|
|
}
|
|
|
|
|
2008-02-12 07:31:35 -08:00
|
|
|
virtual E_BONE_SKINNING_SPACE getSkinningSpace() const
|
2007-10-01 21:01:08 -07:00
|
|
|
{
|
|
|
|
return SkinningSpace;
|
|
|
|
}
|
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
private:
|
2008-02-12 07:31:35 -08:00
|
|
|
void helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node);
|
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
u32 BoneIndex;
|
|
|
|
core::stringc BoneName;
|
|
|
|
|
|
|
|
core::aabbox3d<f32> Box;
|
2008-03-04 16:02:00 -08:00
|
|
|
|
|
|
|
E_BONE_ANIMATION_MODE AnimationMode;
|
|
|
|
E_BONE_SKINNING_SPACE SkinningSpace;
|
2007-09-04 11:51:42 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|