pub struct RigidBody3D { /* private fields */ }Expand description
Dynamic or static 3D rigid body with axis-aligned box collider and physical restitution/friction.
Implementations§
Source§impl RigidBody3D
Constructors and bounding-box helpers for RigidBody3D.
impl RigidBody3D
Constructors and bounding-box helpers for RigidBody3D.
Sourcepub fn dynamic_box(position: Vec3, half_extents: Vec3, mass: f32) -> Self
pub fn dynamic_box(position: Vec3, half_extents: Vec3, mass: f32) -> Self
Sourcepub fn static_box(position: Vec3, half_extents: Vec3) -> Self
pub fn static_box(position: Vec3, half_extents: Vec3) -> Self
Sourcepub fn world_aabb(&self) -> Aabb3D
pub fn world_aabb(&self) -> Aabb3D
Sourcepub fn apply_impulse(&mut self, impulse: Vec3)
pub fn apply_impulse(&mut self, impulse: Vec3)
Applies an instantaneous linear impulse to a dynamic rigid body.
§Arguments
&Self- Mutable body reference.Vec3- Linear impulse vector inN*s.
Source§impl RigidBody3D
impl RigidBody3D
pub fn get_position(&self) -> Vec3
pub fn get_mut_position(&mut self) -> &mut Vec3
pub fn set_position(&mut self, val: Vec3) -> &mut Self
pub fn get_velocity(&self) -> Vec3
pub fn get_mut_velocity(&mut self) -> &mut Vec3
pub fn set_velocity(&mut self, val: Vec3) -> &mut Self
pub fn get_half_extents(&self) -> Vec3
pub fn get_mut_half_extents(&mut self) -> &mut Vec3
pub fn set_half_extents(&mut self, val: Vec3) -> &mut Self
pub fn get_inv_mass(&self) -> f32
pub fn get_mut_inv_mass(&mut self) -> &mut f32
pub fn set_inv_mass(&mut self, val: f32) -> &mut Self
pub fn get_restitution(&self) -> f32
pub fn get_mut_restitution(&mut self) -> &mut f32
pub fn set_restitution(&mut self, val: f32) -> &mut Self
pub fn get_linear_damping(&self) -> f32
pub fn get_mut_linear_damping(&mut self) -> &mut f32
pub fn set_linear_damping(&mut self, val: f32) -> &mut Self
pub fn get_grounded(&self) -> bool
pub fn get_mut_grounded(&mut self) -> &mut bool
pub fn set_grounded(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl Clone for RigidBody3D
impl Clone for RigidBody3D
impl Copy for RigidBody3D
Source§impl Debug for RigidBody3D
impl Debug for RigidBody3D
Source§impl PartialEq for RigidBody3D
impl PartialEq for RigidBody3D
impl StructuralPartialEq for RigidBody3D
Auto Trait Implementations§
impl Forget for RigidBody3D
impl Freeze for RigidBody3D
impl Move for RigidBody3D
impl RefUnwindSafe for RigidBody3D
impl Send for RigidBody3D
impl Sync for RigidBody3D
impl Unpin for RigidBody3D
impl UnsafeUnpin for RigidBody3D
impl UnwindSafe for RigidBody3D
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