HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.0
|
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. | |
This is used to filter collision on shapes. It affects shape-vs-shape collision and shape-versus-query collision (such as World.CastRay).
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 };
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;