Struct three_d::renderer::object::Particles [−][src]
Expand description
Particle effect that can be rendered with any material.
Each particle is initialised with a position and velocity using the update function and a global acceleration.
Then when time passes, their position is updated based on
new_position = start_position + start_velocity * time + 0.5 * acceleration * time * time
Fields
acceleration: Vec3
The acceleration applied to all particles. Default is gravity.
time: f32
A time variable that should be updated each frame.
Implementations
Creates a new set of particles with geometry defined by the given cpu mesh.
Updates the particles with the given initial data. The list contain one entry for each particle.
Trait Implementations
Returns the AxisAlignedBoundingBox for this geometry. Read more
Returns the local to world transformation applied to this geometry. Read more
Set the local to world transformation applied to this geometry. Read more
fn render_with_material(
&self,
material: &dyn Material,
camera: &Camera,
lights: &Lights
) -> ThreeDResult<()>
fn render_with_material(
&self,
material: &dyn Material,
camera: &Camera,
lights: &Lights
) -> ThreeDResult<()>
Render the object with the given material. Must be called in a render target render function, for example in the callback function of Screen::write. You can use Lights::default() if you know the material does not require lights. Read more
fn render_forward(
&self,
material: &dyn Material,
camera: &Camera,
lights: &Lights
) -> ThreeDResult<()>
fn render_forward(
&self,
material: &dyn Material,
camera: &Camera,
lights: &Lights
) -> ThreeDResult<()>
use render_with_material instead
Render the object with the given material. Must be called in a render target render function, for example in the callback function of Screen::write. You can use Lights::default() if you know the material does not require lights. Read more
fn render_deferred(
&self,
_material: &DeferredPhysicalMaterial,
_camera: &Camera,
_viewport: Viewport
) -> ThreeDResult<()>
fn render_deferred(
&self,
_material: &DeferredPhysicalMaterial,
_camera: &Camera,
_viewport: Viewport
) -> ThreeDResult<()>
Render the geometry and surface material parameters of the object. Should usually not be called directly but used in DeferredPipeline::geometry_pass. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Particles
impl !UnwindSafe for Particles
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more