#[repr(C)]pub struct b2Filter {
pub categoryBits: u64,
pub maskBits: u64,
pub groupIndex: c_int,
}Expand description
This is used to filter collision on shapes. It affects shape-vs-shape collision and shape-versus-query collision (such as b2World_CastRay). @ingroup shape
Fields§
§categoryBits: u64The collision category bits. Normally you would just set one bit. The category bits should represent your application object types. For example: @code{.cpp} enum MyCategories { Static = 0x00000001, Dynamic = 0x00000002, Debris = 0x00000004, Player = 0x00000008, // etc }; @endcode
maskBits: u64The collision mask bits. This states the categories that this shape would accept for collision. For example, you may want your player to only collide with static objects and other players. @code{.c} maskBits = Static | Player; @endcode
groupIndex: c_intCollision groups allow a certain group of objects to never collide (negative) or always collide (positive). A group index of zero has no effect. Non-zero group filtering always wins against the mask bits. For example, you may want ragdolls to collide with other ragdolls but you don’t want ragdoll self-collision. In this case you would give each ragdoll a unique negative group index and apply that group index to all shapes on the ragdoll.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for b2Filter
impl RefUnwindSafe for b2Filter
impl Send for b2Filter
impl Sync for b2Filter
impl Unpin for b2Filter
impl UnwindSafe for b2Filter
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)