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 "CBoneSceneNode.h"
\r
13 CBoneSceneNode::CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
\r
14 u32 boneIndex, const c8* boneName)
\r
15 : IBoneSceneNode(parent, mgr, id), BoneIndex(boneIndex),
\r
16 AnimationMode(EBAM_AUTOMATIC), SkinningSpace(EBSS_LOCAL)
\r
19 setDebugName("CBoneSceneNode");
\r
25 //! Returns the index of the bone
\r
26 u32 CBoneSceneNode::getBoneIndex() const
\r
32 //! Sets the animation mode of the bone. Returns true if successful.
\r
33 bool CBoneSceneNode::setAnimationMode(E_BONE_ANIMATION_MODE mode)
\r
35 AnimationMode = mode;
\r
40 //! Gets the current animation mode of the bone
\r
41 E_BONE_ANIMATION_MODE CBoneSceneNode::getAnimationMode() const
\r
43 return AnimationMode;
\r
47 //! returns the axis aligned bounding box of this node
\r
48 const core::aabbox3d<f32>& CBoneSceneNode::getBoundingBox() const
\r
55 //! Returns the relative transformation of the scene node.
\r
56 core::matrix4 CBoneSceneNode::getRelativeTransformation() const
\r
58 return core::matrix4(); // RelativeTransformation;
\r
63 void CBoneSceneNode::OnAnimate(u32 timeMs)
\r
67 // update absolute position
\r
68 //updateAbsolutePosition();
\r
70 // perform the post render process on all children
\r
71 ISceneNodeList::iterator it = Children.begin();
\r
72 for (; it != Children.end(); ++it)
\r
73 (*it)->OnAnimate(timeMs);
\r
78 void CBoneSceneNode::helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node)
\r
80 Node->updateAbsolutePosition();
\r
82 ISceneNodeList::const_iterator it = Node->getChildren().begin();
\r
83 for (; it != Node->getChildren().end(); ++it)
\r
85 helper_updateAbsolutePositionOfAllChildren( (*it) );
\r
90 void CBoneSceneNode::updateAbsolutePositionOfAllChildren()
\r
92 helper_updateAbsolutePositionOfAllChildren( this );
\r
96 } // namespace scene
\r