pub struct Collider2D { /* private fields */ }Expand description
Collision volume and bitmask filtering component.
Implementations§
Source§impl Collider2D
World-space bounding box queries for Collider2D.
impl Collider2D
World-space bounding box queries for Collider2D.
Sourcepub fn aabb(
width: f32,
height: f32,
layer: u32,
mask: u32,
is_trigger: bool,
) -> Self
pub fn aabb( width: f32, height: f32, layer: u32, mask: u32, is_trigger: bool, ) -> Self
Creates an axis-aligned box collider on layer layer colliding with mask.
§Arguments
f32- Full box width in world units.f32- Full box height in world units.u32- Collision layer bitmask.u32- Interaction mask.bool- Whether this collider acts as a trigger volume.
§Returns
Self- Configured AABB collider.
Source§impl Collider2D
impl Collider2D
pub fn get_shape(&self) -> ColliderShape
pub fn get_mut_shape(&mut self) -> &mut ColliderShape
pub fn set_shape(&mut self, val: ColliderShape) -> &mut Self
pub fn get_layer(&self) -> u32
pub fn get_mut_layer(&mut self) -> &mut u32
pub fn set_layer(&mut self, val: u32) -> &mut Self
pub fn get_mask(&self) -> u32
pub fn get_mut_mask(&mut self) -> &mut u32
pub fn set_mask(&mut self, val: u32) -> &mut Self
pub fn get_is_trigger(&self) -> bool
pub fn get_mut_is_trigger(&mut self) -> &mut bool
pub fn set_is_trigger(&mut self, val: bool) -> &mut Self
Source§impl Collider2D
impl Collider2D
Trait Implementations§
Source§impl Clone for Collider2D
impl Clone for Collider2D
impl Copy for Collider2D
Source§impl Debug for Collider2D
impl Debug for Collider2D
Source§impl PartialEq for Collider2D
impl PartialEq for Collider2D
impl StructuralPartialEq for Collider2D
Auto Trait Implementations§
impl Forget for Collider2D
impl Freeze for Collider2D
impl Move for Collider2D
impl RefUnwindSafe for Collider2D
impl Send for Collider2D
impl Sync for Collider2D
impl Unpin for Collider2D
impl UnsafeUnpin for Collider2D
impl UnwindSafe for Collider2D
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