#[repr(C)]pub struct b2ParticleDef {
pub flags: uint32,
pub position: b2Vec2,
pub velocity: b2Vec2,
pub color: b2ParticleColor,
pub lifetime: f32,
pub userData: *mut c_void,
pub group: *mut b2ParticleGroup,
}Expand description
A particle definition holds all the data needed to construct a particle. You can safely re-use these definitions.
Fields§
§flags: uint32\brief Specifies the type of particle (see #b2ParticleFlag).
A particle may be more than one type. Multiple types are chained by logical sums, for example: pd.flags = b2_elasticParticle | b2_viscousParticle
position: b2Vec2The world position of the particle.
velocity: b2Vec2The linear velocity of the particle in world co-ordinates.
color: b2ParticleColorThe color of the particle.
lifetime: f32Lifetime of the particle in seconds. A value <= 0.0f indicates a particle with infinite lifetime.
userData: *mut c_voidUse this to store application-specific body data.
group: *mut b2ParticleGroupAn existing particle group to which the particle will be added.
Implementations§
Trait Implementations§
Source§impl CopyNew for b2ParticleDef
impl CopyNew for b2ParticleDef
Source§unsafe fn copy_new(
other: &b2ParticleDef,
this: Pin<&mut MaybeUninit<b2ParticleDef>>,
)
unsafe fn copy_new( other: &b2ParticleDef, this: Pin<&mut MaybeUninit<b2ParticleDef>>, )
Synthesized copy constructor.
Source§impl Drop for b2ParticleDef
impl Drop for b2ParticleDef
Source§fn drop(self: &mut b2ParticleDef)
fn drop(self: &mut b2ParticleDef)
Synthesized destructor.
Source§impl ExternType for b2ParticleDef
impl ExternType for b2ParticleDef
Source§impl MakeCppStorage for b2ParticleDef
impl MakeCppStorage for b2ParticleDef
Source§unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2ParticleDef
unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2ParticleDef
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 b2ParticleDef)
unsafe fn free_uninitialized_cpp_storage(arg0: *mut b2ParticleDef)
Frees a C++ allocation which has not yet
had a constructor called. Read more
impl UniquePtrTarget for b2ParticleDef
impl WeakPtrTarget for b2ParticleDef
Auto Trait Implementations§
impl Freeze for b2ParticleDef
impl RefUnwindSafe for b2ParticleDef
impl !Send for b2ParticleDef
impl !Sync for b2ParticleDef
impl Unpin for b2ParticleDef
impl UnwindSafe for b2ParticleDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more