Nebula
|
#include <particlecontext.h>
Inherits Graphics::GraphicsContext.
Classes | |
struct | ParticleJobOutput |
struct | ParticleRuntime |
struct | ParticleSystemRuntime |
Public Types | |
enum | PlayMode { RestartIfPlaying , IgnoreIfPlaying } |
Public Member Functions | |
ParticleContext () | |
constructor | |
virtual | ~ParticleContext () |
destrucotr | |
Public Member Functions inherited from Graphics::GraphicsContext | |
GraphicsContext () | |
constructor | |
virtual | ~GraphicsContext () |
destructor | |
Static Public Member Functions | |
static void | Create () |
create particle context | |
static void | Setup (const Graphics::GraphicsEntityId id) |
setup particle context on model | |
static void | ShowParticle (const Graphics::GraphicsEntityId id) |
show particle based on index fetched from GetParticleId | |
static void | HideParticle (const Graphics::GraphicsEntityId id) |
hide particle | |
static void | Play (const Graphics::GraphicsEntityId id, const PlayMode mode) |
start playing particle | |
static void | Stop (const Graphics::GraphicsEntityId id) |
stop playing a particle | |
static void | UpdateParticles (const Graphics::FrameContext &ctx) |
start particle updating when frame starts | |
static void | OnPrepareView (const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx) |
prepare particles for current view | |
static void | WaitForParticleUpdates (const Graphics::FrameContext &ctx) |
stop particle updating when frame ends | |
static CoreGraphics::BufferId | GetParticleIndexBuffer () |
get the shared particle index buffer | |
static CoreGraphics::BufferId | GetParticleVertexBuffer () |
get the shared vertex buffer | |
static CoreGraphics::VertexLayoutId | GetParticleVertexLayout () |
get the shared vertex layout | |
static CoreGraphics::PrimitiveGroup & | GetParticlePrimitiveGroup () |
get the shared primitive group | |
static void | OnRenderDebug (uint32_t flags) |
debug rendering | |
Static Public Attributes | |
static CoreGraphics::MeshId | DefaultEmitterMesh |
static Threading::AtomicCounter | ConstantUpdateCounter = 0 |
static Threading::Event | totalCompletionEvent |
Private Types | |
enum | { ParticleSystems , ModelId , Runtime , ModelContextId } |
typedef Ids::IdAllocator< Util::Array< ParticleSystemRuntime >, Graphics::ContextEntityId, ParticleRuntime, Graphics::GraphicsEntityId > | ParticleContextAllocator |
Private Member Functions | |
__DeclareContext () | |
Static Private Member Functions | |
static void | EmitParticles (ParticleRuntime &rt, ParticleSystemRuntime &srt, Models::ParticleSystemNode *node, float stepTime) |
internal function for emitting new particles | |
static void | EmitParticle (ParticleRuntime &rt, ParticleSystemRuntime &srt, const Particles::EmitterAttrs &attrs, const Particles::EmitterMesh &mesh, const Particles::EnvelopeSampleBuffer &buffer, IndexT sampleIndex, float initialAge) |
internal function for emitting single particle | |
static void | RunParticleStep (ParticleRuntime &rt, ParticleSystemRuntime &srt, float stepTime, bool generateVtxList) |
internal function to emit a job for updating particles | |
static Graphics::ContextEntityId | Alloc () |
allocate a new slice for this context | |
static void | Dealloc (Graphics::ContextEntityId id) |
deallocate a slice | |
Static Private Attributes | |
static ParticleContextAllocator | particleContextAllocator |
Additional Inherited Members | |
Static Protected Member Functions inherited from Graphics::GraphicsContext | |
static void | InternalRegisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state) |
static void | InternalDeregisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state) |
template<class ID_ALLOCATOR > | |
static void | InternalDefragment (ID_ALLOCATOR &allocator, Graphics::GraphicsContextState &&state) |
|
private |
Particles::ParticleContext::ParticleContext | ( | ) |
constructor
|
virtual |
destrucotr
|
private |
|
inlinestaticprivate |
allocate a new slice for this context
|
static |
create particle context
|
inlinestaticprivate |
deallocate a slice
|
staticprivate |
internal function for emitting single particle
|
staticprivate |
internal function for emitting new particles
|
static |
get the shared particle index buffer
|
static |
get the shared primitive group
|
static |
get the shared vertex buffer
|
static |
get the shared vertex layout
|
static |
hide particle
|
static |
prepare particles for current view
|
static |
debug rendering
|
static |
start playing particle
|
staticprivate |
internal function to emit a job for updating particles
|
static |
setup particle context on model
|
static |
show particle based on index fetched from GetParticleId
|
static |
stop playing a particle
|
static |
start particle updating when frame starts
|
static |
stop particle updating when frame ends
|
static |
|
static |
|
staticprivate |
|
static |