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 ()
 
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, uint64_t _blend_state, bool _sort_by_depth)
 
uint32_t buildEmitterBatchPrefixes (const EmitterHandle *_handles, uint32_t _count)
 
uint32_t renderEmitterBatchByMode (const EmitterHandle *_handles, uint32_t _count, uint8_t _view, bgfx::ProgramHandle _program, const float *_mtxView, const math::vec3 &_eye, bgfx::TextureHandle _texture, uint64_t _blendState, bool _sort_by_depth)
 
void buildSortedBatchedParticles (const EmitterHandle *_handles, uint32_t _count, const math::vec3 &_eye, uint32_t totalParticles)
 
void writeDirectInstanceChunk (uint8_t *data, uint32_t globalStart, uint32_t count, const EmitterHandle *_handles, uint32_t _emitterCount, uint16_t instanceStride)
 
void writeBatchedInstanceChunk (uint8_t *data, uint32_t sortedStart, uint32_t sortedCount, const EmitterHandle *_handles, uint16_t instanceStride)
 
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 void writeParticleInstanceRow (uint8_t *row, const Emitter &emitter, const Particle &particle)
 

Public Attributes

bx::AllocatorI * m_allocator
 
bx::HandleAlloc * m_emitterAlloc
 
std::vector< Emitterm_emitter
 
std::vector< BatchedParticlebatched_particles_scratch_
 
std::vector< uint32_t > emitter_batch_prefix_scratch_
 
bgfx::VertexBufferHandle m_quadVBH
 
bgfx::IndexBufferHandle m_quadIBH
 
bgfx::UniformHandle s_texColor
 
bgfx::UniformHandle u_viewCamera
 
bgfx::UniformHandle u_eyePos
 

Detailed Description

Definition at line 1024 of file particle_system.cpp.

Member Function Documentation

◆ buildEmitterBatchPrefixes()

uint32_t ps::ParticleSystem::buildEmitterBatchPrefixes ( const EmitterHandle * _handles,
uint32_t _count )
inline

Definition at line 1132 of file particle_system.cpp.

◆ buildSortedBatchedParticles()

void ps::ParticleSystem::buildSortedBatchedParticles ( const EmitterHandle * _handles,
uint32_t _count,
const math::vec3 & _eye,
uint32_t totalParticles )
inline

Definition at line 1257 of file particle_system.cpp.

◆ createEmitter()

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

Definition at line 1466 of file particle_system.cpp.

◆ destroyEmitter()

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

Definition at line 1512 of file particle_system.cpp.

◆ getAabb()

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

Definition at line 1495 of file particle_system.cpp.

◆ getNumParticles()

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

Definition at line 1500 of file particle_system.cpp.

◆ hasUpdated()

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

Definition at line 1506 of file particle_system.cpp.

◆ init()

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

Definition at line 1026 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,
uint64_t _blend_state,
bool _sort_by_depth )
inline

Definition at line 1079 of file particle_system.cpp.

◆ renderEmitterBatchByMode()

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

Definition at line 1148 of file particle_system.cpp.

◆ shutdown()

void ps::ParticleSystem::shutdown ( )
inline

Definition at line 1057 of file particle_system.cpp.

◆ updateEmitter()

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

Definition at line 1478 of file particle_system.cpp.

◆ writeBatchedInstanceChunk()

void ps::ParticleSystem::writeBatchedInstanceChunk ( uint8_t * data,
uint32_t sortedStart,
uint32_t sortedCount,
const EmitterHandle * _handles,
uint16_t instanceStride )
inline

Definition at line 1417 of file particle_system.cpp.

◆ writeDirectInstanceChunk()

void ps::ParticleSystem::writeDirectInstanceChunk ( uint8_t * data,
uint32_t globalStart,
uint32_t count,
const EmitterHandle * _handles,
uint32_t _emitterCount,
uint16_t instanceStride )
inline

Definition at line 1354 of file particle_system.cpp.

◆ writeParticleInstanceRow()

static void ps::ParticleSystem::writeParticleInstanceRow ( uint8_t * row,
const Emitter & emitter,
const Particle & particle )
inlinestatic

Definition at line 1098 of file particle_system.cpp.

Member Data Documentation

◆ batched_particles_scratch_

std::vector<BatchedParticle> ps::ParticleSystem::batched_particles_scratch_

Definition at line 1524 of file particle_system.cpp.

◆ emitter_batch_prefix_scratch_

std::vector<uint32_t> ps::ParticleSystem::emitter_batch_prefix_scratch_

Definition at line 1525 of file particle_system.cpp.

◆ m_allocator

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

Definition at line 1520 of file particle_system.cpp.

◆ m_emitter

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

Definition at line 1523 of file particle_system.cpp.

◆ m_emitterAlloc

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

Definition at line 1522 of file particle_system.cpp.

◆ m_quadIBH

bgfx::IndexBufferHandle ps::ParticleSystem::m_quadIBH

Definition at line 1529 of file particle_system.cpp.

◆ m_quadVBH

bgfx::VertexBufferHandle ps::ParticleSystem::m_quadVBH

Definition at line 1528 of file particle_system.cpp.

◆ s_texColor

bgfx::UniformHandle ps::ParticleSystem::s_texColor

Definition at line 1531 of file particle_system.cpp.

◆ u_eyePos

bgfx::UniformHandle ps::ParticleSystem::u_eyePos

Definition at line 1533 of file particle_system.cpp.

◆ u_viewCamera

bgfx::UniformHandle ps::ParticleSystem::u_viewCamera

Definition at line 1532 of file particle_system.cpp.


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