Polyphase Game Engine
Loading...
Searching...
No Matches
ParticleSystem Class Reference

#include <ParticleSystem.h>

Inheritance diagram for ParticleSystem:
Asset Object ParticleSystemInstance

Public Member Functions

 DECLARE_ASSET (ParticleSystem, Asset)
 
 ParticleSystem ()
 
 ~ParticleSystem ()
 
virtual void LoadStream (Stream &stream, Platform platform) override
 
virtual void SaveStream (Stream &stream, Platform platform) override
 
virtual void Create () override
 
virtual void Destroy () override
 
virtual bool Import (const std::string &path, ImportOptions *options) override
 
virtual void GatherProperties (std::vector< Property > &outProps) override
 
virtual glm::vec4 GetTypeColor () override
 
virtual const char * GetTypeName () override
 
virtual bool ShouldSnapshotForPie () const override
 
void SetMaterial (Material *material)
 
MaterialGetMaterial () const
 
const ParticleParamsGetParams () const
 
ParticleParamsGetParams ()
 
void SetParams (const ParticleParams &params)
 
void SetDuration (float duration)
 
float GetDuration () const
 
void SetSpawnRate (float spawnRate)
 
float GetSpawnRate () const
 
void SetBurstCount (uint32_t burstCount)
 
uint32_t GetBurstCount () const
 
void SetBurstWindow (float window)
 
float GetBurstWindow () const
 
void SetMaxParticles (uint32_t maxParticles)
 
uint32_t GetMaxParticles () const
 
void SetLoops (uint32_t loops)
 
uint32_t GetLoops () const
 
void SetRadialVelocity (bool radial)
 
bool IsRadialVelocity () const
 
void SetRadialSpawn (bool radial)
 
bool IsRadialSpawn () const
 
void SetLockedRatio (bool lockedRatio)
 
bool IsRatioLocked () const
 
Bounds GetBounds () const
 
- Public Member Functions inherited from Asset
 DECLARE_FACTORY_MANAGER (Asset)
 
 DECLARE_FACTORY (Asset, Asset)
 
 DECLARE_OBJECT (Asset, Object)
 
 Asset ()
 
virtual ~Asset ()
 
virtual void Copy (Asset *srcAsset)
 
const std::string & GetName () const
 
bool IsLoaded () const
 
bool IsRefCounted () const
 
int32_t GetRefCount () const
 
bool IsEmbedded () const
 
void SetEmbedded (bool embed)
 
bool IsEngineAsset () const
 
void SetEngineAsset (bool engineAsset)
 
void SetName (const std::string &name)
 
void IncrementRefCount ()
 
void DecrementRefCount ()
 
void LoadFile (const char *path, AsyncLoadRequest *request=nullptr)
 
void LoadEmbedded (const EmbeddedFile *embeddedAsset, AsyncLoadRequest *request=nullptr)
 
void SaveFile (const char *path, Platform platform)
 
virtual const char * GetTypeImportExt ()
 
bool IsTransient () const
 
void SetTransient (bool transient)
 
uint64_t GetUuid () const
 
void SetUuid (uint64_t uuid)
 
void EnsureUuid ()
 
void WriteHeader (Stream &stream)
 
- Public Member Functions inherited from Object
virtual ~Object ()=default
 
virtual const char * RuntimeName () const =0
 
virtual const char * RuntimeParentName () const =0
 
virtual RuntimeId InstanceRuntimeId () const =0
 
virtual ObjectQueryInterface (RuntimeId id) const
 
virtual bool Is (RuntimeId id) const
 
virtual bool Is (const char *name) const
 
virtual bool DrawCustomProperty (Property &prop)
 
template<typename T >
T * As () const
 
virtual bool Equals (const Object *rhs) const
 

Static Public Member Functions

static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 
- Static Public Member Functions inherited from Asset
static AssetHeader ReadHeader (Stream &stream)
 
static std::string GetNameFromPath (const std::string &path)
 
static std::string GetDirectoryFromPath (const std::string &path)
 
static const char * GetNameFromTypeId (TypeId id)
 
static TypeId GetTypeIdFromName (const char *name)
 
- Static Public Member Functions inherited from Object
static const char * ClassRuntimeName ()
 

Protected Attributes

float mDuration = 1.0f
 
float mSpawnRate = 10.0f
 
uint32_t mBurstCount = 0
 
float mBurstWindow = 0.1f
 
uint32_t mMaxParticles = 0
 
uint32_t mLoops = 0
 
ParticleLoopMode mLoopMode = ParticleLoopMode::Infinite
 
bool mRadialVelocity = false
 
bool mRadialSpawn = false
 
bool mLockedRatio = true
 
MaterialRef mMaterial = nullptr
 
Bounds mBounds
 
ParticleParams mParams
 
- Protected Attributes inherited from Asset
uint32_t mVersion = 0
 
TypeId mType = INVALID_TYPE_ID
 
uint64_t mUuid = 0
 
bool mEmbedded = false
 
bool mLoaded = false
 
bool mEnableRefCount = true
 
bool mEngineAsset = false
 
bool mTransient = false
 
std::string mName = "Asset"
 
int32_t mRefCount = 0
 

Constructor & Destructor Documentation

◆ ParticleSystem()

ParticleSystem::ParticleSystem ( )

◆ ~ParticleSystem()

ParticleSystem::~ParticleSystem ( )

Member Function Documentation

◆ Create()

void ParticleSystem::Create ( )
overridevirtual

Reimplemented from Asset.

◆ DECLARE_ASSET()

ParticleSystem::DECLARE_ASSET ( ParticleSystem  ,
Asset   
)

◆ Destroy()

void ParticleSystem::Destroy ( )
overridevirtual

Reimplemented from Asset.

◆ GatherProperties()

void ParticleSystem::GatherProperties ( std::vector< Property > &  outProps)
overridevirtual

Reimplemented from Asset.

◆ GetBounds()

Bounds ParticleSystem::GetBounds ( ) const

◆ GetBurstCount()

uint32_t ParticleSystem::GetBurstCount ( ) const

◆ GetBurstWindow()

float ParticleSystem::GetBurstWindow ( ) const

◆ GetDuration()

float ParticleSystem::GetDuration ( ) const

◆ GetLoops()

uint32_t ParticleSystem::GetLoops ( ) const

◆ GetMaterial()

Material * ParticleSystem::GetMaterial ( ) const

◆ GetMaxParticles()

uint32_t ParticleSystem::GetMaxParticles ( ) const

◆ GetParams() [1/2]

ParticleParams & ParticleSystem::GetParams ( )

◆ GetParams() [2/2]

const ParticleParams & ParticleSystem::GetParams ( ) const

◆ GetSpawnRate()

float ParticleSystem::GetSpawnRate ( ) const

◆ GetTypeColor()

glm::vec4 ParticleSystem::GetTypeColor ( )
overridevirtual

Reimplemented from Asset.

◆ GetTypeName()

const char * ParticleSystem::GetTypeName ( )
overridevirtual

Reimplemented from Asset.

◆ HandlePropChange()

bool ParticleSystem::HandlePropChange ( Datum datum,
uint32_t  index,
const void *  newValue 
)
static

◆ Import()

bool ParticleSystem::Import ( const std::string &  path,
ImportOptions options 
)
overridevirtual

Reimplemented from Asset.

◆ IsRadialSpawn()

bool ParticleSystem::IsRadialSpawn ( ) const

◆ IsRadialVelocity()

bool ParticleSystem::IsRadialVelocity ( ) const

◆ IsRatioLocked()

bool ParticleSystem::IsRatioLocked ( ) const

◆ LoadStream()

void ParticleSystem::LoadStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

Reimplemented in ParticleSystemInstance.

◆ SaveStream()

void ParticleSystem::SaveStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

Reimplemented in ParticleSystemInstance.

◆ SetBurstCount()

void ParticleSystem::SetBurstCount ( uint32_t  burstCount)

◆ SetBurstWindow()

void ParticleSystem::SetBurstWindow ( float  window)

◆ SetDuration()

void ParticleSystem::SetDuration ( float  duration)

◆ SetLockedRatio()

void ParticleSystem::SetLockedRatio ( bool  lockedRatio)

◆ SetLoops()

void ParticleSystem::SetLoops ( uint32_t  loops)

◆ SetMaterial()

void ParticleSystem::SetMaterial ( Material material)

◆ SetMaxParticles()

void ParticleSystem::SetMaxParticles ( uint32_t  maxParticles)

◆ SetParams()

void ParticleSystem::SetParams ( const ParticleParams params)

◆ SetRadialSpawn()

void ParticleSystem::SetRadialSpawn ( bool  radial)

◆ SetRadialVelocity()

void ParticleSystem::SetRadialVelocity ( bool  radial)

◆ SetSpawnRate()

void ParticleSystem::SetSpawnRate ( float  spawnRate)

◆ ShouldSnapshotForPie()

virtual bool ParticleSystem::ShouldSnapshotForPie ( ) const
inlineoverridevirtual

Reimplemented from Asset.

Member Data Documentation

◆ mBounds

Bounds ParticleSystem::mBounds
protected

◆ mBurstCount

uint32_t ParticleSystem::mBurstCount = 0
protected

◆ mBurstWindow

float ParticleSystem::mBurstWindow = 0.1f
protected

◆ mDuration

float ParticleSystem::mDuration = 1.0f
protected

◆ mLockedRatio

bool ParticleSystem::mLockedRatio = true
protected

◆ mLoopMode

ParticleLoopMode ParticleSystem::mLoopMode = ParticleLoopMode::Infinite
protected

◆ mLoops

uint32_t ParticleSystem::mLoops = 0
protected

◆ mMaterial

MaterialRef ParticleSystem::mMaterial = nullptr
protected

◆ mMaxParticles

uint32_t ParticleSystem::mMaxParticles = 0
protected

◆ mParams

ParticleParams ParticleSystem::mParams
protected

◆ mRadialSpawn

bool ParticleSystem::mRadialSpawn = false
protected

◆ mRadialVelocity

bool ParticleSystem::mRadialVelocity = false
protected

◆ mSpawnRate

float ParticleSystem::mSpawnRate = 10.0f
protected

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