Used to create a shape. This is a temporary object used to bundle shape creation parameters. You may use the same shape definition to create multiple shapes.
More...
|
| ShapeDef (SurfaceMaterial material, float density, Filter filter, bool isSensor=false, bool enableSensorEvents=false, bool enableContactEvents=false, bool enableHitEvents=false, bool enablePreSolveEvents=false, bool invokeContactCreation=false, bool updateBodyMass=true, object? userData=null) |
| Construct a shape definition with the supplied values.
|
|
| ShapeDef () |
| Construct a shape definition with the default values.
|
|
|
object? | UserData [get, set] |
| Use this to store application specific shape data.
|
|
ref SurfaceMaterial | Material [get] |
| The surface material for this shape.
|
|
ref float | Density [get] |
| The density, usually in kg/m².
|
|
ref Filter | Filter [get] |
| Collision filtering data.
|
|
bool | IsSensor [get, set] |
| A sensor shape generates overlap events but never generates a collision response. Sensors do not have continuous collision. Instead, use a ray or shape cast for those scenarios. Note: Sensor events are disabled by default.
|
|
bool | EnableSensorEvents [get, set] |
| Enable sensor events for this shape. This applies to sensors and non-sensors. False by default, even for sensors.
|
|
bool | EnableContactEvents [get, set] |
| Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default.
|
|
bool | EnableHitEvents [get, set] |
| Enable hit events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default.
|
|
bool | EnablePreSolveEvents [get, set] |
| Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive and must be carefully handled due to threading. Ignored for sensors.
|
|
bool | InvokeContactCreation [get, set] |
| Normally shapes on static bodies don't invoke contact creation when they are added to the world. This overrides that behavior and causes contact creation. This significantly slows down static body creation which can be important when there are many static shapes. This is implicitly always true for sensors, dynamic bodies, and kinematic bodies.
|
|
bool | UpdateBodyMass [get, set] |
| Should the body update the mass properties when this shape is created. Default is true.
|
|
Used to create a shape. This is a temporary object used to bundle shape creation parameters. You may use the same shape definition to create multiple shapes.
◆ ShapeDef()
Box2D.ShapeDef.ShapeDef |
( |
SurfaceMaterial |
material, |
|
|
float |
density, |
|
|
Filter |
filter, |
|
|
bool |
isSensor = false , |
|
|
bool |
enableSensorEvents = false , |
|
|
bool |
enableContactEvents = false , |
|
|
bool |
enableHitEvents = false , |
|
|
bool |
enablePreSolveEvents = false , |
|
|
bool |
invokeContactCreation = false , |
|
|
bool |
updateBodyMass = true , |
|
|
object? |
userData = null |
|
) |
| |
|
inline |
Construct a shape definition with the supplied values.
- Parameters
-
material | The surface material for this shape. |
density | The density, usually in kg/m². |
filter | Collision filtering data. |
isSensor | A sensor shape generates overlap events but never generates a collision response. Sensors do not have continuous collision. Instead, use a ray or shape cast for those scenarios. Note: Sensor events are disabled by default. |
enableSensorEvents | Enable sensor events for this shape. This applies to sensors and non-sensors. False by default, even for sensors. |
enableContactEvents | Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default. |
enableHitEvents | Enable hit events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default. |
enablePreSolveEvents | Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive and must be carefully handled due to threading. Ignored for sensors. |
invokeContactCreation | Normally shapes on static bodies don't invoke contact creation when they are added to the world. This overrides that behavior and causes contact creation. This significantly slows down static body creation which can be important when there are many static shapes. This is implicitly always true for sensors, dynamic bodies, and kinematic bodies. |
updateBodyMass | Should the body update the mass properties when this shape is created. Default is true. |
userData | User data |
The documentation for this class was generated from the following file:
- src/Box2DBindings/Defs/ShapeDef.cs