Commit a5654c66 authored by hybrid's avatar hybrid

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
parent 8099c45b
...@@ -169,12 +169,12 @@ namespace scene ...@@ -169,12 +169,12 @@ namespace scene
: Name ( name ) {} : Name ( name ) {}
// construct from a matrix // construct from a matrix
SMD3QuaterionTag ( const core::stringc& name, const core::matrix4 &m ) SMD3QuaterionTag ( const core::stringc& name, const core::matrix4 &m ) : Name(name), position(m.getTranslation()), rotation(m)
{ { }
Name = name;
position = m.getTranslation (); // construct from a position and euler angles in degrees
rotation = m; SMD3QuaterionTag ( const core::vector3df &pos, const core::vector3df &angle ) : position(pos), rotation(angle * core::DEGTORAD)
} { }
// set to matrix // set to matrix
void setto ( core::matrix4 &m ) void setto ( core::matrix4 &m )
...@@ -183,13 +183,6 @@ namespace scene ...@@ -183,13 +183,6 @@ namespace scene
m.setTranslation ( position ); 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 bool operator == ( const SMD3QuaterionTag &other ) const
{ {
return Name == other.Name; return Name == other.Name;
...@@ -217,7 +210,12 @@ namespace scene ...@@ -217,7 +210,12 @@ namespace scene
return Container.size(); return Container.size();
} }
SMD3QuaterionTag& operator[] (u32 index ) const SMD3QuaterionTag& operator[](u32 index) const
{
return Container[index];
}
SMD3QuaterionTag& operator[](u32 index)
{ {
return Container[index]; return Container[index];
} }
......
...@@ -536,6 +536,3 @@ public: ...@@ -536,6 +536,3 @@ public:
#endif #endif
...@@ -25,8 +25,8 @@ namespace scene ...@@ -25,8 +25,8 @@ namespace scene
//! A particle system scene node for creating snow, fire, exlosions, smoke... //! A particle system scene node for creating snow, fire, exlosions, smoke...
/** A scene node controlling a particle System. The behavior of the particles /** A scene node controlling a particle System. The behavior of the particles
can be controlling by setting the right particle emitters and effectors. can be controlled by setting the right particle emitters and affectors.
You can for example easily a campfire by doing this: You can for example easily create a campfire by doing this:
\code \code
scene::IParticleSystemSceneNode* p = scenemgr->addParticleSystemSceneNode(); scene::IParticleSystemSceneNode* p = scenemgr->addParticleSystemSceneNode();
...@@ -59,14 +59,14 @@ public: ...@@ -59,14 +59,14 @@ public:
const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0; const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0;
//! Sets if the particles should be global. //! 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. particle system scene node too, otherwise they completely ignore it.
Default is true. */ Default is true. */
virtual void setParticlesAreGlobal(bool global) = 0; virtual void setParticlesAreGlobal(bool global=true) = 0;
//! Sets the particle emitter, which creates the particles. //! Sets the particle emitter, which creates the particles.
/** A particle emitter can be created using one of the methods. For /** A particle emitter can be created using one of the createEmitter
example to create and use a simple PointEmitter, call methods. For example to create and use a simple PointEmitter, call
IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop(); IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop();
\param emitter: Sets the particle emitter. You can set this to 0 for \param emitter: Sets the particle emitter. You can set this to 0 for
removing the current emitter and stopping the particle system emitting removing the current emitter and stopping the particle system emitting
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
addAffector(p); addAffector(p);
p->drop(); p->drop();
\endcode \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. work.
\param affector: New affector. */ \param affector: New affector. */
virtual void addAffector(IParticleAffector* affector) = 0; virtual void addAffector(IParticleAffector* affector) = 0;
......
...@@ -157,8 +157,6 @@ namespace scene ...@@ -157,8 +157,6 @@ namespace scene
core::vector3df Animatedscale; core::vector3df Animatedscale;
core::quaternion Animatedrotation; core::quaternion Animatedrotation;
core::matrix4 GlobalInversedMatrix; //the x format pre-calculates this core::matrix4 GlobalInversedMatrix; //the x format pre-calculates this
private: private:
...@@ -192,21 +190,16 @@ namespace scene ...@@ -192,21 +190,16 @@ namespace scene
//! loaders should call this after populating the mesh //! loaders should call this after populating the mesh
virtual void finalize() = 0; virtual void finalize() = 0;
virtual SSkinMeshBuffer *createBuffer() = 0; virtual SSkinMeshBuffer *createBuffer() = 0;
virtual SJoint *createJoint(SJoint *parent=0) = 0; virtual SJoint *createJoint(SJoint *parent=0) = 0;
virtual SWeight *createWeight(SJoint *joint) = 0;
virtual SPositionKey *createPositionKey(SJoint *joint) = 0; virtual SPositionKey *createPositionKey(SJoint *joint) = 0;
virtual SScaleKey *createScaleKey(SJoint *joint) = 0; virtual SScaleKey *createScaleKey(SJoint *joint) = 0;
virtual SRotationKey *createRotationKey(SJoint *joint) = 0; virtual SRotationKey *createRotationKey(SJoint *joint) = 0;
virtual SWeight *createWeight(SJoint *joint) = 0;
virtual bool isStatic()=0; virtual bool isStatic()=0;
}; };
} // end namespace scene } // end namespace scene
......
...@@ -165,7 +165,7 @@ public: ...@@ -165,7 +165,7 @@ public:
//! Sets if the particles should be global. If they are, the particles are affected by //! 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 //! the movement of the particle system scene node too, otherwise they completely
//! ignore it. Default is true. //! ignore it. Default is true.
virtual void setParticlesAreGlobal(bool global); virtual void setParticlesAreGlobal(bool global=true);
//! Writes attributes of the scene node. //! Writes attributes of the scene node.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const; virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
......
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