aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/CBoneSceneNode.cpp
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 18:54:10 +1000
committerDavid Walter Seikel2013-01-13 18:54:10 +1000
commit959831f4ef5a3e797f576c3de08cd65032c997ad (patch)
treee7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/source/Irrlicht/CBoneSceneNode.cpp
parentAdd info about changes to Irrlicht. (diff)
downloadSledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CBoneSceneNode.cpp')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/CBoneSceneNode.cpp258
1 files changed, 129 insertions, 129 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CBoneSceneNode.cpp b/libraries/irrlicht-1.8/source/Irrlicht/CBoneSceneNode.cpp
index af54011..23fd4b8 100644
--- a/libraries/irrlicht-1.8/source/Irrlicht/CBoneSceneNode.cpp
+++ b/libraries/irrlicht-1.8/source/Irrlicht/CBoneSceneNode.cpp
@@ -1,129 +1,129 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine". 2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h
4 4
5#include "IrrCompileConfig.h" 5#include "IrrCompileConfig.h"
6#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ 6#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
7 7
8#include "CBoneSceneNode.h" 8#include "CBoneSceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! constructor 15//! constructor
16CBoneSceneNode::CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 16CBoneSceneNode::CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
17 u32 boneIndex, const c8* boneName) 17 u32 boneIndex, const c8* boneName)
18: IBoneSceneNode(parent, mgr, id), BoneIndex(boneIndex), 18: IBoneSceneNode(parent, mgr, id), BoneIndex(boneIndex),
19 AnimationMode(EBAM_AUTOMATIC), SkinningSpace(EBSS_LOCAL) 19 AnimationMode(EBAM_AUTOMATIC), SkinningSpace(EBSS_LOCAL)
20{ 20{
21 #ifdef _DEBUG 21 #ifdef _DEBUG
22 setDebugName("CBoneSceneNode"); 22 setDebugName("CBoneSceneNode");
23 #endif 23 #endif
24 setName(boneName); 24 setName(boneName);
25} 25}
26 26
27 27
28//! Returns the index of the bone 28//! Returns the index of the bone
29u32 CBoneSceneNode::getBoneIndex() const 29u32 CBoneSceneNode::getBoneIndex() const
30{ 30{
31 return BoneIndex; 31 return BoneIndex;
32} 32}
33 33
34 34
35//! Sets the animation mode of the bone. Returns true if successful. 35//! Sets the animation mode of the bone. Returns true if successful.
36bool CBoneSceneNode::setAnimationMode(E_BONE_ANIMATION_MODE mode) 36bool CBoneSceneNode::setAnimationMode(E_BONE_ANIMATION_MODE mode)
37{ 37{
38 AnimationMode = mode; 38 AnimationMode = mode;
39 return true; 39 return true;
40} 40}
41 41
42 42
43//! Gets the current animation mode of the bone 43//! Gets the current animation mode of the bone
44E_BONE_ANIMATION_MODE CBoneSceneNode::getAnimationMode() const 44E_BONE_ANIMATION_MODE CBoneSceneNode::getAnimationMode() const
45{ 45{
46 return AnimationMode; 46 return AnimationMode;
47} 47}
48 48
49 49
50//! returns the axis aligned bounding box of this node 50//! returns the axis aligned bounding box of this node
51const core::aabbox3d<f32>& CBoneSceneNode::getBoundingBox() const 51const core::aabbox3d<f32>& CBoneSceneNode::getBoundingBox() const
52{ 52{
53 return Box; 53 return Box;
54} 54}
55 55
56 56
57/* 57/*
58//! Returns the relative transformation of the scene node. 58//! Returns the relative transformation of the scene node.
59core::matrix4 CBoneSceneNode::getRelativeTransformation() const 59core::matrix4 CBoneSceneNode::getRelativeTransformation() const
60{ 60{
61 return core::matrix4(); // RelativeTransformation; 61 return core::matrix4(); // RelativeTransformation;
62} 62}
63*/ 63*/
64 64
65 65
66void CBoneSceneNode::OnAnimate(u32 timeMs) 66void CBoneSceneNode::OnAnimate(u32 timeMs)
67{ 67{
68 if (IsVisible) 68 if (IsVisible)
69 { 69 {
70 // animate this node with all animators 70 // animate this node with all animators
71 71
72 ISceneNodeAnimatorList::Iterator ait = Animators.begin(); 72 ISceneNodeAnimatorList::Iterator ait = Animators.begin();
73 for (; ait != Animators.end(); ++ait) 73 for (; ait != Animators.end(); ++ait)
74 (*ait)->animateNode(this, timeMs); 74 (*ait)->animateNode(this, timeMs);
75 75
76 // update absolute position 76 // update absolute position
77 //updateAbsolutePosition(); 77 //updateAbsolutePosition();
78 78
79 // perform the post render process on all children 79 // perform the post render process on all children
80 ISceneNodeList::Iterator it = Children.begin(); 80 ISceneNodeList::Iterator it = Children.begin();
81 for (; it != Children.end(); ++it) 81 for (; it != Children.end(); ++it)
82 (*it)->OnAnimate(timeMs); 82 (*it)->OnAnimate(timeMs);
83 } 83 }
84} 84}
85 85
86 86
87void CBoneSceneNode::helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node) 87void CBoneSceneNode::helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node)
88{ 88{
89 Node->updateAbsolutePosition(); 89 Node->updateAbsolutePosition();
90 90
91 ISceneNodeList::ConstIterator it = Node->getChildren().begin(); 91 ISceneNodeList::ConstIterator it = Node->getChildren().begin();
92 for (; it != Node->getChildren().end(); ++it) 92 for (; it != Node->getChildren().end(); ++it)
93 { 93 {
94 helper_updateAbsolutePositionOfAllChildren( (*it) ); 94 helper_updateAbsolutePositionOfAllChildren( (*it) );
95 } 95 }
96} 96}
97 97
98 98
99void CBoneSceneNode::updateAbsolutePositionOfAllChildren() 99void CBoneSceneNode::updateAbsolutePositionOfAllChildren()
100{ 100{
101 helper_updateAbsolutePositionOfAllChildren( this ); 101 helper_updateAbsolutePositionOfAllChildren( this );
102} 102}
103 103
104 104
105void CBoneSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const 105void CBoneSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
106{ 106{
107 IBoneSceneNode::serializeAttributes(out, options); 107 IBoneSceneNode::serializeAttributes(out, options);
108 out->addInt("BoneIndex", BoneIndex); 108 out->addInt("BoneIndex", BoneIndex);
109 out->addEnum("AnimationMode", AnimationMode, BoneAnimationModeNames); 109 out->addEnum("AnimationMode", AnimationMode, BoneAnimationModeNames);
110} 110}
111 111
112 112
113void CBoneSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) 113void CBoneSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
114{ 114{
115 BoneIndex = in->getAttributeAsInt("BoneIndex"); 115 BoneIndex = in->getAttributeAsInt("BoneIndex");
116 AnimationMode = (E_BONE_ANIMATION_MODE)in->getAttributeAsEnumeration("AnimationMode", BoneAnimationModeNames); 116 AnimationMode = (E_BONE_ANIMATION_MODE)in->getAttributeAsEnumeration("AnimationMode", BoneAnimationModeNames);
117 // for legacy files (before 1.5) 117 // for legacy files (before 1.5)
118 const core::stringc boneName = in->getAttributeAsString("BoneName"); 118 const core::stringc boneName = in->getAttributeAsString("BoneName");
119 setName(boneName); 119 setName(boneName);
120 IBoneSceneNode::deserializeAttributes(in, options); 120 IBoneSceneNode::deserializeAttributes(in, options);
121 // TODO: add/replace bone in parent with bone from mesh 121 // TODO: add/replace bone in parent with bone from mesh
122} 122}
123 123
124 124
125} // namespace scene 125} // namespace scene
126} // namespace irr 126} // namespace irr
127 127
128#endif 128#endif
129 129