1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #include "IrrCompileConfig.h"
\r
6 #ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
\r
8 #include "CBoneSceneNode.h"
\r
16 CBoneSceneNode::CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
\r
17 u32 boneIndex, const c8* boneName)
\r
18 : IBoneSceneNode(parent, mgr, id), BoneIndex(boneIndex),
\r
19 AnimationMode(EBAM_AUTOMATIC), SkinningSpace(EBSS_LOCAL)
\r
22 setDebugName("CBoneSceneNode");
\r
28 //! Returns the index of the bone
\r
29 u32 CBoneSceneNode::getBoneIndex() const
\r
35 //! Sets the animation mode of the bone. Returns true if successful.
\r
36 bool CBoneSceneNode::setAnimationMode(E_BONE_ANIMATION_MODE mode)
\r
38 AnimationMode = mode;
\r
43 //! Gets the current animation mode of the bone
\r
44 E_BONE_ANIMATION_MODE CBoneSceneNode::getAnimationMode() const
\r
46 return AnimationMode;
\r
50 //! returns the axis aligned bounding box of this node
\r
51 const core::aabbox3d<f32>& CBoneSceneNode::getBoundingBox() const
\r
58 //! Returns the relative transformation of the scene node.
\r
59 core::matrix4 CBoneSceneNode::getRelativeTransformation() const
\r
61 return core::matrix4(); // RelativeTransformation;
\r
66 void CBoneSceneNode::OnAnimate(u32 timeMs)
\r
70 // update absolute position
\r
71 //updateAbsolutePosition();
\r
73 // perform the post render process on all children
\r
74 ISceneNodeList::iterator it = Children.begin();
\r
75 for (; it != Children.end(); ++it)
\r
76 (*it)->OnAnimate(timeMs);
\r
81 void CBoneSceneNode::helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node)
\r
83 Node->updateAbsolutePosition();
\r
85 ISceneNodeList::const_iterator it = Node->getChildren().begin();
\r
86 for (; it != Node->getChildren().end(); ++it)
\r
88 helper_updateAbsolutePositionOfAllChildren( (*it) );
\r
93 void CBoneSceneNode::updateAbsolutePositionOfAllChildren()
\r
95 helper_updateAbsolutePositionOfAllChildren( this );
\r
99 } // namespace scene
\r