class
CrShader::Compute::ParticleSimulationEngine
- CrShader::Compute::ParticleSimulationEngine
- Reference
- Object
Overview
Pure Core Engine for CPU/GPU Particle Simulation & Buffer Management
Defined in:
crshader/compute/particle_simulation_core.crConstructors
Class Method Summary
-
.hash11(p : Float32) : Float32
Deterministic hash for procedural seeding (matches std/particles GPU hash)
Instance Method Summary
- #attractors : Array(ForceAttractor)
- #attractors=(attractors : Array(ForceAttractor))
- #bounds : DomainBounds
- #bounds=(bounds : DomainBounds)
-
#buffer_byte_size : Int32
Total byte size of the std430 storage buffer
- #capacity : Int32
- #integrator : IntegratorMode
- #integrator=(integrator : IntegratorMode)
- #local_size_x : Int32
-
#pack_buffer! : Bytes
Packs all ParticleState structs into the contiguous std430 byte buffer
- #particles : Slice(ParticleState)
- #push_constants : SimulationPushConstants
- #push_constants=(push_constants : SimulationPushConstants)
- #raw_buffer : Bytes
-
#seed_radial(origin_x : Float32 = 0.0_f32, origin_y : Float32 = 5.0_f32, origin_z : Float32 = 0.0_f32, spread : Float32 = 2.0_f32, base_speed : Float32 = 3.0_f32, lifetime : Float32 = 4.0_f32) : Void
Seeds particles within a radial or box emitter volume
-
#step_cpu(dt : Float32) : Void
Reference CPU step matching the GPU compute shader physics kernel
-
#unpack_buffer!(bytes : Bytes = @raw_buffer) : Slice(ParticleState)
Unpacks the contiguous std430 byte buffer back into ParticleState structs
-
#workgroup_count_x : Int32
Number of 1D compute workgroups needed to cover capacity
Constructor Detail
Class Method Detail
Deterministic hash for procedural seeding (matches std/particles GPU hash)
Instance Method Detail
Seeds particles within a radial or box emitter volume
Reference CPU step matching the GPU compute shader physics kernel
Unpacks the contiguous std430 byte buffer back into ParticleState structs