#[repr(C)]
pub struct b2ParticleSystemDef {
Show 21 fields pub strictContactCheck: bool, pub density: f32, pub gravityScale: f32, pub radius: f32, pub maxCount: int32, pub pressureStrength: f32, pub dampingStrength: f32, pub elasticStrength: f32, pub springStrength: f32, pub viscousStrength: f32, pub surfaceTensionPressureStrength: f32, pub surfaceTensionNormalStrength: f32, pub repulsiveStrength: f32, pub powderStrength: f32, pub ejectionStrength: f32, pub staticPressureStrength: f32, pub staticPressureRelaxation: f32, pub staticPressureIterations: int32, pub colorMixingStrength: f32, pub destroyByAge: bool, pub lifetimeGranularity: f32,
}

Fields§

§strictContactCheck: bool

Enable strict Particle/Body contact check. See SetStrictContactCheck for details.

§density: f32

Set the particle density. See SetDensity for details.

§gravityScale: f32

Change the particle gravity scale. Adjusts the effect of the global gravity vector on particles. Default value is 1.0f.

§radius: f32

Particles behave as circles with this radius. In Box2D units.

§maxCount: int32

Set the maximum number of particles. By default, there is no maximum. The particle buffers can continue to grow while b2World’s block allocator still has memory. See SetMaxParticleCount for details.

§pressureStrength: f32

Increases pressure in response to compression Smaller values allow more compression

§dampingStrength: f32

Reduces velocity along the collision normal Smaller value reduces less

§elasticStrength: f32

Restores shape of elastic particle groups Larger values increase elastic particle velocity

§springStrength: f32

Restores length of spring particle groups Larger values increase spring particle velocity

§viscousStrength: f32

Reduces relative velocity of viscous particles Larger values slow down viscous particles more

§surfaceTensionPressureStrength: f32

Produces pressure on tensile particles 0~0.2. Larger values increase the amount of surface tension.

§surfaceTensionNormalStrength: f32

Smoothes outline of tensile particles 0~0.2. Larger values result in rounder, smoother, water-drop-like clusters of particles.

§repulsiveStrength: f32

Produces additional pressure on repulsive particles Larger values repulse more Negative values mean attraction. The range where particles behave stably is about -0.2 to 2.0.

§powderStrength: f32

Produces repulsion between powder particles Larger values repulse more

§ejectionStrength: f32

Pushes particles out of solid particle group Larger values repulse more

§staticPressureStrength: f32

Produces static pressure Larger values increase the pressure on neighboring partilces For a description of static pressure, see http://en.wikipedia.org/wiki/Static_pressure#Static_pressure_in_fluid_dynamics

§staticPressureRelaxation: f32

Reduces instability in static pressure calculation Larger values make stabilize static pressure with fewer iterations

§staticPressureIterations: int32

Computes static pressure more precisely See SetStaticPressureIterations for details

§colorMixingStrength: f32

Determines how fast colors are mixed 1.0f ==> mixed immediately 0.5f ==> mixed half way each simulation step (see b2World::Step())

§destroyByAge: bool

Whether to destroy particles by age when no more particles can be created. See #b2ParticleSystem::SetDestructionByAge() for more information.

§lifetimeGranularity: f32

Granularity of particle lifetimes in seconds. By default this is set to (1.0f / 60.0f) seconds. b2ParticleSystem uses a 32-bit signed value to track particle lifetimes so the maximum lifetime of a particle is (2^32 - 1) / (1.0f / lifetimeGranularity) seconds. With the value set to 1/60 the maximum lifetime or age of a particle is 2.27 years.

Implementations§

source§

impl b2ParticleSystemDef

source

pub fn new() -> impl New<Output = Self>

Trait Implementations§

source§

impl CopyNew for b2ParticleSystemDef

source§

unsafe fn copy_new( other: &b2ParticleSystemDef, this: Pin<&mut MaybeUninit<b2ParticleSystemDef>> )

Synthesized copy constructor.

source§

impl Drop for b2ParticleSystemDef

source§

fn drop(self: &mut b2ParticleSystemDef)

Synthesized destructor.

source§

impl ExternType for b2ParticleSystemDef

§

type Id = (b, _2, P, a, r, t, i, c, l, e, S, y, s, t, e, m, D, e, f)

A type-level representation of the type’s C++ namespace and type name. Read more
§

type Kind = Trivial

source§

impl MakeCppStorage for b2ParticleSystemDef

source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2ParticleSystemDef

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut b2ParticleSystemDef)

Frees a C++ allocation which has not yet had a constructor called. Read more
source§

impl MoveNew for b2ParticleSystemDef

source§

unsafe fn move_new( other: Pin<MoveRef<'_, b2ParticleSystemDef>>, this: Pin<&mut MaybeUninit<b2ParticleSystemDef>> )

Synthesized move constructor.

source§

impl SharedPtrTarget for b2ParticleSystemDef

source§

impl UniquePtrTarget for b2ParticleSystemDef

source§

impl VectorElement for b2ParticleSystemDef

source§

impl WeakPtrTarget for b2ParticleSystemDef

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithinBoxTrivial for Twhere T: ExternType<Kind = Trivial> + Unpin,

source§

fn within_box(self) -> Pin<Box<T>>

source§

impl<T> WithinUniquePtrTrivial for Twhere T: UniquePtrTarget + ExternType<Kind = Trivial> + Unpin,