Commit 93bf9460 authored by hybrid's avatar hybrid

Some coding style changes, made one method const.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1242 dfc29bdd-3216-0410-991c-e03cc46cb475
parent daedda85
...@@ -83,13 +83,11 @@ namespace scene ...@@ -83,13 +83,11 @@ namespace scene
virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0; virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0;
//! How the relative transformation of the bone is used //! How the relative transformation of the bone is used
virtual E_BONE_SKINNING_SPACE getSkinningSpace() =0; virtual E_BONE_SKINNING_SPACE getSkinningSpace() const =0;
//! updates the absolute position based on the relative and the parents position //! updates the absolute position based on the relative and the parents position
virtual void updateAbsolutePositionOfAllChildren()=0; virtual void updateAbsolutePositionOfAllChildren()=0;
s32 positionHint; s32 positionHint;
s32 scaleHint; s32 scaleHint;
s32 rotationHint; s32 rotationHint;
......
#include "CBoneSceneNode.h" #include "CBoneSceneNode.h"
namespace irr namespace irr
{ {
namespace scene namespace scene
...@@ -17,11 +14,6 @@ CBoneSceneNode::CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, ...@@ -17,11 +14,6 @@ CBoneSceneNode::CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
} }
//! destructor
CBoneSceneNode::~CBoneSceneNode()
{
}
//! Returns the name of the bone //! Returns the name of the bone
const c8* CBoneSceneNode::getBoneName() const const c8* CBoneSceneNode::getBoneName() const
...@@ -82,8 +74,6 @@ void CBoneSceneNode::OnAnimate(u32 timeMs) ...@@ -82,8 +74,6 @@ void CBoneSceneNode::OnAnimate(u32 timeMs)
} }
void CBoneSceneNode::helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node) void CBoneSceneNode::helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node)
{ {
Node->updateAbsolutePosition(); Node->updateAbsolutePosition();
...@@ -102,9 +92,6 @@ void CBoneSceneNode::updateAbsolutePositionOfAllChildren() ...@@ -102,9 +92,6 @@ void CBoneSceneNode::updateAbsolutePositionOfAllChildren()
} }
void CBoneSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const void CBoneSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{ {
out->addInt("BoneIndex", BoneIndex); out->addInt("BoneIndex", BoneIndex);
...@@ -112,13 +99,16 @@ void CBoneSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeRea ...@@ -112,13 +99,16 @@ void CBoneSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeRea
out->addEnum("AnimationMode", AnimationMode, BoneAnimationModeNames); out->addEnum("AnimationMode", AnimationMode, BoneAnimationModeNames);
} }
void CBoneSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) void CBoneSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
{ {
BoneIndex = in->getAttributeAsInt("BoneIndex"); BoneIndex = in->getAttributeAsInt("BoneIndex");
BoneName = in->getAttributeAsString("BoneName"); BoneName = in->getAttributeAsString("BoneName");
AnimationMode = (E_BONE_ANIMATION_MODE)in->getAttributeAsEnumeration("AnimationMode", BoneAnimationModeNames); AnimationMode = (E_BONE_ANIMATION_MODE)in->getAttributeAsEnumeration("AnimationMode", BoneAnimationModeNames);
// todo: add/replace bone in parent with bone from mesh // TODO: add/replace bone in parent with bone from mesh
} }
} // namespace scene } // namespace scene
} // namespace irr } // namespace irr
...@@ -20,9 +20,6 @@ namespace scene ...@@ -20,9 +20,6 @@ namespace scene
CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr,
s32 id=-1, u32 boneIndex=0, const c8* boneName=0); s32 id=-1, u32 boneIndex=0, const c8* boneName=0);
//! destructor
~CBoneSceneNode();
//! Returns the name of the bone //! Returns the name of the bone
virtual const c8* getBoneName() const; virtual const c8* getBoneName() const;
...@@ -38,14 +35,13 @@ namespace scene ...@@ -38,14 +35,13 @@ namespace scene
//! returns the axis aligned bounding box of this node //! returns the axis aligned bounding box of this node
virtual const core::aabbox3d<f32>& getBoundingBox() const; virtual const core::aabbox3d<f32>& getBoundingBox() const;
/*
//! Returns the relative transformation of the scene node. //! Returns the relative transformation of the scene node.
//virtual core::matrix4 getRelativeTransformation() const; //virtual core::matrix4 getRelativeTransformation() const;
*/
virtual void OnAnimate(u32 timeMs); virtual void OnAnimate(u32 timeMs);
void helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node);
virtual void updateAbsolutePositionOfAllChildren(); virtual void updateAbsolutePositionOfAllChildren();
//! Writes attributes of the scene node. //! Writes attributes of the scene node.
...@@ -60,22 +56,20 @@ namespace scene ...@@ -60,22 +56,20 @@ namespace scene
SkinningSpace=space; SkinningSpace=space;
} }
virtual E_BONE_SKINNING_SPACE getSkinningSpace() virtual E_BONE_SKINNING_SPACE getSkinningSpace() const
{ {
return SkinningSpace; return SkinningSpace;
} }
private: private:
void helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node);
E_BONE_ANIMATION_MODE AnimationMode; E_BONE_ANIMATION_MODE AnimationMode;
E_BONE_SKINNING_SPACE SkinningSpace; E_BONE_SKINNING_SPACE SkinningSpace;
u32 BoneIndex; u32 BoneIndex;
core::stringc BoneName; core::stringc BoneName;
core::aabbox3d<f32> Box; core::aabbox3d<f32> Box;
}; };
......
...@@ -1500,13 +1500,14 @@ E_DRIVER_TYPE CNullDriver::getDriverType() const ...@@ -1500,13 +1500,14 @@ E_DRIVER_TYPE CNullDriver::getDriverType() const
void CNullDriver::deleteMaterialRenders() void CNullDriver::deleteMaterialRenders()
{ {
// delete material renderers // delete material renderers
for (int i=0; i<(int)MaterialRenderers.size(); ++i) for (u32 i=0; i<MaterialRenderers.size(); ++i)
if (MaterialRenderers[i].Renderer) if (MaterialRenderers[i].Renderer)
MaterialRenderers[i].Renderer->drop(); MaterialRenderers[i].Renderer->drop();
MaterialRenderers.clear(); MaterialRenderers.clear();
} }
//! Returns pointer to material renderer or null //! Returns pointer to material renderer or null
IMaterialRenderer* CNullDriver::getMaterialRenderer(u32 idx) IMaterialRenderer* CNullDriver::getMaterialRenderer(u32 idx)
{ {
...@@ -1517,7 +1518,6 @@ IMaterialRenderer* CNullDriver::getMaterialRenderer(u32 idx) ...@@ -1517,7 +1518,6 @@ IMaterialRenderer* CNullDriver::getMaterialRenderer(u32 idx)
} }
//! Returns amount of currently available material renderers. //! Returns amount of currently available material renderers.
u32 CNullDriver::getMaterialRendererCount() const u32 CNullDriver::getMaterialRendererCount() const
{ {
......
This diff is collapsed.
...@@ -112,9 +112,6 @@ namespace scene ...@@ -112,9 +112,6 @@ namespace scene
//! (This feature is not implementated in irrlicht yet) //! (This feature is not implementated in irrlicht yet)
virtual bool setHardwareSkinning(bool on); virtual bool setHardwareSkinning(bool on);
//Interface for the mesh loaders (finalize should lock these functions, and they should have some prefix like loader_ //Interface for the mesh loaders (finalize should lock these functions, and they should have some prefix like loader_
//these functions will use the needed arrays, set vaules, etc to help the loaders //these functions will use the needed arrays, set vaules, etc to help the loaders
...@@ -131,21 +128,16 @@ namespace scene ...@@ -131,21 +128,16 @@ namespace scene
//! loaders should call this after populating the mesh //! loaders should call this after populating the mesh
virtual void finalize(); virtual void finalize();
virtual SSkinMeshBuffer *createBuffer(); virtual SSkinMeshBuffer *createBuffer();
virtual SJoint *createJoint(SJoint *parent=0); virtual SJoint *createJoint(SJoint *parent=0);
virtual SPositionKey *createPositionKey(SJoint *joint); virtual SPositionKey *createPositionKey(SJoint *joint);
virtual SScaleKey *createScaleKey(SJoint *joint);
virtual SRotationKey *createRotationKey(SJoint *joint); virtual SRotationKey *createRotationKey(SJoint *joint);
virtual SScaleKey *createScaleKey(SJoint *joint);
virtual SWeight *createWeight(SJoint *joint); virtual SWeight *createWeight(SJoint *joint);
private: private:
void checkForAnimation(); void checkForAnimation();
...@@ -158,7 +150,7 @@ private: ...@@ -158,7 +150,7 @@ private:
void getFrameData(f32 frame,SJoint *Node,core::vector3df &position, s32 &positionHint, core::vector3df &scale, s32 &scaleHint, core::quaternion &rotation, s32 &rotationHint); void getFrameData(f32 frame,SJoint *Node,core::vector3df &position, s32 &positionHint, core::vector3df &scale, s32 &scaleHint, core::quaternion &rotation, s32 &rotationHint);
void CalculateGlobalMatrixes(SJoint *Joint,SJoint *ParentJoint); void CalculateGlobalMatrices(SJoint *Joint,SJoint *ParentJoint);
void SkinJoint(SJoint *Joint, SJoint *ParentJoint); void SkinJoint(SJoint *Joint, SJoint *ParentJoint);
...@@ -183,8 +175,8 @@ private: ...@@ -183,8 +175,8 @@ private:
f32 AnimationFrames; f32 AnimationFrames;
f32 lastAnimatedFrame; f32 LastAnimatedFrame;
f32 lastSkinnedFrame; f32 LastSkinnedFrame;
bool BoneControlUsed; bool BoneControlUsed;
bool AnimateNormals; bool AnimateNormals;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment