Unravel Engine C++ Reference
Loading...
Searching...
No Matches
ps::ParticleSystem Struct Reference

Classes

struct  BatchedParticle
 

Public Member Functions

void init (uint16_t _maxEmitters, bx::AllocatorI *_allocator)
 
void shutdown ()
 
void renderEmitterById (EmitterHandle _handle, uint8_t _view, bgfx::ProgramHandle _program, const float *_mtxView, const math::vec3 &_eye, bgfx::TextureHandle _texture)
 
void generateInstanceData (Emitter &emitter, bgfx::InstanceDataBuffer &idb, uint32_t maxInstances, uint16_t instanceStride, const math::vec3 &_eye)
 
uint32_t renderEmitterBatch (const EmitterHandle *_handles, uint32_t _count, uint8_t _view, bgfx::ProgramHandle _program, const float *_mtxView, const math::vec3 &_eye, bgfx::TextureHandle _texture)
 
void generateBatchedInstanceData (const EmitterHandle *_handles, uint32_t _count, bgfx::InstanceDataBuffer &idb, uint32_t maxInstances, uint16_t instanceStride, const math::vec3 &_eye)
 
EmitterHandle createEmitter (EmitterShape::Enum _shape, EmitterDirection::Enum _direction, uint32_t _maxParticles)
 
void updateEmitter (EmitterHandle _handle, float _dt, EmitterUniforms *_uniforms)
 
void getAabb (EmitterHandle _handle, math::bbox &_outAabb)
 
uint32_t getNumParticles (EmitterHandle _handle)
 
bool hasUpdated (EmitterHandle _handle)
 
void destroyEmitter (EmitterHandle _handle)
 

Static Public Member Functions

static int32_t batchedParticleSortFn (const void *_lhs, const void *_rhs)
 

Public Attributes

bx::AllocatorI * m_allocator
 
bx::HandleAlloc * m_emitterAlloc
 
std::vector< Emitterm_emitter
 
bgfx::VertexBufferHandle m_quadVBH
 
bgfx::IndexBufferHandle m_quadIBH
 
bgfx::UniformHandle s_texColor
 

Detailed Description

Definition at line 652 of file particle_system.cpp.

Member Function Documentation

◆ batchedParticleSortFn()

static int32_t ps::ParticleSystem::batchedParticleSortFn ( const void * _lhs,
const void * _rhs )
inlinestatic

Definition at line 805 of file particle_system.cpp.

◆ createEmitter()

EmitterHandle ps::ParticleSystem::createEmitter ( EmitterShape::Enum _shape,
EmitterDirection::Enum _direction,
uint32_t _maxParticles )
inline

Definition at line 950 of file particle_system.cpp.

◆ destroyEmitter()

void ps::ParticleSystem::destroyEmitter ( EmitterHandle _handle)
inline

Definition at line 996 of file particle_system.cpp.

◆ generateBatchedInstanceData()

void ps::ParticleSystem::generateBatchedInstanceData ( const EmitterHandle * _handles,
uint32_t _count,
bgfx::InstanceDataBuffer & idb,
uint32_t maxInstances,
uint16_t instanceStride,
const math::vec3 & _eye )
inline

Definition at line 882 of file particle_system.cpp.

◆ generateInstanceData()

void ps::ParticleSystem::generateInstanceData ( Emitter & emitter,
bgfx::InstanceDataBuffer & idb,
uint32_t maxInstances,
uint16_t instanceStride,
const math::vec3 & _eye )
inline

Definition at line 749 of file particle_system.cpp.

◆ getAabb()

void ps::ParticleSystem::getAabb ( EmitterHandle _handle,
math::bbox & _outAabb )
inline

Definition at line 979 of file particle_system.cpp.

◆ getNumParticles()

uint32_t ps::ParticleSystem::getNumParticles ( EmitterHandle _handle)
inline

Definition at line 984 of file particle_system.cpp.

◆ hasUpdated()

bool ps::ParticleSystem::hasUpdated ( EmitterHandle _handle)
inline

Definition at line 990 of file particle_system.cpp.

◆ init()

void ps::ParticleSystem::init ( uint16_t _maxEmitters,
bx::AllocatorI * _allocator )
inline

Definition at line 654 of file particle_system.cpp.

◆ renderEmitterBatch()

uint32_t ps::ParticleSystem::renderEmitterBatch ( const EmitterHandle * _handles,
uint32_t _count,
uint8_t _view,
bgfx::ProgramHandle _program,
const float * _mtxView,
const math::vec3 & _eye,
bgfx::TextureHandle _texture )
inline

Definition at line 813 of file particle_system.cpp.

◆ renderEmitterById()

void ps::ParticleSystem::renderEmitterById ( EmitterHandle _handle,
uint8_t _view,
bgfx::ProgramHandle _program,
const float * _mtxView,
const math::vec3 & _eye,
bgfx::TextureHandle _texture )
inline

Definition at line 697 of file particle_system.cpp.

◆ shutdown()

void ps::ParticleSystem::shutdown ( )
inline

Definition at line 684 of file particle_system.cpp.

◆ updateEmitter()

void ps::ParticleSystem::updateEmitter ( EmitterHandle _handle,
float _dt,
EmitterUniforms * _uniforms )
inline

Definition at line 962 of file particle_system.cpp.

Member Data Documentation

◆ m_allocator

bx::AllocatorI* ps::ParticleSystem::m_allocator

Definition at line 1004 of file particle_system.cpp.

◆ m_emitter

std::vector<Emitter> ps::ParticleSystem::m_emitter

Definition at line 1007 of file particle_system.cpp.

◆ m_emitterAlloc

bx::HandleAlloc* ps::ParticleSystem::m_emitterAlloc

Definition at line 1006 of file particle_system.cpp.

◆ m_quadIBH

bgfx::IndexBufferHandle ps::ParticleSystem::m_quadIBH

Definition at line 1011 of file particle_system.cpp.

◆ m_quadVBH

bgfx::VertexBufferHandle ps::ParticleSystem::m_quadVBH

Definition at line 1010 of file particle_system.cpp.

◆ s_texColor

bgfx::UniformHandle ps::ParticleSystem::s_texColor

Definition at line 1013 of file particle_system.cpp.


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