Rebel Fork Framework
Urho3D::ParticleEffect Class Reference

Particle effect definition. More...

#include <Urho3D/Graphics/ParticleEffect.h>

Inheritance diagram for Urho3D::ParticleEffect:
Urho3D::Resource Urho3D::Object Urho3D::RefCounted

Public Member Functions

 ParticleEffect (Context *context)
 Construct.
 
 ~ParticleEffect () override
 Destruct.
 
bool BeginLoad (Deserializer &source) override
 Load resource from stream. May be called from a worker thread. Return true if successful.
 
bool EndLoad () override
 Finish resource loading. Always called from the main thread. Return true if successful.
 
bool Save (Serializer &dest) const override
 Save resource. Return true if successful.
 
bool Save (XMLElement &dest) const
 Save resource to XMLElement. Return true if successful.
 
bool Load (const XMLElement &source)
 Load resource from XMLElement synchronously. Return true if successful.
 
void SetMaterial (Material *material)
 
void SetNumParticles (unsigned num)
 
void SetUpdateInvisible (bool enable)
 
void SetRelative (bool enable)
 
void SetScaled (bool enable)
 
void SetSorted (bool enable)
 
void SetFixedScreenSize (bool enable)
 
void SetAnimationLodBias (float lodBias)
 
void SetEmitterType (EmitterType type)
 
void SetEmitterSize (const Vector3 &size)
 
void SetMinDirection (const Vector3 &direction)
 
void SetMaxDirection (const Vector3 &direction)
 
void SetConstantForce (const Vector3 &force)
 
void SetDampingForce (float force)
 
void SetActiveTime (float time)
 
void SetInactiveTime (float time)
 
void SetMinEmissionRate (float rate)
 
void SetMaxEmissionRate (float rate)
 
void SetMinParticleSize (const Vector2 &size)
 
void SetMaxParticleSize (const Vector2 &size)
 
void SetMinTimeToLive (float time)
 
void SetMaxTimeToLive (float time)
 
void SetMinVelocity (float velocity)
 
void SetMaxVelocity (float velocity)
 
void SetMinRotation (float rotation)
 
void SetMaxRotation (float rotation)
 
void SetMinRotationSpeed (float speed)
 
void SetMaxRotationSpeed (float speed)
 
void SetSizeAdd (float sizeAdd)
 
void SetSizeMul (float sizeMul)
 
void SetFaceCameraMode (FaceCameraMode mode)
 
void AddColorTime (const Color &color, float time)
 Add a color frame sorted in the correct position based on time.
 
void AddColorFrame (const ColorFrame &colorFrame)
 Add a color frame sorted in the correct position based on time.
 
void RemoveColorFrame (unsigned index)
 Remove color frame at index.
 
void SetColorFrames (const ea::vector< ColorFrame > &colorFrames)
 Set color animation of particles.
 
void SetColorFrame (unsigned index, const ColorFrame &colorFrame)
 Set color animation frame at index. If index is greater than number of color frames, new color frames are added.
 
void SetNumColorFrames (unsigned number)
 
void SortColorFrames ()
 Sort the list of color frames based on time.
 
void AddTextureTime (const Rect &uv, float time)
 Add a texture frame sorted in the correct position based on time.
 
void AddTextureFrame (const TextureFrame &textureFrame)
 Add a texture frame sorted in the correct position based on time.
 
void RemoveTextureFrame (unsigned index)
 Remove texture frame at index.
 
void SetTextureFrames (const ea::vector< TextureFrame > &textureFrames)
 Set particle texture animation.
 
void SetTextureFrame (unsigned index, const TextureFrame &textureFrame)
 Set number of texture animation frames.
 
void SetNumTextureFrames (unsigned number)
 
void SortTextureFrames ()
 Sort the list of texture frames based on time.
 
SharedPtr< ParticleEffectClone (const ea::string &cloneName=EMPTY_STRING) const
 Clone the particle effect. More...
 
MaterialGetMaterial () const
 
unsigned GetNumParticles () const
 
bool GetUpdateInvisible () const
 
bool IsRelative () const
 
bool IsScaled () const
 
bool IsSorted () const
 
bool IsFixedScreenSize () const
 
float GetAnimationLodBias () const
 
EmitterType GetEmitterType () const
 
const Vector3GetEmitterSize () const
 
const Vector3GetMinDirection () const
 
const Vector3GetMaxDirection () const
 
const Vector3GetConstantForce () const
 
float GetDampingForce () const
 
float GetActiveTime () const
 
float GetInactiveTime () const
 
float GetMinEmissionRate () const
 
float GetMaxEmissionRate () const
 
const Vector2GetMinParticleSize () const
 
const Vector2GetMaxParticleSize () const
 
float GetMinTimeToLive () const
 
float GetMaxTimeToLive () const
 
float GetMinVelocity () const
 
float GetMaxVelocity () const
 
float GetMinRotation () const
 
float GetMaxRotation () const
 
float GetMinRotationSpeed () const
 
float GetMaxRotationSpeed () const
 
float GetSizeAdd () const
 
float GetSizeMul () const
 
const ea::vector< ColorFrame > & GetColorFrames () const
 Return all color animation frames.
 
unsigned GetNumColorFrames () const
 
const ColorFrameGetColorFrame (unsigned index) const
 Return a color animation frame, or null if outside range.
 
const ea::vector< TextureFrame > & GetTextureFrames () const
 Return all texture animation frames.
 
unsigned GetNumTextureFrames () const
 
const TextureFrameGetTextureFrame (unsigned index) const
 Return a texture animation frame, or null if outside range.
 
FaceCameraMode GetFaceCameraMode () const
 
Vector3 GetRandomDirection () const
 Return random direction.
 
Vector2 GetRandomSize () const
 Return random size.
 
float GetRandomVelocity () const
 Return random velocity.
 
float GetRandomTimeToLive () const
 Return random timetolive.
 
float GetRandomRotationSpeed () const
 Return random rotationspeed.
 
float GetRandomRotation () const
 Return random rotation.
 
bool Load (Deserializer &source)
 Load resource synchronously. Call both BeginLoad() & EndLoad() and return true if both succeeded.
 
- Public Member Functions inherited from Urho3D::Resource
 Resource (Context *context)
 Construct.
 
bool Load (Deserializer &source)
 Load resource synchronously. Call both BeginLoad() & EndLoad() and return true if both succeeded.
 
bool LoadFile (const FileIdentifier &fileName)
 Load resource from file.
 
virtual bool SaveFile (const FileIdentifier &fileName) const
 Save resource to file.
 
void SetName (const ea::string &name)
 
void SetMemoryUse (unsigned size)
 Set memory use in bytes, possibly approximate.
 
void ResetUseTimer ()
 Reset last used timer.
 
void SetAsyncLoadState (AsyncLoadState newState)
 Set the asynchronous loading state. Called by ResourceCache. Resources in the middle of asynchronous loading are not normally returned to user.
 
void SetAbsoluteFileName (const ea::string &fileName)
 Set absolute file name.
 
const ea::string & GetName () const
 
StringHash GetNameHash () const
 Return name hash.
 
unsigned GetMemoryUse () const
 
unsigned GetUseTimer ()
 
AsyncLoadState GetAsyncLoadState () const
 Return the asynchronous loading state.
 
const ea::string & GetAbsoluteFileName () const
 Return absolute file name.
 
- Public Member Functions inherited from Urho3D::Object
 Object (Context *context)
 Construct.
 
 ~Object () override
 Destruct. Clean up self from event sender & receiver structures.
 
virtual StringHash GetType () const =0
 
virtual const ea::string & GetTypeName () const =0
 
virtual const TypeInfoGetTypeInfo () const =0
 Return type info.
 
virtual bool IsInstanceOf (StringHash type) const =0
 Check whether current instance implements specified type.
 
virtual void OnEvent (Object *sender, StringHash eventType, VariantMap &eventData)
 Handle event.
 
virtual void SerializeInBlock (Archive &archive)
 Serialize content from/to archive. May throw ArchiveException.
 
template<typename T >
bool IsInstanceOf () const
 Check current instance is type of specified class.
 
template<typename T >
T * Cast ()
 Cast the object to specified most derived class.
 
template<typename T >
const T * Cast () const
 Cast the object to specified most derived class.
 
void SubscribeToEventManual (StringHash eventType, EventHandler *handler)
 Subscribe to an event that can be sent by any sender.
 
void SubscribeToEventManual (Object *sender, StringHash eventType, EventHandler *handler)
 Subscribe to a specific sender's event.
 
template<class T >
void SubscribeToEvent (StringHash eventType, T handler)
 Subscribe to an event that can be sent by any sender.
 
template<class T >
void SubscribeToEvent (Object *sender, StringHash eventType, T handler)
 Subscribe to a specific sender's event.
 
void UnsubscribeFromEvent (StringHash eventType)
 Unsubscribe from an event.
 
void UnsubscribeFromEvent (Object *sender, StringHash eventType)
 Unsubscribe from a specific sender's event.
 
void UnsubscribeFromEvents (Object *sender)
 Unsubscribe from a specific sender's events.
 
void UnsubscribeFromAllEvents ()
 Unsubscribe from all events.
 
void UnsubscribeFromAllEventsExcept (const ea::vector< StringHash > &exceptions)
 Unsubscribe from all events except those listed.
 
void UnsubscribeFromAllEventsExcept (const ea::vector< Object * > &exceptions)
 Unsubscribe from all events except those with listed senders.
 
void SendEvent (StringHash eventType)
 Send event to all subscribers.
 
void SendEvent (StringHash eventType, VariantMap &eventData)
 Send event with parameters to all subscribers.
 
VariantMapGetEventDataMap () const
 Return a preallocated map for event data. Used for optimization to avoid constant re-allocation of event data maps.
 
template<typename... Args>
void SendEvent (StringHash eventType, const Args &... args)
 Send event with variadic parameter pairs to all subscribers. The parameters are (paramID, paramValue) pairs.
 
ContextGetContext () const
 Return execution context.
 
const VariantGetGlobalVar (StringHash key) const
 
const VariantMapGetGlobalVars () const
 
void SetGlobalVar (StringHash key, const Variant &value)
 
ObjectGetSubsystem (StringHash type) const
 Return subsystem by type.
 
ObjectGetEventSender () const
 Return active event sender. Null outside event handling.
 
EventHandlerGetEventHandler () const
 Return active event handler. Null outside event handling.
 
bool HasSubscribedToEvent (StringHash eventType) const
 Return whether has subscribed to an event without specific sender.
 
bool HasSubscribedToEvent (Object *sender, StringHash eventType) const
 Return whether has subscribed to a specific sender's event.
 
bool HasEventHandlers () const
 Return whether has subscribed to any event.
 
template<class T >
T * GetSubsystem () const
 Template version of returning a subsystem.
 
const ea::string & GetCategory () const
 
void SendEvent (StringHash eventType, const VariantMap &eventData)
 Send event with parameters to all subscribers.
 
void SetBlockEvents (bool block)
 Block object from sending and receiving events.
 
bool GetBlockEvents () const
 Return sending and receiving events blocking status.
 
- Public Member Functions inherited from Urho3D::RefCounted
 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
 
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 
 RefCounted (const RefCounted &rhs)=delete
 Prevent copy construction.
 
RefCountedoperator= (const RefCounted &rhs)=delete
 Prevent assignment.
 
int AddRef ()
 
int ReleaseRef ()
 
int Refs () const
 
int WeakRefs () const
 
RefCountRefCountPtr () const
 Return pointer to the reference count structure.
 
bool HasScriptObject () const
 Return true if script runtime object wrapping this native object exists.
 
bool IsScriptStrongRef () const
 Return true if script reference is strong.
 

Static Public Member Functions

static void RegisterObject (Context *context)
 
- Static Public Member Functions inherited from Urho3D::Resource
static ResourceLoadFromCache (Context *context, StringHash type, const ea::string &name)
 Load resource by reference.
 
- Static Public Member Functions inherited from Urho3D::Object
static const TypeInfoGetTypeInfoStatic ()
 Return type info static.
 

Private Member Functions

 URHO3D_OBJECT (ParticleEffect, Resource)
 
void GetFloatMinMax (const XMLElement &element, float &minValue, float &maxValue)
 Read a float range from an XML element.
 
void GetVector2MinMax (const XMLElement &element, Vector2 &minValue, Vector2 &maxValue)
 Read a Vector2 range from an XML element.
 
void GetVector3MinMax (const XMLElement &element, Vector3 &minValue, Vector3 &maxValue)
 Read a Vector3 from an XML element.
 

Private Attributes

SharedPtr< Materialmaterial_
 Material.
 
unsigned numParticles_
 Number of particles.
 
bool updateInvisible_
 Update when invisible flag.
 
bool relative_
 Billboards relative flag.
 
bool scaled_
 Scale affects billboard scale flag.
 
bool sorted_
 Billboards sorted flag.
 
bool fixedScreenSize_
 Billboards fixed screen size flag.
 
float animationLodBias_
 Animation LOD bias.
 
EmitterType emitterType_
 Emitter shape.
 
Vector3 emitterSize_
 Emitter size.
 
Vector3 directionMin_
 Particle direction minimum.
 
Vector3 directionMax_
 Particle direction maximum.
 
Vector3 constantForce_
 Particle constant force.
 
float dampingForce_
 Particle velocity damping force.
 
float activeTime_
 Active period.
 
float inactiveTime_
 Inactive period.
 
float emissionRateMin_
 Particles per second minimum.
 
float emissionRateMax_
 Particles per second maximum.
 
Vector2 sizeMin_
 Particle size minimum.
 
Vector2 sizeMax_
 Particle size maximum.
 
float timeToLiveMin_
 Particle time to live minimum.
 
float timeToLiveMax_
 Particle time to live maximum.
 
float velocityMin_
 Particle velocity minimum.
 
float velocityMax_
 Particle velocity maximum.
 
float rotationMin_
 Particle rotation angle minimum.
 
float rotationMax_
 Particle rotation angle maximum.
 
float rotationSpeedMin_
 Particle rotation speed minimum.
 
float rotationSpeedMax_
 Particle rotation speed maximum.
 
float sizeAdd_
 Particle size additive parameter.
 
float sizeMul_
 Particle size multiplicative parameter.
 
ea::vector< ColorFramecolorFrames_
 Particle color animation frames.
 
ea::vector< TextureFrametextureFrames_
 Texture animation frames.
 
ea::string loadMaterialName_
 Material name acquired during BeginLoad().
 
FaceCameraMode faceCameraMode_
 Particle rotation mode in relation to the camera.
 

Additional Inherited Members

- Static Public Attributes inherited from Urho3D::Object
static constexpr ea::array< StringHash, 0 > TypeHierarchy {}
 
- Protected Attributes inherited from Urho3D::Object
WeakPtr< Contextcontext_
 Execution context.
 

Detailed Description

Particle effect definition.

Member Function Documentation

◆ Clone()

SharedPtr< ParticleEffect > Urho3D::ParticleEffect::Clone ( const ea::string &  cloneName = EMPTY_STRING) const

Clone the particle effect.

◆ GetActiveTime()

float Urho3D::ParticleEffect::GetActiveTime ( ) const
inline

Return emission active period length (0 = infinite).

◆ GetAnimationLodBias()

float Urho3D::ParticleEffect::GetAnimationLodBias ( ) const
inline

Return animation Lod bias.

◆ GetConstantForce()

const Vector3& Urho3D::ParticleEffect::GetConstantForce ( ) const
inline

Return constant force acting on particles.

◆ GetDampingForce()

float Urho3D::ParticleEffect::GetDampingForce ( ) const
inline

Return particle velocity damping force.

◆ GetEmitterSize()

const Vector3& Urho3D::ParticleEffect::GetEmitterSize ( ) const
inline

Return emitter size.

◆ GetEmitterType()

EmitterType Urho3D::ParticleEffect::GetEmitterType ( ) const
inline

Return emitter type.

◆ GetFaceCameraMode()

FaceCameraMode Urho3D::ParticleEffect::GetFaceCameraMode ( ) const
inline

Return how the particles rotate in relation to the camera.

◆ GetInactiveTime()

float Urho3D::ParticleEffect::GetInactiveTime ( ) const
inline

Return emission inactive period length (0 = infinite).

◆ GetMaterial()

Material* Urho3D::ParticleEffect::GetMaterial ( ) const
inline

Return material.

◆ GetMaxDirection()

const Vector3& Urho3D::ParticleEffect::GetMaxDirection ( ) const
inline

Return positive direction limit.

◆ GetMaxEmissionRate()

float Urho3D::ParticleEffect::GetMaxEmissionRate ( ) const
inline

Return maximum emission rate.

◆ GetMaxParticleSize()

const Vector2& Urho3D::ParticleEffect::GetMaxParticleSize ( ) const
inline

Return particle maximum size.

◆ GetMaxRotation()

float Urho3D::ParticleEffect::GetMaxRotation ( ) const
inline

Return particle maximum rotation.

◆ GetMaxRotationSpeed()

float Urho3D::ParticleEffect::GetMaxRotationSpeed ( ) const
inline

Return particle maximum rotation speed.

◆ GetMaxTimeToLive()

float Urho3D::ParticleEffect::GetMaxTimeToLive ( ) const
inline

Return particle maximum time to live.

◆ GetMaxVelocity()

float Urho3D::ParticleEffect::GetMaxVelocity ( ) const
inline

Return particle maximum velocity.

◆ GetMinDirection()

const Vector3& Urho3D::ParticleEffect::GetMinDirection ( ) const
inline

Return negative direction limit.

◆ GetMinEmissionRate()

float Urho3D::ParticleEffect::GetMinEmissionRate ( ) const
inline

Return minimum emission rate.

◆ GetMinParticleSize()

const Vector2& Urho3D::ParticleEffect::GetMinParticleSize ( ) const
inline

Return particle minimum size.

◆ GetMinRotation()

float Urho3D::ParticleEffect::GetMinRotation ( ) const
inline

Return particle minimum rotation.

◆ GetMinRotationSpeed()

float Urho3D::ParticleEffect::GetMinRotationSpeed ( ) const
inline

Return particle minimum rotation speed.

◆ GetMinTimeToLive()

float Urho3D::ParticleEffect::GetMinTimeToLive ( ) const
inline

Return particle minimum time to live.

◆ GetMinVelocity()

float Urho3D::ParticleEffect::GetMinVelocity ( ) const
inline

Return particle minimum velocity.

◆ GetNumColorFrames()

unsigned Urho3D::ParticleEffect::GetNumColorFrames ( ) const
inline

Return number of color animation frames.

◆ GetNumParticles()

unsigned Urho3D::ParticleEffect::GetNumParticles ( ) const
inline

Return maximum number of particles.

◆ GetNumTextureFrames()

unsigned Urho3D::ParticleEffect::GetNumTextureFrames ( ) const
inline

Return number of texture animation frames.

◆ GetSizeAdd()

float Urho3D::ParticleEffect::GetSizeAdd ( ) const
inline

Return particle size additive modifier.

◆ GetSizeMul()

float Urho3D::ParticleEffect::GetSizeMul ( ) const
inline

Return particle size multiplicative modifier.

◆ GetUpdateInvisible()

bool Urho3D::ParticleEffect::GetUpdateInvisible ( ) const
inline

Return whether to update when particles are not visible.

◆ IsFixedScreenSize()

bool Urho3D::ParticleEffect::IsFixedScreenSize ( ) const
inline

Return whether billboards are fixed screen size.

◆ IsRelative()

bool Urho3D::ParticleEffect::IsRelative ( ) const
inline

Return whether billboards are relative to the scene node.

◆ IsScaled()

bool Urho3D::ParticleEffect::IsScaled ( ) const
inline

Return whether scene node scale affects billboards' size.

◆ IsSorted()

bool Urho3D::ParticleEffect::IsSorted ( ) const
inline

Return whether billboards are sorted.

◆ RegisterObject()

void Urho3D::ParticleEffect::RegisterObject ( Context context)
static

Register object factory.

◆ SetActiveTime()

void Urho3D::ParticleEffect::SetActiveTime ( float  time)

Set emission active period length (0 = infinite).

◆ SetAnimationLodBias()

void Urho3D::ParticleEffect::SetAnimationLodBias ( float  lodBias)

Set animation LOD bias.

◆ SetConstantForce()

void Urho3D::ParticleEffect::SetConstantForce ( const Vector3 force)

Set constant force acting on particles.

◆ SetDampingForce()

void Urho3D::ParticleEffect::SetDampingForce ( float  force)

Set particle velocity damping force.

◆ SetEmitterSize()

void Urho3D::ParticleEffect::SetEmitterSize ( const Vector3 size)

Set emitter size.

◆ SetEmitterType()

void Urho3D::ParticleEffect::SetEmitterType ( EmitterType  type)

Set emitter type.

◆ SetFaceCameraMode()

void Urho3D::ParticleEffect::SetFaceCameraMode ( FaceCameraMode  mode)

Set how the particles should rotate in relation to the camera. Default is to follow camera rotation on all axes (FC_ROTATE_XYZ).

◆ SetFixedScreenSize()

void Urho3D::ParticleEffect::SetFixedScreenSize ( bool  enable)

Set whether billboards have fixed size on screen (measured in pixels) regardless of distance to camera.

◆ SetInactiveTime()

void Urho3D::ParticleEffect::SetInactiveTime ( float  time)

Set emission inactive period length (0 = infinite).

◆ SetMaterial()

void Urho3D::ParticleEffect::SetMaterial ( Material material)

Set material.

◆ SetMaxDirection()

void Urho3D::ParticleEffect::SetMaxDirection ( const Vector3 direction)

Set positive direction limit.

◆ SetMaxEmissionRate()

void Urho3D::ParticleEffect::SetMaxEmissionRate ( float  rate)

Set maximum emission rate.

◆ SetMaxParticleSize()

void Urho3D::ParticleEffect::SetMaxParticleSize ( const Vector2 size)

Set particle maximum size.

◆ SetMaxRotation()

void Urho3D::ParticleEffect::SetMaxRotation ( float  rotation)

Set particle maximum rotation.

◆ SetMaxRotationSpeed()

void Urho3D::ParticleEffect::SetMaxRotationSpeed ( float  speed)

Set particle maximum rotation speed.

◆ SetMaxTimeToLive()

void Urho3D::ParticleEffect::SetMaxTimeToLive ( float  time)

Set particle maximum time to live.

◆ SetMaxVelocity()

void Urho3D::ParticleEffect::SetMaxVelocity ( float  velocity)

Set particle maximum velocity.

◆ SetMinDirection()

void Urho3D::ParticleEffect::SetMinDirection ( const Vector3 direction)

Set negative direction limit.

◆ SetMinEmissionRate()

void Urho3D::ParticleEffect::SetMinEmissionRate ( float  rate)

Set minimum emission rate.

◆ SetMinParticleSize()

void Urho3D::ParticleEffect::SetMinParticleSize ( const Vector2 size)

Set particle minimum size.

◆ SetMinRotation()

void Urho3D::ParticleEffect::SetMinRotation ( float  rotation)

Set particle minimum rotation.

◆ SetMinRotationSpeed()

void Urho3D::ParticleEffect::SetMinRotationSpeed ( float  speed)

Set particle minimum rotation speed.

◆ SetMinTimeToLive()

void Urho3D::ParticleEffect::SetMinTimeToLive ( float  time)

Set particle minimum time to live.

◆ SetMinVelocity()

void Urho3D::ParticleEffect::SetMinVelocity ( float  velocity)

Set particle minimum velocity.

◆ SetNumColorFrames()

void Urho3D::ParticleEffect::SetNumColorFrames ( unsigned  number)

Set number of color frames.

◆ SetNumParticles()

void Urho3D::ParticleEffect::SetNumParticles ( unsigned  num)

Set maximum number of particles.

◆ SetNumTextureFrames()

void Urho3D::ParticleEffect::SetNumTextureFrames ( unsigned  number)

Set number of texture frames.

◆ SetRelative()

void Urho3D::ParticleEffect::SetRelative ( bool  enable)

Set whether billboards are relative to the scene node.

◆ SetScaled()

void Urho3D::ParticleEffect::SetScaled ( bool  enable)

Set whether scene node scale affects billboards' size.

◆ SetSizeAdd()

void Urho3D::ParticleEffect::SetSizeAdd ( float  sizeAdd)

Set particle size additive modifier.

◆ SetSizeMul()

void Urho3D::ParticleEffect::SetSizeMul ( float  sizeMul)

Set particle size multiplicative modifier.

◆ SetSorted()

void Urho3D::ParticleEffect::SetSorted ( bool  enable)

Set whether billboards are sorted by distance.

◆ SetUpdateInvisible()

void Urho3D::ParticleEffect::SetUpdateInvisible ( bool  enable)

Set whether to update when particles are not visible.


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