Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::sn::ParticleSystem Class Reference

#include <ParticleSystem.h>

Inheritance diagram for kge::sn::ParticleSystem:
kge::sn::SceneNode kge::KgeUnknown

Public Member Functions

 ParticleSystem (const ParticleSystemParameters &p)
 Constructor.
 ~ParticleSystem ()
 Destructor.
void PreRender (float elapsedTime)
void Render ()
 Render the objects.
void PostRender ()
 The jobs after rendering.
void Draw (bool WithMaterial, bool WithTransform, bool bPosition, bool bNormalTexcoord, bool bTangentBinormal)
void Activate (bool active)
 Activate or deactivate system.
void Emit (unsigned int num)
void Toggle ()
 Toggle system.
bool IsActive () const
void Reset ()
 Reset particle system.
ParticleSystemSetTexture (const char *filename)
ParticleSystemSetShader (const char *filename)
ParticleSystemSetTextureRect (const math::Vector &rect, unsigned int horizontalFrames, unsigned int verticalFrames)
ParticleSystemSetMesh (const char *filename)
ParticleSystemSetMaxParticles (unsigned int num)
 maximum particles
void SetSharedBuffer (gfx::HardwareBuffer *ib)
ParticleSystemSetEmission (unsigned int num)
 emission rate per second
ParticleSystemSetRespawnRate (float respawnRate)
ParticleSystemSetRanges (const math::Vector &ranges)
 Ranges of particle system.
ParticleSystemSetEmitterDirection (const math::Vector &direction)
 direction of emission
ParticleSystemSetSpeed (float speed)
 direction variation in radians
ParticleSystemSetRotationSpeed (float speed)
 angular velocity of particles (radians in seconds)
ParticleSystemSetInitialParticleSize (const math::Vector &size)
 size of particles
ParticleSystemSetFinalParticleSize (const math::Vector &size)
 size of particles
ParticleSystemSetInitialColor (const gfx::Colorf &color)
ParticleSystemSetMiddleColor (const gfx::Colorf &color)
ParticleSystemSetFinalColor (const gfx::Colorf &color)
ParticleSystemSetWeight (float minWeight, float maxWeight)
 minimum and maximum weight of particles
ParticleSystemSetMinAge (float lowerBound, float upperBound)
 range for minimum age of particles in seconds
ParticleSystemSetMaxAge (float maxAge)
 maximum age of particles in seconds
ParticleSystemSetEmitterAngle (float angle)
 angle of cone
ParticleSystemSetEmitterRadius (float radius)
 radius of sphere
ParticleSystemSetEmitterDimensions (const math::Vector &size)
 dimensions of box
ParticleSystemSetTargetDimensions (const math::Vector &size)
 dimensions of target box
ParticleSystemSetTargetDistance (float distance)
ParticleSystemAddForce (const math::Vector &force)
ParticleSystemSetForce (const math::Vector &force)
ParticleSystemSetGravity (const math::Vector &gravity)
ParticleSystemSetRotatable (bool rotatable)
ParticleSystemSetRemoveOnInactive (bool rem)
void SetPos (float *x, float *y, float *z)
void SetFlush (bool flush)
void RemoveOnInactive (bool rem)
void EnableColor (bool hasColor)
void EnableAdditiveBlending (bool additiveBlending)
void EnableGravity (bool hasGravity)
bool HasColor () const
bool HasAdditiveBlending () const
bool HasGravity () const
ParticleEmitterType GetEmitterType () const
ParticleBehaviorType GetBehaviorType () const
ParticleRendererType GetRendererType () const
const char * GetTextureName () const
const char * GetShaderName () const
const char * GetMeshName () const
math::Vector GetTextureRect () const
unsigned int GetHorizontalImages () const
unsigned int GetVerticalImages () const
unsigned int GetMaxParticles () const
unsigned int GetEmission () const
float GetRespawnRate () const
const math::VectorGetRanges () const
math::Vector GetEmitterDirection () const
float GetSpeed () const
float GetRotationSpeed () const
math::Vector GetInitialParticleSize () const
math::Vector GetFinalParticleSize () const
const gfx::ColorfGetInitialColor () const
const gfx::ColorfGetMiddleColor () const
const gfx::ColorfGetFinalColor () const
float GetMinWeight () const
float GetMaxWeight () const
float GetMinAgeLB () const
float GetMinAgeUB () const
float GetMaxAge () const
float GetEmitterAngle () const
float GetEmitterRadius () const
math::Vector GetEmitterDimensions () const
math::Vector GetTargetDimensions () const
float GetTargetDistance () const
size_t GetForces (const math::Vector **forces) const
const math::VectorGetForce () const
const math::VectorGetGravity () const
bool GetRotatable () const
bool GetRemoveOnInactive () const
bool GetFlush () const
- Public Member Functions inherited from kge::sn::SceneNode
 SceneNode ()
 Constructor.
virtual ~SceneNode ()
 Destructor.
virtual void AddChild (SceneNode *child)
 Adds a node as child.
virtual bool AddEffect (efx::EffectType p, efx::Effect **ppOut)
virtual void SetSceneManager (SceneManager *smgr)
 Sets the scene manager and renderer pointer.
virtual void SetPosition (const math::Vector &v)
 Set the position of the scenenode.
virtual void SetRotation (const math::Vector &v)
 Set the rotation of the scenenode.
virtual void SetScale (const math::Vector &v)
 Set the scale of the scenenode.
virtual void SetAutomaticCulling (bool isTrue)
 Set Cutting Enable or Disable.
virtual void SetVisible (bool isVisible)
 Set Visible Enable or Disable.
virtual bool GetVisible ()
 Get Visible.
virtual bool IsVisibleInFrame ()
 Is it visible in this frame?
virtual const math::VectorGetPosition () const
 Returns the node position.
virtual const math::VectorGetRotation () const
 Returns the node rotation.
virtual const math::VectorGetScale () const
 Returns the node scale.
virtual math::MatrixGetAbsoluteMatrix () const
 Get the absolute matrix.
virtual math::MatrixGetFinalMatrix ()
 Get the final matrix.
virtual u32 GetMaterialCount ()
 Get the count of materials this node has.
virtual gfx::MaterialGetMaterial (u32 Index)
virtual math::SphereGetBoundingBox ()
 Returns the node bounding box.
virtual math::AABBGetAxisAlignedBoundingBox ()
 Returns the node Axis aligned bounding box.
virtual NodeType GetType () const
 Returns the node type.
virtual void RemoveChild (SceneNode *child)
virtual void RemoveChildren ()
 Removes all children of this node.
virtual const SceneNodeGetParent ()
 Returns the node parent.
virtual void SetParent (SceneNode *parent)
 Sets the node parent.
virtual void SetName (const char *name)
 Sets the node name.
virtual core::StringGetName ()
 Gets the node name.
virtual void SetID (int ID)
 Sets the node ID.
virtual int GetID ()
 Gets the node ID.
void EnableShadow (bool enable)
bool HasShadow () const
virtual void UpdateFinalMat ()
 Update final matrix.
- Public Member Functions inherited from kge::KgeUnknown
 KgeUnknown ()
 Constructor.
virtual ~KgeUnknown ()
 Destructor.
virtual void AddRef ()
 Add a reference to the object.
virtual void DecRef ()
 Decrease a reference from the object. if its reference count get 0 then the object will destroy.
u32 GetRefCount ()
 Return resource reference count.
const char * GetDebugText ()
 returns the instance debug text.

Private Member Functions

 ParticleSystem (const ParticleSystem &other)
 Copy constructor.
ParticleSystemoperator= (const ParticleSystem &other)
 Assignment operator.

Private Attributes

ParticleEmitterType m_emitterType
ParticleBehaviorType m_behaviorType
ParticleRendererType m_rendererType
std::string m_shaderName
std::string m_textureName
std::string m_meshName
ps::ParticleEmitter * m_emitter
ps::ParticleBehavior * m_behavior
ps::ParticleRenderer * m_particleRenderer
math::Vector m_ranges
std::vector< math::Vectorm_forces
math::Vector m_gravity
bool m_active
bool m_hasGravity
bool m_flush
bool m_rotateDirection
bool m_remove
unsigned int m_immNum
bool m_flushFlag
ps::Particles m_particles
RBufferm_rb

Additional Inherited Members

- Protected Member Functions inherited from kge::sn::SceneNode
virtual bool HasThisEffect (efx::EffectType p)
- Protected Attributes inherited from kge::sn::SceneNode
core::String m_sName
int m_iID
SceneManagerm_pSnMan
gfx::Rendererm_pRenderer
bool m_bVis
bool m_bAutoCulling
bool m_bVisFrame
SceneNodem_pParent
std::vector< SceneNode * > m_vChilds
std::vector< int > m_vEffectType
std::vector< efx::Effect * > m_vEffect
math::Matrixm_pAbsMat
math::Matrixm_pFinalMat
math::Vector m_Position
math::Vector m_Rotation
math::Vector m_Scale
math::Spherem_pBB
math::AABBm_pAABB
NodeType m_eNodeType
bool m_hasShadow

Detailed Description

Definition at line 152 of file ParticleSystem.h.

Constructor & Destructor Documentation

kge::sn::ParticleSystem::ParticleSystem ( const ParticleSystem other)
private

Copy constructor.

kge::sn::ParticleSystem::ParticleSystem ( const ParticleSystemParameters p)

Constructor.

kge::sn::ParticleSystem::~ParticleSystem ( )

Destructor.

Member Function Documentation

void kge::sn::ParticleSystem::Activate ( bool  active)

Activate or deactivate system.

ParticleSystem& kge::sn::ParticleSystem::AddForce ( const math::Vector force)
void kge::sn::ParticleSystem::Draw ( bool  WithMaterial,
bool  WithTransform,
bool  bPosition,
bool  bNormalTexcoord,
bool  bTangentBinormal 
)
virtual

Draw the node with/without its Materials and Transforms.

Parameters
WithMaterialDraw it with its own materials or not?
WithMaterialDraw it with its own Transformations or not?

Implements kge::sn::SceneNode.

void kge::sn::ParticleSystem::Emit ( unsigned int  num)
void kge::sn::ParticleSystem::EnableAdditiveBlending ( bool  additiveBlending)
void kge::sn::ParticleSystem::EnableColor ( bool  hasColor)
void kge::sn::ParticleSystem::EnableGravity ( bool  hasGravity)
inline

Definition at line 310 of file ParticleSystem.h.

ParticleBehaviorType kge::sn::ParticleSystem::GetBehaviorType ( ) const
inline

Definition at line 325 of file ParticleSystem.h.

unsigned int kge::sn::ParticleSystem::GetEmission ( ) const
float kge::sn::ParticleSystem::GetEmitterAngle ( ) const
math::Vector kge::sn::ParticleSystem::GetEmitterDimensions ( ) const
math::Vector kge::sn::ParticleSystem::GetEmitterDirection ( ) const
float kge::sn::ParticleSystem::GetEmitterRadius ( ) const
ParticleEmitterType kge::sn::ParticleSystem::GetEmitterType ( ) const
inline

Definition at line 322 of file ParticleSystem.h.

const gfx::Colorf& kge::sn::ParticleSystem::GetFinalColor ( ) const
inline

Definition at line 382 of file ParticleSystem.h.

math::Vector kge::sn::ParticleSystem::GetFinalParticleSize ( ) const
bool kge::sn::ParticleSystem::GetFlush ( ) const
inline

Definition at line 430 of file ParticleSystem.h.

const math::Vector& kge::sn::ParticleSystem::GetForce ( ) const
inline

Definition at line 418 of file ParticleSystem.h.

size_t kge::sn::ParticleSystem::GetForces ( const math::Vector **  forces) const
const math::Vector& kge::sn::ParticleSystem::GetGravity ( ) const
inline

Definition at line 421 of file ParticleSystem.h.

unsigned int kge::sn::ParticleSystem::GetHorizontalImages ( ) const
const gfx::Colorf& kge::sn::ParticleSystem::GetInitialColor ( ) const
inline

Definition at line 376 of file ParticleSystem.h.

math::Vector kge::sn::ParticleSystem::GetInitialParticleSize ( ) const
float kge::sn::ParticleSystem::GetMaxAge ( ) const
inline

Definition at line 397 of file ParticleSystem.h.

unsigned int kge::sn::ParticleSystem::GetMaxParticles ( ) const
float kge::sn::ParticleSystem::GetMaxWeight ( ) const
const char* kge::sn::ParticleSystem::GetMeshName ( ) const
const gfx::Colorf& kge::sn::ParticleSystem::GetMiddleColor ( ) const
inline

Definition at line 379 of file ParticleSystem.h.

float kge::sn::ParticleSystem::GetMinAgeLB ( ) const
float kge::sn::ParticleSystem::GetMinAgeUB ( ) const
float kge::sn::ParticleSystem::GetMinWeight ( ) const
const math::Vector& kge::sn::ParticleSystem::GetRanges ( ) const
inline

Definition at line 358 of file ParticleSystem.h.

bool kge::sn::ParticleSystem::GetRemoveOnInactive ( ) const
inline

Definition at line 427 of file ParticleSystem.h.

ParticleRendererType kge::sn::ParticleSystem::GetRendererType ( ) const
inline

Definition at line 328 of file ParticleSystem.h.

float kge::sn::ParticleSystem::GetRespawnRate ( ) const
bool kge::sn::ParticleSystem::GetRotatable ( ) const
inline

Definition at line 424 of file ParticleSystem.h.

float kge::sn::ParticleSystem::GetRotationSpeed ( ) const
inline

Definition at line 367 of file ParticleSystem.h.

const char* kge::sn::ParticleSystem::GetShaderName ( ) const
float kge::sn::ParticleSystem::GetSpeed ( ) const
math::Vector kge::sn::ParticleSystem::GetTargetDimensions ( ) const
float kge::sn::ParticleSystem::GetTargetDistance ( ) const
const char* kge::sn::ParticleSystem::GetTextureName ( ) const
math::Vector kge::sn::ParticleSystem::GetTextureRect ( ) const
unsigned int kge::sn::ParticleSystem::GetVerticalImages ( ) const
bool kge::sn::ParticleSystem::HasAdditiveBlending ( ) const
bool kge::sn::ParticleSystem::HasColor ( ) const
bool kge::sn::ParticleSystem::HasGravity ( ) const
inline

Definition at line 319 of file ParticleSystem.h.

bool kge::sn::ParticleSystem::IsActive ( ) const
inline

Definition at line 194 of file ParticleSystem.h.

ParticleSystem& kge::sn::ParticleSystem::operator= ( const ParticleSystem other)
private

Assignment operator.

void kge::sn::ParticleSystem::PostRender ( )
virtual

The jobs after rendering.

Implements kge::sn::SceneNode.

void kge::sn::ParticleSystem::PreRender ( float  elapsedTime)
virtual

The jobs before rendering like culling and calculate position and update state of the particle system through time.

Implements kge::sn::SceneNode.

void kge::sn::ParticleSystem::RemoveOnInactive ( bool  rem)
inline

Definition at line 301 of file ParticleSystem.h.

void kge::sn::ParticleSystem::Render ( )
virtual

Render the objects.

Implements kge::sn::SceneNode.

void kge::sn::ParticleSystem::Reset ( )

Reset particle system.

ParticleSystem& kge::sn::ParticleSystem::SetEmission ( unsigned int  num)

emission rate per second

ParticleSystem& kge::sn::ParticleSystem::SetEmitterAngle ( float  angle)

angle of cone

ParticleSystem& kge::sn::ParticleSystem::SetEmitterDimensions ( const math::Vector size)

dimensions of box

ParticleSystem& kge::sn::ParticleSystem::SetEmitterDirection ( const math::Vector direction)

direction of emission

ParticleSystem& kge::sn::ParticleSystem::SetEmitterRadius ( float  radius)

radius of sphere

ParticleSystem& kge::sn::ParticleSystem::SetFinalColor ( const gfx::Colorf color)
ParticleSystem& kge::sn::ParticleSystem::SetFinalParticleSize ( const math::Vector size)

size of particles

void kge::sn::ParticleSystem::SetFlush ( bool  flush)
inline

Definition at line 298 of file ParticleSystem.h.

ParticleSystem& kge::sn::ParticleSystem::SetForce ( const math::Vector force)
ParticleSystem& kge::sn::ParticleSystem::SetGravity ( const math::Vector gravity)

Standard gravity = Vector(0.0f, -9.80665f, 0.0f)

ParticleSystem& kge::sn::ParticleSystem::SetInitialColor ( const gfx::Colorf color)
ParticleSystem& kge::sn::ParticleSystem::SetInitialParticleSize ( const math::Vector size)

size of particles

ParticleSystem& kge::sn::ParticleSystem::SetMaxAge ( float  maxAge)

maximum age of particles in seconds

ParticleSystem& kge::sn::ParticleSystem::SetMaxParticles ( unsigned int  num)

maximum particles

ParticleSystem& kge::sn::ParticleSystem::SetMesh ( const char *  filename)
ParticleSystem& kge::sn::ParticleSystem::SetMiddleColor ( const gfx::Colorf color)
ParticleSystem& kge::sn::ParticleSystem::SetMinAge ( float  lowerBound,
float  upperBound 
)

range for minimum age of particles in seconds

void kge::sn::ParticleSystem::SetPos ( float *  x,
float *  y,
float *  z 
)
ParticleSystem& kge::sn::ParticleSystem::SetRanges ( const math::Vector ranges)

Ranges of particle system.

ParticleSystem& kge::sn::ParticleSystem::SetRemoveOnInactive ( bool  rem)
inline

Definition at line 292 of file ParticleSystem.h.

ParticleSystem& kge::sn::ParticleSystem::SetRespawnRate ( float  respawnRate)
ParticleSystem& kge::sn::ParticleSystem::SetRotatable ( bool  rotatable)
inline

Definition at line 289 of file ParticleSystem.h.

ParticleSystem& kge::sn::ParticleSystem::SetRotationSpeed ( float  speed)

angular velocity of particles (radians in seconds)

ParticleSystem& kge::sn::ParticleSystem::SetShader ( const char *  filename)
void kge::sn::ParticleSystem::SetSharedBuffer ( gfx::HardwareBuffer ib)
ParticleSystem& kge::sn::ParticleSystem::SetSpeed ( float  speed)

direction variation in radians

initial speed of particles

ParticleSystem& kge::sn::ParticleSystem::SetTargetDimensions ( const math::Vector size)

dimensions of target box

ParticleSystem& kge::sn::ParticleSystem::SetTargetDistance ( float  distance)
ParticleSystem& kge::sn::ParticleSystem::SetTexture ( const char *  filename)
ParticleSystem& kge::sn::ParticleSystem::SetTextureRect ( const math::Vector rect,
unsigned int  horizontalFrames,
unsigned int  verticalFrames 
)

rect.x = left, rect.y = top, rect.z = right, rect.w = bottom

ParticleSystem& kge::sn::ParticleSystem::SetWeight ( float  minWeight,
float  maxWeight 
)

minimum and maximum weight of particles

void kge::sn::ParticleSystem::Toggle ( )

Toggle system.

Member Data Documentation

bool kge::sn::ParticleSystem::m_active
private

Definition at line 447 of file ParticleSystem.h.

ps::ParticleBehavior* kge::sn::ParticleSystem::m_behavior
private

Definition at line 442 of file ParticleSystem.h.

ParticleBehaviorType kge::sn::ParticleSystem::m_behaviorType
private

Definition at line 434 of file ParticleSystem.h.

ps::ParticleEmitter* kge::sn::ParticleSystem::m_emitter
private

Definition at line 441 of file ParticleSystem.h.

ParticleEmitterType kge::sn::ParticleSystem::m_emitterType
private

Definition at line 433 of file ParticleSystem.h.

bool kge::sn::ParticleSystem::m_flush
private

Definition at line 449 of file ParticleSystem.h.

bool kge::sn::ParticleSystem::m_flushFlag
private

Definition at line 453 of file ParticleSystem.h.

std::vector<math::Vector> kge::sn::ParticleSystem::m_forces
private

Definition at line 445 of file ParticleSystem.h.

math::Vector kge::sn::ParticleSystem::m_gravity
private

Definition at line 446 of file ParticleSystem.h.

bool kge::sn::ParticleSystem::m_hasGravity
private

Definition at line 448 of file ParticleSystem.h.

unsigned int kge::sn::ParticleSystem::m_immNum
private

Definition at line 452 of file ParticleSystem.h.

std::string kge::sn::ParticleSystem::m_meshName
private

Definition at line 439 of file ParticleSystem.h.

ps::ParticleRenderer* kge::sn::ParticleSystem::m_particleRenderer
private

Definition at line 443 of file ParticleSystem.h.

ps::Particles kge::sn::ParticleSystem::m_particles
private

Definition at line 456 of file ParticleSystem.h.

math::Vector kge::sn::ParticleSystem::m_ranges
private

Definition at line 444 of file ParticleSystem.h.

RBuffer* kge::sn::ParticleSystem::m_rb
private

Definition at line 458 of file ParticleSystem.h.

bool kge::sn::ParticleSystem::m_remove
private

Definition at line 451 of file ParticleSystem.h.

ParticleRendererType kge::sn::ParticleSystem::m_rendererType
private

Definition at line 435 of file ParticleSystem.h.

bool kge::sn::ParticleSystem::m_rotateDirection
private

Definition at line 450 of file ParticleSystem.h.

std::string kge::sn::ParticleSystem::m_shaderName
private

Definition at line 437 of file ParticleSystem.h.

std::string kge::sn::ParticleSystem::m_textureName
private

Definition at line 438 of file ParticleSystem.h.


The documentation for this class was generated from the following file: