class
CrShader::Compute::ParticleSimulationBuilder
- CrShader::Compute::ParticleSimulationBuilder
- Reference
- Object
Overview
========================================================================= Declarative DSL Layer: Ergonomic Compute Particle Simulation Builder
Provides block-receiver builders (yield ctx) to configure compute
particle simulations and synthesize either .crshader DSL or GLSL 450
compute shaders automatically.
Defined in:
crshader/compute/particle_simulation_dsl.crConstructors
Instance Method Summary
- #add_attractor(type : AttractorType = AttractorType::Point, x : Float32 = 0.0_f32, y : Float32 = 5.0_f32, z : Float32 = 0.0_f32, strength : Float32 = 15.0_f32, radius : Float32 = 20.0_f32, falloff : Float32 = 2.0_f32) : self
- #attractors : Array(ForceAttractor)
- #attractors=(attractors : Array(ForceAttractor))
- #bounds : DomainBounds
- #bounds=(bounds : DomainBounds)
- #buffer_binding : Int32
- #buffer_binding=(buffer_binding : Int32)
- #buffer_set : Int32
- #buffer_set=(buffer_set : Int32)
-
#build_engine : ParticleSimulationEngine
Builds the pure core engine configured by this declarative builder
- #capacity : Int32
- #capacity=(capacity : Int32)
- #curl_turbulence(strength : Float32, scale : Float32 = 0.25_f32) : self
- #domain_bounds(mode : BoundaryMode = BoundaryMode::Bounce, min_x : Float32 = -10.0_f32, min_y : Float32 = 0.0_f32, min_z : Float32 = -10.0_f32, max_x : Float32 = 10.0_f32, max_y : Float32 = 20.0_f32, max_z : Float32 = 10.0_f32, restitution : Float32 = 0.7_f32) : self
- #drag : Float32
- #drag=(drag : Float32)
- #gravity(x : Float32, y : Float32, z : Float32) : self
- #gravity_x : Float32
- #gravity_x=(gravity_x : Float32)
- #gravity_y : Float32
- #gravity_y=(gravity_y : Float32)
- #gravity_z : Float32
- #gravity_z=(gravity_z : Float32)
- #integration(mode : IntegratorMode) : self
- #integrator : IntegratorMode
- #integrator=(integrator : IntegratorMode)
- #linear_drag(coeff : Float32) : self
- #local_size_x : Int32
- #local_size_x=(local_size_x : Int32)
- #max_particles(count : Int32) : self
- #name : String
- #noise_scale : Float32
- #noise_scale=(noise_scale : Float32)
-
#to_crshader_source : String
Synthesizes a valid CRShader source string (
.crshader) for this particle simulation - #turbulence : Float32
- #turbulence=(turbulence : Float32)
- #workgroup_size(x : Int32) : self
Constructor Detail
Instance Method Detail
def add_attractor(type : AttractorType = AttractorType::Point, x : Float32 = 0.0_f32, y : Float32 = 5.0_f32, z : Float32 = 0.0_f32, strength : Float32 = 15.0_f32, radius : Float32 = 20.0_f32, falloff : Float32 = 2.0_f32) : self
#
def build_engine : ParticleSimulationEngine
#
Builds the pure core engine configured by this declarative builder
def domain_bounds(mode : BoundaryMode = BoundaryMode::Bounce, min_x : Float32 = -10.0_f32, min_y : Float32 = 0.0_f32, min_z : Float32 = -10.0_f32, max_x : Float32 = 10.0_f32, max_y : Float32 = 20.0_f32, max_z : Float32 = 10.0_f32, restitution : Float32 = 0.7_f32) : self
#
def to_crshader_source : String
#
Synthesizes a valid CRShader source string (.crshader) for this particle simulation