pub struct Collider { /* private fields */ }Implementations§
Source§impl Collider
impl Collider
pub fn local_translation(&self) -> Vec3
pub fn local_rotation(&self) -> Quat
pub fn density(&self) -> f32
pub fn set_density(&mut self, density: f32)
pub fn set_sensor(&mut self, sensor: bool)
pub fn set_collision_layers(&mut self, membership: u32, filter: u32)
pub fn parent(&self) -> Option<RigidBodyHandle>
pub fn is_sensor(&self) -> bool
pub fn material(&self) -> PhysicsMaterial
pub fn set_material( &mut self, material: PhysicsMaterial, ) -> Result<(), PhysicsError>
pub fn set_restitution(&mut self, v: f32)
pub fn set_friction(&mut self, v: f32)
Source§impl Collider
impl Collider
Sourcepub fn try_mass_properties(
&self,
planar: bool,
) -> Result<MassProperties, MassPropertyError>
pub fn try_mass_properties( &self, planar: bool, ) -> Result<MassProperties, MassPropertyError>
Check this collider’s mass and inertia without inserting it into a world.
planar must match the intended world’s dimension. A zero-density
collider is valid as part of a compound but cannot supply mass by itself.
use ferravex_physics::{Collider, d2::ColliderBuilder};
let collider: Collider = ColliderBuilder::ball(1.).density(0.).into();
let error = collider.try_mass_properties(true).unwrap_err();
assert_eq!(error.child, None);
assert!(error.to_string().contains("positive-density"));Trait Implementations§
Source§impl From<ColliderBuilder> for Collider
impl From<ColliderBuilder> for Collider
Source§fn from(b: ColliderBuilder) -> Collider
fn from(b: ColliderBuilder) -> Collider
Converts to this type from the input type.
Source§impl From<ColliderBuilder> for Collider
impl From<ColliderBuilder> for Collider
Source§fn from(b: ColliderBuilder) -> Collider
fn from(b: ColliderBuilder) -> Collider
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Collider
impl RefUnwindSafe for Collider
impl Send for Collider
impl Sync for Collider
impl Unpin for Collider
impl UnwindSafe for Collider
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