24class EnvelopeSampleBuffer;
Defines a group of primitives as a subset of a vertex buffer and index buffer plus the primitive topo...
Definition primitivegroup.h:20
Definition graphicscontext.h:165
An ID allocator associates an id with a slice in an N number of arrays.
Definition idallocator.h:39
Ids::Id32 Alloc()
Allocate an object.
Definition idallocator.h:45
void Dealloc(Ids::Id32 index)
Deallocate an object. Just places it in freeids array for recycling.
Definition idallocator.h:65
Nebula's bounding box class.
Definition bbox.h:24
Definition particlesystemnode.h:23
A container for particle emitter attributes.
Definition emitterattrs.h:20
An emitter mesh holds positions and normals for particle emission.
Definition emittermesh.h:24
A lookup table for pre-sampled envelope curves.
Definition envelopesamplebuffer.h:19
Definition particlecontext.h:26
static void OnRenderDebug(uint32_t flags)
debug rendering
Definition particlecontext.cc:657
static void Create()
create particle context
Definition particlecontext.cc:76
static Graphics::ContextEntityId Alloc()
allocate a new slice for this context
Definition particlecontext.h:155
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
Definition particlecontext.cc:784
static void EmitParticles(ParticleRuntime &rt, ParticleSystemRuntime &srt, Models::ParticleSystemNode *node, float stepTime)
internal function for emitting new particles
Definition particlecontext.cc:677
static void Setup(const Graphics::GraphicsEntityId id)
setup particle context on model
Definition particlecontext.cc:216
static void RunParticleStep(ParticleRuntime &rt, ParticleSystemRuntime &srt, float stepTime, bool generateVtxList)
internal function to emit a job for updating particles
Definition particlecontext.cc:892
static ParticleContextAllocator particleContextAllocator
Definition particlecontext.h:135
static CoreGraphics::MeshId DefaultEmitterMesh
Definition particlecontext.h:78
static void HideParticle(const Graphics::GraphicsEntityId id)
hide particle
Definition particlecontext.cc:304
virtual ~ParticleContext()
destrucotr
Definition particlecontext.cc:67
static CoreGraphics::VertexLayoutId GetParticleVertexLayout()
get the shared vertex layout
Definition particlecontext.cc:638
static void Stop(const Graphics::GraphicsEntityId id)
stop playing a particle
Definition particlecontext.cc:352
static void WaitForParticleUpdates(const Graphics::FrameContext &ctx)
stop particle updating when frame ends
Definition particlecontext.cc:525
static CoreGraphics::PrimitiveGroup & GetParticlePrimitiveGroup()
get the shared primitive group
Definition particlecontext.cc:647
static void OnPrepareView(const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx)
prepare particles for current view
Definition particlecontext.cc:445
@ ModelId
Definition particlecontext.h:125
@ Runtime
Definition particlecontext.h:126
@ ParticleSystems
Definition particlecontext.h:124
@ ModelContextId
Definition particlecontext.h:127
static CoreGraphics::BufferId GetParticleVertexBuffer()
get the shared vertex buffer
Definition particlecontext.cc:629
static Threading::AtomicCounter ConstantUpdateCounter
Definition particlecontext.h:80
PlayMode
Definition particlecontext.h:31
@ IgnoreIfPlaying
Definition particlecontext.h:33
@ RestartIfPlaying
Definition particlecontext.h:32
Ids::IdAllocator< Util::Array< ParticleSystemRuntime >, Graphics::ContextEntityId, ParticleRuntime, Graphics::GraphicsEntityId > ParticleContextAllocator
Definition particlecontext.h:134
ParticleContext()
constructor
Definition particlecontext.cc:60
static void UpdateParticles(const Graphics::FrameContext &ctx)
start particle updating when frame starts
Definition particlecontext.cc:364
static Threading::Event totalCompletionEvent
Definition particlecontext.h:81
static CoreGraphics::BufferId GetParticleIndexBuffer()
get the shared particle index buffer
Definition particlecontext.cc:620
static void ShowParticle(const Graphics::GraphicsEntityId id)
show particle based on index fetched from GetParticleId
Definition particlecontext.cc:286
static void Dealloc(Graphics::ContextEntityId id)
deallocate a slice
Definition particlecontext.h:165
static void Play(const Graphics::GraphicsEntityId id, const PlayMode mode)
start playing particle
Definition particlecontext.cc:322
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:60
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
A ring buffer stores up to a maximum number of elements in a circular fashion.
Definition ringbuffer.h:21
Particle context controls playing and enabling/disabling of particle emitters inside a model.
Definition modelnode.h:37
volatile int AtomicCounter
Definition interlocked.h:19
double Time
the time datatype
Definition time.h:18
Definition vertexlayout.h:16
Definition graphicscontext.h:133
Definition graphicsserver.h:31
The graphics entity is only an Id, to which we can attach GraphicsContexts.
Definition graphicsentity.h:16
A 4x4 single point precision float matrix.
Definition mat4.h:49
Definition particlecontext.h:99
unsigned int numLivingParticles
Definition particlecontext.h:101
Math::bbox bbox
Definition particlecontext.h:100
Definition particlecontext.h:85
bool stopping
Definition particlecontext.h:92
bool initial
Definition particlecontext.h:90
bool firstFrame
Definition particlecontext.h:95
Timing::Time stepTime
Definition particlecontext.h:86
Timing::Time prevEmissionTime
Definition particlecontext.h:87
bool playing
Definition particlecontext.h:91
IndexT emissionCounter
Definition particlecontext.h:89
Timing::Time emissionStartTimeOffset
Definition particlecontext.h:88
bool restarting
Definition particlecontext.h:94
bool stopped
Definition particlecontext.h:93
Definition particlecontext.h:105
ParticleJobUniformData uniformData
Definition particlecontext.h:112
Math::mat4 transform
Definition particlecontext.h:108
uint32 baseVertex
Definition particlecontext.h:119
uint32 numParticles
Definition particlecontext.h:119
Util::RingBuffer< Particle > particles
Definition particlecontext.h:107
Util::FixedArray< CoreGraphics::MeshId > meshPerFrame
Definition particlecontext.h:116
SizeT outputCapacity
Definition particlecontext.h:113
uint32 renderableIndex
Definition particlecontext.h:106
SizeT emissionCounter
Definition particlecontext.h:110
CoreGraphics::MeshId mesh
Definition particlecontext.h:117
ParticleJobSliceOutputData outputData
Definition particlecontext.h:114
Math::bbox boundingBox
Definition particlecontext.h:109
int SizeT
Definition types.h:49
uint32_t uint32
Definition types.h:38
int IndexT
Definition types.h:48