HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Box2D.Filter Struct Reference

This is used to filter collision on shapes. It affects shape-vs-shape collision and shape-versus-query collision (such as World.CastRay). More...

Public Member Functions

 Filter ()
 Creates a filter with the default values.
 

Public Attributes

ulong CategoryBits
 The collision category bits. Normally you would just set one bit. The category bits should represent your application object types. For example:
 
ulong MaskBits
 The 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.
 
int GroupIndex
 Collision 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.
 

Detailed Description

This is used to filter collision on shapes. It affects shape-vs-shape collision and shape-versus-query collision (such as World.CastRay).

Member Data Documentation

◆ CategoryBits

ulong Box2D.Filter.CategoryBits

The collision category bits. Normally you would just set one bit. The category bits should represent your application object types. For example:

enum MyCategories { Static = 0x00000001, Dynamic = 0x00000002, Debris = 0x00000004, Player = 0x00000008, // etc };

◆ MaskBits

ulong Box2D.Filter.MaskBits

The 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.

maskBits = Static | Player;


The documentation for this struct was generated from the following file: