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 #include "CBoneSceneNode.h"
\r
14 CBoneSceneNode::CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
\r
15 u32 boneIndex, const c8* boneName)
\r
16 : IBoneSceneNode(parent, mgr, id), BoneIndex(boneIndex),
\r
17 AnimationMode(EBAM_AUTOMATIC), SkinningSpace(EBSS_LOCAL)
\r
20 setDebugName("CBoneSceneNode");
\r
26 //! Returns the index of the bone
\r
27 u32 CBoneSceneNode::getBoneIndex() const
\r
33 //! Sets the animation mode of the bone. Returns true if successful.
\r
34 bool CBoneSceneNode::setAnimationMode(E_BONE_ANIMATION_MODE mode)
\r
36 AnimationMode = mode;
\r
41 //! Gets the current animation mode of the bone
\r
42 E_BONE_ANIMATION_MODE CBoneSceneNode::getAnimationMode() const
\r
44 return AnimationMode;
\r
48 //! returns the axis aligned bounding box of this node
\r
49 const core::aabbox3d<f32>& CBoneSceneNode::getBoundingBox() const
\r
56 //! Returns the relative transformation of the scene node.
\r
57 core::matrix4 CBoneSceneNode::getRelativeTransformation() const
\r
59 return core::matrix4(); // RelativeTransformation;
\r
64 void CBoneSceneNode::OnAnimate(u32 timeMs)
\r
68 // update absolute position
\r
69 //updateAbsolutePosition();
\r
71 // perform the post render process on all children
\r
72 ISceneNodeList::iterator it = Children.begin();
\r
73 for (; it != Children.end(); ++it)
\r
74 (*it)->OnAnimate(timeMs);
\r
79 void CBoneSceneNode::helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node)
\r
81 Node->updateAbsolutePosition();
\r
83 ISceneNodeList::const_iterator it = Node->getChildren().begin();
\r
84 for (; it != Node->getChildren().end(); ++it)
\r
86 helper_updateAbsolutePositionOfAllChildren( (*it) );
\r
91 void CBoneSceneNode::updateAbsolutePositionOfAllChildren()
\r
93 helper_updateAbsolutePositionOfAllChildren( this );
\r
97 } // namespace scene
\r