HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.0
|
A Box2D World, the container for all bodies, shapes, and constraints. More...
Public Member Functions | |
bool | Equals (World other) |
Checks if this World and another World refer to the same World. | |
override bool | Equals (object? obj) |
Checks if this World and another World refer to the same World. | |
override int | GetHashCode () |
Returns the hash code for this World. | |
World (WorldDef def) | |
Create a world for rigid body simulation. A world contains bodies, shapes, and constraints. You make create up to 128 worlds. Each world is completely independent and may be simulated in parallel. | |
void | Destroy () |
Destroy this world. | |
unsafe void | Step (float timeStep=0.016666668f, int subStepCount=4, bool parallelEvents=false) |
Simulate a world for one time step. This performs collision detection, integration, and constraint solution. | |
void | Draw (DebugDraw draw) |
Call this to draw shapes and other debug draw data. | |
unsafe void | SetCustomFilterCallback< TContext > (CustomFilterCallback< TContext > callback, TContext context) |
Register the custom filter callback. This is optional. | |
unsafe void | SetCustomFilterCallback< TContext > (CustomFilterRefCallback< TContext > callback, ref TContext context) |
Register the custom filter callback. This is optional. | |
void | SetCustomFilterCallback (CustomFilterNintCallback callback, nint context) |
Register the custom filter callback. This is optional. | |
void | SetCustomFilterCallback (CustomFilterCallback nintCallback) |
Register the custom filter callback. This is optional. | |
unsafe void | SetPreSolveCallback< TContext > (PreSolveCallback< TContext > callback, TContext context) |
Register the pre-solve callback. This is optional. | |
unsafe void | SetPreSolveCallback< TContext > (PreSolveRefCallback< TContext > callback, ref TContext context) |
Register the pre-solve callback. This is optional. | |
void | SetPreSolveCallback (PreSolveCallback callback) |
Register the pre-solve callback. This is optional. | |
void | SetPreSolveCallback (PreSolveNintCallback callback, nint context) |
Register the pre-solve callback. This is optional. | |
void | Explode (in ExplosionDef explosionDef) |
Apply a radial explosion. | |
void | SetContactTuning (float hertz, float dampingRatio, float pushSpeed) |
Adjust contact tuning parameters. | |
void | SetJointTuning (float hertz, float dampingRatio) |
Adjust joint tuning parameters. | |
void | SetFrictionCallback (FrictionCallback callback) |
Sets the friction callback. | |
void | SetRestitutionCallback (RestitutionCallback callback) |
Sets the restitution callback. | |
void | DumpMemoryStats () |
Dumps memory stats to box2d_memory.txt. | |
Body | CreateBody (BodyDef def) |
Creates a rigid body given a definition. | |
DistanceJoint | CreateJoint (DistanceJointDef def) |
Creates a distance joint. | |
MotorJoint | CreateJoint (MotorJointDef def) |
Creates a motor joint. | |
MouseJoint | CreateJoint (MouseJointDef def) |
Creates a mouse joint. | |
Joint | CreateJoint (FilterJointDef def) |
Creates a filter joint. See FilterJointDef for details. | |
PrismaticJoint | CreateJoint (PrismaticJointDef def) |
Creates a prismatic (slider) joint. | |
RevoluteJoint | CreateJoint (RevoluteJointDef def) |
Creates a revolute joint. | |
WeldJoint | CreateJoint (WeldJointDef def) |
Creates a weld joint. | |
WheelJoint | CreateJoint (WheelJointDef def) |
Creates a wheel joint. | |
override string | ToString () |
Returns a string representation of this world. | |
RayResult | CastRayClosest (Vec2 origin, Vec2 translation, QueryFilter filter) |
Cast a ray into the world to collect the closest hit. This is a convenience function. | |
unsafe TreeStats | CastRay< TContext > (Vec2 origin, Vec2 translation, QueryFilter filter, CastResultCallback< TContext > callback, TContext context) |
Cast a ray into the world to collect shapes in the path of the ray. | |
unsafe TreeStats | CastRay< TContext > (Vec2 origin, Vec2 translation, QueryFilter filter, CastResultRefCallback< TContext > callback, ref TContext context) |
Cast a ray into the world to collect shapes in the path of the ray. | |
TreeStats | CastRay (Vec2 origin, Vec2 translation, QueryFilter filter, CastResultCallback callback) |
Cast a ray into the world to collect shapes in the path of the ray. | |
TreeStats | CastRay (Vec2 origin, Vec2 translation, QueryFilter filter, CastResultNintCallback callback, nint context) |
Cast a ray into the world to collect shapes in the path of the ray. | |
unsafe TreeStats | CastShape< TContext > (in ShapeProxy proxy, Vec2 translation, QueryFilter filter, CastResultCallback< TContext > callback, TContext context) |
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point. | |
unsafe TreeStats | CastShape< TContext > (in ShapeProxy proxy, Vec2 translation, QueryFilter filter, CastResultRefCallback< TContext > callback, ref TContext context) |
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point. | |
TreeStats | CastShape (in ShapeProxy proxy, Vec2 translation, QueryFilter filter, CastResultCallback callback) |
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point. | |
TreeStats | CastShape (in ShapeProxy proxy, Vec2 translation, QueryFilter filter, CastResultNintCallback callback, nint context) |
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point. | |
float | CastMover (in Capsule mover, Vec2 translation, QueryFilter filter) |
Cast a capsule mover through the world. This is a special shape cast that handles sliding along other shapes while reducing clipping. | |
unsafe void | CollideMover< TContext > (in Capsule mover, QueryFilter filter, PlaneResultCallback< TContext > callback, TContext context) |
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for kinematic character movement. | |
unsafe void | CollideMover< TContext > (in Capsule mover, QueryFilter filter, PlaneResultRefCallback< TContext > callback, ref TContext context) |
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for kinematic character movement. | |
void | CollideMover (in Capsule mover, QueryFilter filter, PlaneResultCallback callback) |
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for kinematic character movement. | |
void | CollideMover (in Capsule mover, QueryFilter filter, PlaneResultNintCallback callback, nint context) |
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for kinematic character movement. | |
unsafe TreeStats | OverlapAABB< TContext > (AABB aabb, QueryFilter filter, OverlapResultCallback< TContext > callback, TContext context) |
Overlap test for all shapes that potentially overlap the provided AABB. | |
unsafe TreeStats | OverlapAABB< TContext > (AABB aabb, QueryFilter filter, OverlapResultRefCallback< TContext > callback, ref TContext context) |
Overlap test for all shapes that potentially overlap the provided AABB. | |
TreeStats | OverlapAABB (AABB aabb, QueryFilter filter, ref OverlapResultCallback callback) |
Overlap test for all shapes that potentially overlap the provided AABB. | |
TreeStats | OverlapAABB (AABB aabb, QueryFilter filter, OverlapResultNintCallback callback, nint context) |
Overlap test for all shapes that potentially overlap the provided AABB. | |
unsafe TreeStats | OverlapShape< TContext > (in ShapeProxy proxy, QueryFilter filter, OverlapResultCallback< TContext > callback, TContext context) |
Overlap test for all shapes that overlap the provided shape proxy. | |
unsafe TreeStats | OverlapShape< TContext > (in ShapeProxy proxy, QueryFilter filter, OverlapResultRefCallback< TContext > callback, ref TContext context) |
Overlap test for all shapes that overlap the provided shape proxy. | |
TreeStats | OverlapShape< TContext > (in ShapeProxy proxy, QueryFilter filter, OverlapResultNintCallback callback, nint context) |
Overlap test for all shapes that overlap the provided shape proxy. | |
TreeStats | OverlapShape (in ShapeProxy proxy, QueryFilter filter, OverlapResultCallback callback) |
Overlap test for all shapes that overlap the provided shape proxy. | |
delegate void | BodyMoveEventHandler (in BodyMoveEvent @event) |
Event handler for body move events. | |
delegate void | SensorBeginTouchEventHandler (in SensorBeginTouchEvent @event) |
Event handler for sensor begin touch events. | |
delegate void | SensorEndTouchEventHandler (in SensorEndTouchEvent @event) |
Event handler for sensor end touch events. | |
delegate void | ContactBeginTouchEventHandler (in ContactBeginTouchEvent @event) |
Event handler for contact begin touch events. | |
delegate void | ContactEndTouchEventHandler (in ContactEndTouchEvent @event) |
Event handler for contact end touch events. | |
delegate void | ContactHitEventHandler (in ContactHitEvent @event) |
Event handler for contact hit events. | |
Static Public Member Functions | |
static World | CreateWorld (WorldDef def) |
Create a world for rigid body simulation. A world contains bodies, shapes, and constraints. You make create up to 128 worlds. Each world is completely independent and may be simulated in parallel. | |
Public Attributes | |
object | WorldLock = new() |
A lock object for the world. This is used to synchronize access to the world from multiple threads. | |
BodyMoveEventHandler? | BodyMove |
The body move event handler. This is called when a body moves. | |
SensorBeginTouchEventHandler? | SensorBeginTouch |
The sensor begin touch event handler. This is called when a sensor begins touching another shape. | |
SensorEndTouchEventHandler? | SensorEndTouch |
The sensor end touch event handler. This is called when a sensor ends touching another shape. | |
ContactBeginTouchEventHandler? | ContactBeginTouch |
The contact begin touch event handler. This is called when a contact begins touching another shape. | |
ContactEndTouchEventHandler? | ContactEndTouch |
The contact end touch event handler. This is called when a contact ends touching another shape. | |
ContactHitEventHandler? | ContactHit |
The contact hit event handler. This is called when a contact hits another shape. | |
Properties | |
static IComparer< World > | DefaultComparer = WorldComparer.Instance [get] |
Default comparer for World instances. This is used for hashing and equality checks. | |
static IEqualityComparer< World > | DefaultEqualityComparer = WorldComparer.Instance [get] |
Default equality comparer for World instances. This is used for hashing and equality checks. | |
bool | Valid [get] |
World id validation. Provides validation for up to 64K allocations. | |
BodyEvents | BodyEvents [get] |
Get the body events for the current time step. The event data is transient. Do not store a reference to this data. | |
SensorEvents | SensorEvents [get] |
Get sensor events for the current time step. The event data is transient. Do not store a reference to this data. | |
ContactEvents | ContactEvents [get] |
Get the contact events for the current time step. The event data is transient. Do not store a reference to this data. | |
bool | SleepingEnabled [get, set] |
Gets or sets the sleeping enabled status of the world. If your application does not need sleeping, you can gain some performance by disabling sleep completely at the world level. | |
bool | ContinuousEnabled [get, set] |
Gets or sets the continuous collision enabled state of the world. | |
float | RestitutionThreshold [get, set] |
The restitution speed threshold. | |
float | HitEventThreshold [get, set] |
The hit event threshold in meters per second. | |
Vec2 | Gravity [get, set] |
The gravity vector. | |
float | MaximumLinearSpeed [get, set] |
The maximum linear speed. | |
bool | WarmStartingEnabled [get, set] |
Enable/disable constraint warm starting. Advanced feature for testing. Disabling warm starting greatly reduces stability and provides no performance gain. | |
int | AwakeBodyCount [get] |
Get the number of awake bodies. | |
Profile | Profile [get] |
Get the current world performance profile. | |
Counters | Counters [get] |
Get world counters and sizes. | |
object? | UserData [get, set] |
The user data object for this world. | |
IEnumerable< Body > | Bodies [get] |
Gets the bodies in this world. | |
A Box2D World, the container for all bodies, shapes, and constraints.
|
inline |
Create a world for rigid body simulation. A world contains bodies, shapes, and constraints. You make create up to 128 worlds. Each world is completely independent and may be simulated in parallel.
def | The world definition |
float Box2D.World.CastMover | ( | in Capsule | mover, |
Vec2 | translation, | ||
QueryFilter | filter | ||
) |
Cast a capsule mover through the world. This is a special shape cast that handles sliding along other shapes while reducing clipping.
mover | The capsule mover |
translation | The translation of the capsule from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
|
inline |
Cast a ray into the world to collect shapes in the path of the ray.
origin | The start point of the ray |
translation | The translation of the ray from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
Your callback function controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. The callback function may receive shapes in any order
|
inline |
Cast a ray into the world to collect shapes in the path of the ray.
origin | The start point of the ray |
translation | The translation of the ray from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
///
context | A user context that is passed along to the callback function |
Your callback function controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. The callback function may receive shapes in any order
|
inline |
Cast a ray into the world to collect shapes in the path of the ray.
origin | The start point of the ray |
translation | The translation of the ray from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | A user context that is passed along to the callback function |
Your callback function controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. The callback function may receive shapes in any order
TContext | : | class |
|
inline |
Cast a ray into the world to collect shapes in the path of the ray.
origin | The start point of the ray |
translation | The translation of the ray from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | A user context that is passed along to the callback function |
Your callback function controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. The callback function may receive shapes in any order
TContext | : | unmanaged |
RayResult Box2D.World.CastRayClosest | ( | Vec2 | origin, |
Vec2 | translation, | ||
QueryFilter | filter | ||
) |
Cast a ray into the world to collect the closest hit. This is a convenience function.
origin | The start point of the ray |
translation | The translation of the ray from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
This is less general than b2World_CastRay() and does not allow for custom filtering
|
inline |
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point.
proxy | The shape proxy |
translation | The translation of the shape from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
|
inline |
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point.
proxy | The shape proxy |
translation | The translation of the shape from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | A user context that is passed along to the callback function |
|
inline |
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point.
proxy | The shape proxy |
translation | The translation of the shape from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | A user context that is passed along to the callback function |
TContext | : | class |
|
inline |
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point.
proxy | The shape proxy |
translation | The translation of the shape from the start point to the end point |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | A user context that is passed along to the callback function |
TContext | : | unmanaged |
|
inline |
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for kinematic character movement.
mover | The capsule mover |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
void Box2D.World.CollideMover | ( | in Capsule | mover, |
QueryFilter | filter, | ||
PlaneResultNintCallback | callback, | ||
nint | context | ||
) |
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for kinematic character movement.
mover | The capsule mover |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | A user context that is passed along to the callback function |
|
inline |
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for kinematic character movement.
mover | The capsule mover |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | A user context that is passed along to the callback function |
TContext | : | class |
|
inline |
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for kinematic character movement.
mover | The capsule mover |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | A user context that is passed along to the callback function |
TContext | : | unmanaged |
Creates a rigid body given a definition.
def | The body definition |
DistanceJoint Box2D.World.CreateJoint | ( | DistanceJointDef | def | ) |
Creates a distance joint.
def | The distance joint definition |
Joint Box2D.World.CreateJoint | ( | FilterJointDef | def | ) |
Creates a filter joint. See FilterJointDef for details.
def | The filter joint definition |
The filter joint is used to disable collision between two bodies. As a side effect of being a joint, it also keeps the two bodies in the same simulation island.
MotorJoint Box2D.World.CreateJoint | ( | MotorJointDef | def | ) |
Creates a motor joint.
def | The motor joint definition |
MouseJoint Box2D.World.CreateJoint | ( | MouseJointDef | def | ) |
Creates a mouse joint.
def | The mouse joint definition |
PrismaticJoint Box2D.World.CreateJoint | ( | PrismaticJointDef | def | ) |
Creates a prismatic (slider) joint.
def | The prismatic joint definition |
RevoluteJoint Box2D.World.CreateJoint | ( | RevoluteJointDef | def | ) |
Creates a revolute joint.
def | The RevoluteJointDef |
WeldJoint Box2D.World.CreateJoint | ( | WeldJointDef | def | ) |
Creates a weld joint.
def | The WeldJointDef |
WheelJoint Box2D.World.CreateJoint | ( | WheelJointDef | def | ) |
Creates a wheel joint.
def | The wheel joint definition |
Create a world for rigid body simulation. A world contains bodies, shapes, and constraints. You make create up to 128 worlds. Each world is completely independent and may be simulated in parallel.
def | The world definition |
|
inline |
Call this to draw shapes and other debug draw data.
draw | The debug draw implementation |
void Box2D.World.DumpMemoryStats | ( | ) |
Dumps memory stats to box2d_memory.txt.
Memory stats are dumped to box2d_memory.txt
void Box2D.World.Explode | ( | in ExplosionDef | explosionDef | ) |
Apply a radial explosion.
explosionDef | The explosion definition |
Explosions are modeled as a force, not as a collision event
|
inline |
Overlap test for all shapes that potentially overlap the provided AABB.
aabb | The AABB |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | The context |
|
inline |
Overlap test for all shapes that potentially overlap the provided AABB.
aabb | The AABB |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
|
inline |
Overlap test for all shapes that potentially overlap the provided AABB.
aabb | The AABB |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | The context |
TContext | : | class |
|
inline |
Overlap test for all shapes that potentially overlap the provided AABB.
aabb | The AABB |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | The context |
TContext | : | unmanaged |
|
inline |
Overlap test for all shapes that overlap the provided shape proxy.
proxy | The shape proxy |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
|
inline |
Overlap test for all shapes that overlap the provided shape proxy.
proxy | The shape proxy |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | The context |
TContext | : | class |
|
inline |
Overlap test for all shapes that overlap the provided shape proxy.
proxy | The shape proxy |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | The context |
|
inline |
Overlap test for all shapes that overlap the provided shape proxy.
proxy | The shape proxy |
filter | Contains bit flags to filter unwanted shapes from the results |
callback | A user implemented callback function |
context | The context |
TContext | : | unmanaged |
void Box2D.World.SetContactTuning | ( | float | hertz, |
float | dampingRatio, | ||
float | pushSpeed | ||
) |
Adjust contact tuning parameters.
hertz | The contact stiffness (cycles per second) |
dampingRatio | The contact bounciness with 1 being critical damping (non-dimensional) |
pushSpeed | The maximum contact constraint push out speed (meters per second) |
Note: Advanced feature
|
inline |
Register the custom filter callback. This is optional.
nintCallback | The custom filter callback function |
|
inline |
Register the custom filter callback. This is optional.
callback | The custom filter callback function |
context | The context to be passed to the callback |
|
inline |
Register the custom filter callback. This is optional.
callback | The custom filter callback function |
context | The context to be passed to the callback |
TContext | : | class |
|
inline |
Register the custom filter callback. This is optional.
callback | The custom filter callback function |
context | The context to be passed to the callback |
TContext | : | unmanaged |
void Box2D.World.SetFrictionCallback | ( | FrictionCallback | callback | ) |
Sets the friction callback.
callback | The friction callback |
Passing NULL resets to default
void Box2D.World.SetJointTuning | ( | float | hertz, |
float | dampingRatio | ||
) |
Adjust joint tuning parameters.
hertz | The contact stiffness (cycles per second) |
dampingRatio | The contact bounciness with 1 being critical damping (non-dimensional) |
Advanced feature
|
inline |
Register the pre-solve callback. This is optional.
callback | The pre-solve callback function |
|
inline |
Register the pre-solve callback. This is optional.
callback | The pre-solve callback function |
context | The context |
|
inline |
Register the pre-solve callback. This is optional.
callback | The pre-solve callback function |
context | The context |
TContext | : | class |
|
inline |
Register the pre-solve callback. This is optional.
callback | The pre-solve callback function |
context | The context |
TContext | : | unmanaged |
void Box2D.World.SetRestitutionCallback | ( | RestitutionCallback | callback | ) |
Sets the restitution callback.
callback | The restitution callback |
Passing NULL resets to default
|
inline |
Simulate a world for one time step. This performs collision detection, integration, and constraint solution.
timeStep | The amount of time to simulate, this should be a fixed number. Usually 1/60. |
subStepCount | The number of sub-steps, increasing the sub-step count can increase accuracy. Usually 4. |
parallelEvents | If true, the events will be processed in parallel. |
BodyMoveEventHandler? Box2D.World.BodyMove |
The body move event handler. This is called when a body moves.
If this is set, the World will raise events for all valid BodyMoveEvents.
Note: This is not called for all bodies, only for those that are valid. The number of events may be different to those found in the world's BodyEvents.
ContactBeginTouchEventHandler? Box2D.World.ContactBeginTouch |
The contact begin touch event handler. This is called when a contact begins touching another shape.
If this is set, the World will raise events for all ContactBeginTouchEvents.
Note: This is not called for all contact shapes, only for those that are valid. The number of events may be different to those found in the world's ContactEvents.
ContactEndTouchEventHandler? Box2D.World.ContactEndTouch |
The contact end touch event handler. This is called when a contact ends touching another shape.
If this is set, the World will raise events for all ContactEndTouchEvents.
Note: This is not called for all contact shapes, only for those that are valid. The number of events may be different to those found in the world's ContactEvents.
ContactHitEventHandler? Box2D.World.ContactHit |
The contact hit event handler. This is called when a contact hits another shape.
If this is set, the World will raise events for all ContactHitEvents.
Note: This is not called for all contact shapes, only for those that are valid. The number of events may be different to those found in the world's ContactEvents.
SensorBeginTouchEventHandler? Box2D.World.SensorBeginTouch |
The sensor begin touch event handler. This is called when a sensor begins touching another shape.
If this is set, the World will raise events for all SensorBeginTouchEvents.
Note: This is not called for all sensor shapes, only for those that are valid. The number of events may be different to those found in the world's SensorEvents.
SensorEndTouchEventHandler? Box2D.World.SensorEndTouch |
The sensor end touch event handler. This is called when a sensor ends touching another shape.
If this is set, the World will raise events for all SensorEndTouchEvents.
Note: This is not called for all sensor shapes, only for those that are valid. The number of events may be different to those found in the world's SensorEvents.
object Box2D.World.WorldLock = new() |
A lock object for the world. This is used to synchronize access to the world from multiple threads.
If you wish to mutate the world, you should use your own Lock object, or use a lock
statement with this lock object, e.g.
Thread 1:
Thread 2:
Note: It is your responsibility to ensure that the object is unlocked within the time required for another Step.
Event handlers run within a world lock. Do not lock the world lock in a world event handler. This will cause a deadlock.
|
get |
Get the number of awake bodies.
|
get |
Get the body events for the current time step. The event data is transient. Do not store a reference to this data.
|
get |
Get the contact events for the current time step. The event data is transient. Do not store a reference to this data.
|
getset |
Gets or sets the continuous collision enabled state of the world.
Generally you should keep continuous collision enabled to prevent fast moving objects from going through static objects. The performance gain from disabling continuous collision is minor
|
get |
Get world counters and sizes.
|
get |
Get the current world performance profile.
|
get |
Get sensor events for the current time step. The event data is transient. Do not store a reference to this data.
|
get |
World id validation. Provides validation for up to 64K allocations.