![]() |
Kochol Game Engine
0.1.0
|
#include <ParticleSystem.h>
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. | |
ParticleSystem & | SetTexture (const char *filename) |
ParticleSystem & | SetShader (const char *filename) |
ParticleSystem & | SetTextureRect (const math::Vector &rect, unsigned int horizontalFrames, unsigned int verticalFrames) |
ParticleSystem & | SetMesh (const char *filename) |
ParticleSystem & | SetMaxParticles (unsigned int num) |
maximum particles | |
void | SetSharedBuffer (gfx::HardwareBuffer *ib) |
ParticleSystem & | SetEmission (unsigned int num) |
emission rate per second | |
ParticleSystem & | SetRespawnRate (float respawnRate) |
ParticleSystem & | SetRanges (const math::Vector &ranges) |
Ranges of particle system. | |
ParticleSystem & | SetEmitterDirection (const math::Vector &direction) |
direction of emission | |
ParticleSystem & | SetSpeed (float speed) |
direction variation in radians | |
ParticleSystem & | SetRotationSpeed (float speed) |
angular velocity of particles (radians in seconds) | |
ParticleSystem & | SetInitialParticleSize (const math::Vector &size) |
size of particles | |
ParticleSystem & | SetFinalParticleSize (const math::Vector &size) |
size of particles | |
ParticleSystem & | SetInitialColor (const gfx::Colorf &color) |
ParticleSystem & | SetMiddleColor (const gfx::Colorf &color) |
ParticleSystem & | SetFinalColor (const gfx::Colorf &color) |
ParticleSystem & | SetWeight (float minWeight, float maxWeight) |
minimum and maximum weight of particles | |
ParticleSystem & | SetMinAge (float lowerBound, float upperBound) |
range for minimum age of particles in seconds | |
ParticleSystem & | SetMaxAge (float maxAge) |
maximum age of particles in seconds | |
ParticleSystem & | SetEmitterAngle (float angle) |
angle of cone | |
ParticleSystem & | SetEmitterRadius (float radius) |
radius of sphere | |
ParticleSystem & | SetEmitterDimensions (const math::Vector &size) |
dimensions of box | |
ParticleSystem & | SetTargetDimensions (const math::Vector &size) |
dimensions of target box | |
ParticleSystem & | SetTargetDistance (float distance) |
ParticleSystem & | AddForce (const math::Vector &force) |
ParticleSystem & | SetForce (const math::Vector &force) |
ParticleSystem & | SetGravity (const math::Vector &gravity) |
ParticleSystem & | SetRotatable (bool rotatable) |
ParticleSystem & | SetRemoveOnInactive (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::Vector & | GetRanges () const |
math::Vector | GetEmitterDirection () const |
float | GetSpeed () const |
float | GetRotationSpeed () const |
math::Vector | GetInitialParticleSize () const |
math::Vector | GetFinalParticleSize () const |
const gfx::Colorf & | GetInitialColor () const |
const gfx::Colorf & | GetMiddleColor () const |
const gfx::Colorf & | GetFinalColor () 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::Vector & | GetForce () const |
const math::Vector & | GetGravity () const |
bool | GetRotatable () const |
bool | GetRemoveOnInactive () const |
bool | GetFlush () const |
![]() | |
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::Vector & | GetPosition () const |
Returns the node position. | |
virtual const math::Vector & | GetRotation () const |
Returns the node rotation. | |
virtual const math::Vector & | GetScale () const |
Returns the node scale. | |
virtual math::Matrix * | GetAbsoluteMatrix () const |
Get the absolute matrix. | |
virtual math::Matrix * | GetFinalMatrix () |
Get the final matrix. | |
virtual u32 | GetMaterialCount () |
Get the count of materials this node has. | |
virtual gfx::Material * | GetMaterial (u32 Index) |
virtual math::Sphere * | GetBoundingBox () |
Returns the node bounding box. | |
virtual math::AABB * | GetAxisAlignedBoundingBox () |
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 SceneNode * | GetParent () |
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::String * | GetName () |
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. | |
![]() | |
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. | |
ParticleSystem & | operator= (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::Vector > | m_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 |
RBuffer * | m_rb |
Additional Inherited Members | |
![]() | |
virtual bool | HasThisEffect (efx::EffectType p) |
![]() | |
core::String | m_sName |
int | m_iID |
SceneManager * | m_pSnMan |
gfx::Renderer * | m_pRenderer |
bool | m_bVis |
bool | m_bAutoCulling |
bool | m_bVisFrame |
SceneNode * | m_pParent |
std::vector< SceneNode * > | m_vChilds |
std::vector< int > | m_vEffectType |
std::vector< efx::Effect * > | m_vEffect |
math::Matrix * | m_pAbsMat |
math::Matrix * | m_pFinalMat |
math::Vector | m_Position |
math::Vector | m_Rotation |
math::Vector | m_Scale |
math::Sphere * | m_pBB |
math::AABB * | m_pAABB |
NodeType | m_eNodeType |
bool | m_hasShadow |
Definition at line 152 of file ParticleSystem.h.
|
private |
Copy constructor.
kge::sn::ParticleSystem::ParticleSystem | ( | const ParticleSystemParameters & | p | ) |
Constructor.
kge::sn::ParticleSystem::~ParticleSystem | ( | ) |
Destructor.
void kge::sn::ParticleSystem::Activate | ( | bool | active | ) |
Activate or deactivate system.
ParticleSystem& kge::sn::ParticleSystem::AddForce | ( | const math::Vector & | force | ) |
|
virtual |
Draw the node with/without its Materials and Transforms.
WithMaterial | Draw it with its own materials or not? |
WithMaterial | Draw 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 | ) |
|
inline |
Definition at line 310 of file ParticleSystem.h.
|
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 |
|
inline |
Definition at line 322 of file ParticleSystem.h.
|
inline |
Definition at line 382 of file ParticleSystem.h.
math::Vector kge::sn::ParticleSystem::GetFinalParticleSize | ( | ) | const |
|
inline |
Definition at line 430 of file ParticleSystem.h.
|
inline |
Definition at line 418 of file ParticleSystem.h.
size_t kge::sn::ParticleSystem::GetForces | ( | const math::Vector ** | forces | ) | const |
|
inline |
Definition at line 421 of file ParticleSystem.h.
unsigned int kge::sn::ParticleSystem::GetHorizontalImages | ( | ) | const |
|
inline |
Definition at line 376 of file ParticleSystem.h.
math::Vector kge::sn::ParticleSystem::GetInitialParticleSize | ( | ) | 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 |
|
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 |
|
inline |
Definition at line 358 of file ParticleSystem.h.
|
inline |
Definition at line 427 of file ParticleSystem.h.
|
inline |
Definition at line 328 of file ParticleSystem.h.
float kge::sn::ParticleSystem::GetRespawnRate | ( | ) | const |
|
inline |
Definition at line 424 of file ParticleSystem.h.
|
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 |
|
inline |
Definition at line 319 of file ParticleSystem.h.
|
inline |
Definition at line 194 of file ParticleSystem.h.
|
private |
Assignment operator.
|
virtual |
The jobs after rendering.
Implements kge::sn::SceneNode.
|
virtual |
The jobs before rendering like culling and calculate position and update state of the particle system through time.
Implements kge::sn::SceneNode.
|
inline |
Definition at line 301 of file ParticleSystem.h.
|
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
|
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.
|
inline |
Definition at line 292 of file ParticleSystem.h.
ParticleSystem& kge::sn::ParticleSystem::SetRespawnRate | ( | float | respawnRate | ) |
|
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.
|
private |
Definition at line 447 of file ParticleSystem.h.
|
private |
Definition at line 442 of file ParticleSystem.h.
|
private |
Definition at line 434 of file ParticleSystem.h.
|
private |
Definition at line 441 of file ParticleSystem.h.
|
private |
Definition at line 433 of file ParticleSystem.h.
|
private |
Definition at line 449 of file ParticleSystem.h.
|
private |
Definition at line 453 of file ParticleSystem.h.
|
private |
Definition at line 445 of file ParticleSystem.h.
|
private |
Definition at line 446 of file ParticleSystem.h.
|
private |
Definition at line 448 of file ParticleSystem.h.
|
private |
Definition at line 452 of file ParticleSystem.h.
|
private |
Definition at line 439 of file ParticleSystem.h.
|
private |
Definition at line 443 of file ParticleSystem.h.
|
private |
Definition at line 456 of file ParticleSystem.h.
|
private |
Definition at line 444 of file ParticleSystem.h.
|
private |
Definition at line 458 of file ParticleSystem.h.
|
private |
Definition at line 451 of file ParticleSystem.h.
|
private |
Definition at line 435 of file ParticleSystem.h.
|
private |
Definition at line 450 of file ParticleSystem.h.
|
private |
Definition at line 437 of file ParticleSystem.h.
|
private |
Definition at line 438 of file ParticleSystem.h.