From a5654c661f640b7861f94269040cca6dc10be903 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 7 Aug 2008 10:16:12 +0000 Subject: [PATCH] Added default parameter for setParticlesAreGlobal. Code cleaning in other files. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1451 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/IAnimatedMeshMD3.h | 26 ++++++++++------------ include/IGUIEnvironment.h | 3 --- include/IParticleSystemSceneNode.h | 14 ++++++------ include/ISkinnedMesh.h | 9 +------- source/Irrlicht/CParticleSystemSceneNode.h | 2 +- 5 files changed, 21 insertions(+), 33 deletions(-) diff --git a/include/IAnimatedMeshMD3.h b/include/IAnimatedMeshMD3.h index 7b241846..1b62c0cd 100644 --- a/include/IAnimatedMeshMD3.h +++ b/include/IAnimatedMeshMD3.h @@ -169,12 +169,12 @@ namespace scene : Name ( name ) {} // construct from a matrix - SMD3QuaterionTag ( const core::stringc& name, const core::matrix4 &m ) - { - Name = name; - position = m.getTranslation (); - rotation = m; - } + SMD3QuaterionTag ( const core::stringc& name, const core::matrix4 &m ) : Name(name), position(m.getTranslation()), rotation(m) + { } + + // construct from a position and euler angles in degrees + SMD3QuaterionTag ( const core::vector3df &pos, const core::vector3df &angle ) : position(pos), rotation(angle * core::DEGTORAD) + { } // set to matrix void setto ( core::matrix4 &m ) @@ -183,13 +183,6 @@ namespace scene m.setTranslation ( position ); } - // construct from a position and euler angles in degrees - SMD3QuaterionTag ( const core::vector3df &pos, const core::vector3df &angle ) - { - position = pos; - rotation.set ( angle * core::DEGTORAD ); - } - bool operator == ( const SMD3QuaterionTag &other ) const { return Name == other.Name; @@ -217,7 +210,12 @@ namespace scene return Container.size(); } - SMD3QuaterionTag& operator[] (u32 index ) + const SMD3QuaterionTag& operator[](u32 index) const + { + return Container[index]; + } + + SMD3QuaterionTag& operator[](u32 index) { return Container[index]; } diff --git a/include/IGUIEnvironment.h b/include/IGUIEnvironment.h index 5d50ca11..ea54931c 100644 --- a/include/IGUIEnvironment.h +++ b/include/IGUIEnvironment.h @@ -536,6 +536,3 @@ public: #endif - - - diff --git a/include/IParticleSystemSceneNode.h b/include/IParticleSystemSceneNode.h index 967d4ff1..fe4bc6fd 100644 --- a/include/IParticleSystemSceneNode.h +++ b/include/IParticleSystemSceneNode.h @@ -25,8 +25,8 @@ namespace scene //! A particle system scene node for creating snow, fire, exlosions, smoke... /** A scene node controlling a particle System. The behavior of the particles -can be controlling by setting the right particle emitters and effectors. -You can for example easily a campfire by doing this: +can be controlled by setting the right particle emitters and affectors. +You can for example easily create a campfire by doing this: \code scene::IParticleSystemSceneNode* p = scenemgr->addParticleSystemSceneNode(); @@ -59,14 +59,14 @@ public: const core::dimension2d &size = core::dimension2d(5.0f, 5.0f)) = 0; //! Sets if the particles should be global. - /** If it is, the particles are affected by the movement of the + /** If they are, the particles are affected by the movement of the particle system scene node too, otherwise they completely ignore it. Default is true. */ - virtual void setParticlesAreGlobal(bool global) = 0; + virtual void setParticlesAreGlobal(bool global=true) = 0; //! Sets the particle emitter, which creates the particles. - /** A particle emitter can be created using one of the methods. For - example to create and use a simple PointEmitter, call + /** A particle emitter can be created using one of the createEmitter + methods. For example to create and use a simple PointEmitter, call IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop(); \param emitter: Sets the particle emitter. You can set this to 0 for removing the current emitter and stopping the particle system emitting @@ -82,7 +82,7 @@ public: addAffector(p); p->drop(); \endcode - Please note that a affector is not necessary for the particle system to + Please note that an affector is not necessary for the particle system to work. \param affector: New affector. */ virtual void addAffector(IParticleAffector* affector) = 0; diff --git a/include/ISkinnedMesh.h b/include/ISkinnedMesh.h index dd1097c7..047b9d62 100644 --- a/include/ISkinnedMesh.h +++ b/include/ISkinnedMesh.h @@ -157,8 +157,6 @@ namespace scene core::vector3df Animatedscale; core::quaternion Animatedrotation; - - core::matrix4 GlobalInversedMatrix; //the x format pre-calculates this private: @@ -192,21 +190,16 @@ namespace scene //! loaders should call this after populating the mesh virtual void finalize() = 0; - virtual SSkinMeshBuffer *createBuffer() = 0; virtual SJoint *createJoint(SJoint *parent=0) = 0; + virtual SWeight *createWeight(SJoint *joint) = 0; virtual SPositionKey *createPositionKey(SJoint *joint) = 0; virtual SScaleKey *createScaleKey(SJoint *joint) = 0; virtual SRotationKey *createRotationKey(SJoint *joint) = 0; - virtual SWeight *createWeight(SJoint *joint) = 0; - - virtual bool isStatic()=0; - - }; } // end namespace scene diff --git a/source/Irrlicht/CParticleSystemSceneNode.h b/source/Irrlicht/CParticleSystemSceneNode.h index ae1e1175..c536b4ed 100644 --- a/source/Irrlicht/CParticleSystemSceneNode.h +++ b/source/Irrlicht/CParticleSystemSceneNode.h @@ -165,7 +165,7 @@ public: //! Sets if the particles should be global. If they are, the particles are affected by //! the movement of the particle system scene node too, otherwise they completely //! ignore it. Default is true. - virtual void setParticlesAreGlobal(bool global); + virtual void setParticlesAreGlobal(bool global=true); //! Writes attributes of the scene node. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;