pub struct Particles {
    pub acceleration: Vec3,
    pub time: f32,
    /* private fields */
}
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.

Returns the local to world transformation applied to all particles.

Set the local to world transformation applied to all particles.

Updates the particles with the given initial data. The list contain one entry for each particle.

Trait Implementations

Returns the AxisAlignedBoundingBox for this geometry in the global coordinate system. Read more

Render the geometry 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 an empty array for the lights argument, if you know the object does not require lights to be rendered. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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