pub struct Collider {
pub shape: ColliderShape,
pub is_trigger: bool,
pub material: PhysicsMaterial,
pub collision_layer: CollisionLayer,
}Fields§
§shape: ColliderShape§is_trigger: bool§material: PhysicsMaterial§collision_layer: CollisionLayerImplementations§
Source§impl Collider
impl Collider
Sourcepub fn compute_aabb(&self, position: Vec3, rotation: Quat) -> Aabb
pub fn compute_aabb(&self, position: Vec3, rotation: Quat) -> Aabb
Calculate AABB for this collider at given transform
pub fn plane(normal: Vec3, distance: f32) -> Self
pub fn sphere(radius: f32) -> Self
pub fn box_collider(half_extents: Vec3) -> Self
pub fn capsule(radius: f32, half_height: f32) -> Self
pub fn convex_hull(points: &[Vec3]) -> Self
pub fn with_trigger(self, is_trigger: bool) -> Self
pub fn with_material(self, material: PhysicsMaterial) -> Self
pub fn aabb(half_extents: Vec3) -> Self
pub fn new_sphere(radius: f32) -> Self
pub fn new_aabb(x: f32, y: f32, z: f32) -> Self
pub fn new_capsule(radius: f32, half_height: f32) -> Self
pub fn with_layer(self, layer: CollisionLayer) -> Self
pub fn volume(&self) -> f32
pub fn extents_y(&self) -> f32
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Collider
impl<'de> Deserialize<'de> for Collider
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Component for Collider
impl StructuralPartialEq for Collider
Auto Trait Implementations§
impl Freeze for Collider
impl RefUnwindSafe for Collider
impl Send for Collider
impl Sync for Collider
impl Unpin for Collider
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more