Gets or sets the angular velocity. Measured in radians/second.
ApplyAngularImpulse (ImpulseAsFloat)
Apply an angular impulse.
Impulse - the angular impulse in units of kg*m*m/s
ApplyForce (ForceAsB2Vec2, PointAsB2Vec2)
Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity. This wakes up the body.
Force - the world force vector, usually in Newtons (N). Point - the world position of the point of application.
ApplyForceToCenter (ForceAsB2Vec2)
Apply a force to the center of mass. This wakes up the body.
Force - the world force vector, usually in Newtons (N).
Apply an impulse at a point. This immediately modifies the velocity. It also modifies the angular velocity if the point of application is not at the center of mass. This wakes up the body.
Impulse - the world impulse vector, usually in N-seconds or kg-m/s. Point - the world position of the point of application. Wake - also wake up the body
ApplyTorque (TorqueAsFloat)
Apply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up the body.
Torque - about the z-axis (out of the screen), usually in N-m.
AwakeAsBoolean
Get or set the sleeping state of this body. A sleeping body has very low CPU cost.
Creates a fixture and attach it to this body. Use this function if you need to set some fixture parameters, like friction. Otherwise you can create the fixture directly from a shape with CreateFixture2. If the density is non-zero, this function automatically updates the mass of the body. Contacts are not created until the next time step. This function is locked during callbacks.
Creates a fixture from a shape and attach it to this body. This is a convenience function. Use FixtureDef if you need to set parameters like friction, restitution, user data, or filtering. If the density is non-zero, this function automatically updates the mass of the body.
Shape - The fixture shape. Do not reuse this shape! Density - the shape density (set to zero for static bodies). This function is locked during callbacks.
DestroyFixture (FixtureAsB2Fixture)
Destroy a fixture. This removes the fixture from the broad-phase and destroys all contacts associated with this fixture. This will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density. All fixtures attached to a body are implicitly destroyed when the body is destroyed.
This function is locked during callbacks.
FirstFixtureAsB2Fixture [read only]
Returns the first fixture.
FixedRotationAsBoolean
Get or set whether this body have fixed rotation. Setting causes the mass to be reset.
GetContactList (TouchingOnlyAsBoolean) AsList
Returns a list with the body contacts. TouchingOnly - If False then the list will include non-touching collisions (based on the bodies AABBs).
GetLocalPoint (WorldPointAsB2Vec2) AsB2Vec2
Gets a local point relative to the body's origin given a world point.
GetLocalVector (WorldVectorAsB2Vec2) AsB2Vec2
Gets a local vector given a world vector.
GetWorldPoint (LocalPointAsB2Vec2) AsB2Vec2
Get the world coordinates of a point given the local coordinates.
LocalPoint - a point on the body measured relative the the body's origin.
GetWorldVector (LocalVectorAsB2Vec2) AsB2Vec2
Get the world coordinates of a vector given the local coordinates.
LocalVector - a vector fixed in the body.
GravityScaleAsFloat
Gets or sets the gravity scale.
InertiaAsFloat [read only]
Get the central rotational inertia of the body. Usually in kg-m^2
IsBulletAsBoolean [read only]
Is this body treated like a bullet for continuous collision detection?
IsCollidingAsBoolean [read only]
Returns true if the contact list is not empty. Note that the list includes non-touching contacts.
IsInitializedAsBoolean [read only]
LinearDampingAsFloat
Get or set the linear damping of the body.
LinearVelocityAsB2Vec2
Get or sets the linear velocity of the center of mass. Do not modify the returned vector.
LocalCenterAsB2Vec2 [read only]
Get the local position of the center of mass. Do not modify.
MassAsFloat [read only]
Get the total mass of the body. Usually in kilograms (kg).
PositionAsB2Vec2 [read only]
Get the world body origin position. Do not modify.
SetTransform (PositionAsB2Vec2, AngleAsFloat)
Set the position of the body's origin and rotation. This breaks any contacts and wakes the other bodies. Manipulating a body's transform may cause non-physical behavior. Note: contacts are updated on the next call to World.TimeStep().
Position - the world position of the body's local origin. Angle - the world rotation in radians.
SleepingAllowedAsBoolean
Get or set whether sleeping is allowed.
TagAsObject
TransformAsB2Transform [read only]
Gets the body transformation.
TYPE_DYNAMICAsObject
TYPE_KINEMATICAsObject
TYPE_STATICAsObject
WorldCenterAsB2Vec2 [read only]
Get the world position of the center of mass. Do not modify.
Set this flag to false if this body should never fall asleep. Note that this increases CPU usage.
AngleAsFloat
The world angle of the body in radians.
AngularDampingAsFloat
Angular damping is use to reduce the angular velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large.
AngularVelocityAsFloat
The angular velocity of the body.
AwakeAsBoolean
Is this body initially sleeping?
BodyTypeAsObject
Get or set the body type.
BulletAsBoolean
Is this a fast moving body that should be prevented from tunneling through other moving bodies? Note that all bodies are prevented from tunneling through kinematic and static bodies. This setting is only considered on dynamic bodies.
You should use this flag sparingly since it increases processing time.
FixedRotationAsBoolean
Should this body be prevented from rotating? Useful for characters.
GravityScaleAsFloat
Experimental: scales the inertia tensor.
LinearDampingAsFloat
Linear damping is use to reduce the linear velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large.
LinearVelocityAsB2Vec2
The linear velocity of the body in world co-ordinates.
PositionAsB2Vec2
The world position of the body. Avoid creating bodies at the origin since this can lead to many overlapping shapes.
A chain shape is a free form sequence of line segments. The chain has two-sided collision, so you can use inside and outside collision. Therefore, you may use any winding order. Connectivity information is used to create smooth collisions. WARNING: The chain will not collide properly if there are self-intersections.
A contact between two bodies. Note that a contact is created whenever the bodies AABBs overlap. Check IsTouching to find whether the two bodies are actually touching.
Returns the first fixture. Note that the order of fixtures is not consistent.
FixtureBAsB2Fixture [read only]
Returns the second fixture.
GetManifoldAsB2Manifold
Gets the contact manifold.
GetWorldManifold (OutManifoldAsB2WorldManifold)
Gets the world manifold.
IsEnabledAsBoolean
Enable/disable this contact. This can be used inside the pre-solve contact listener. The contact is only disabled for the current time step (or sub-step in continuous collisions).
IsTouchingAsBoolean [read only]
Returns true if the two bodies are actually touching.
NextContactAsB2Contact
Returns the next contact or Null if none. Should only be used with contacts accessed with World.FirstContact. To avoid creating new objects the current object will point to the next contact.
A line segment (edge) shape. These can be connected in chains or loops to other edge shapes. The connectivity information is used to ensure correct contact normals.
The friction coefficient, usually in the range [0,1].
IsInitializedAsBoolean [read only]
IsSensorAsBoolean
A sensor shape collects contact information but never generates a collision response.
NextFixtureAsB2Fixture
Returns the next fixture. Returns Null if this is the last fixture.
RestitutionAsFloat
The restitution (elasticity) usually in the range [0,1].
SetFilterBits (CategoryBitsAsInt, MaskBitsAsInt)
Limited to lower 16 bits. CategoryBits - A bit (or more) that defines the current fixture. Default value: 1. MaskBits - Bits defining the other fixtures that will collide with this fixture. Default value 0xFFFF.
ShapeAsB2Shape [read only]
Get the child shape. You can modify the child shape, however you should not change the number of vertices because this will crash some collision caching mechanisms.
The friction coefficient, usually in the range [0,1].
IsSensorAsBoolean
A sensor shape collects contact information but never generates a collision response.
RestitutionAsFloat
The restitution (elasticity) usually in the range [0,1].
SetFilterBits (CategoryBitsAsInt, MaskBitsAsInt)
Limited to lower 16 bits. CategoryBits - A bit (or more) that defines the current fixture. Default value: 1. MaskBits - Bits defining the other fixtures that will collide with this fixture. Default value 0xFFFF.
ShapeAsB2Shape
The shape, this must be set. The shape will be cloned when the fixture is created.
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in bodyA. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
Creates a box polygon. HalfWidth / HalfHeight - Box dimensions. Center - Box center in local coordinates. Angle - Box rotation in local coordinates (radians).
SHAPE_CHAINAsObject
SHAPE_CIRCLEAsObject
SHAPE_EDGEAsObject
SHAPE_POLYGONAsObject
ShapeTypeAsObject [read only]
Returns the shape type which is one of the SHAPE constants.
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in bodyA. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.
Wheel joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly.
BeginContact (Contact As B2Contact) EndContact (Contact As B2Contact) PreSolve (Contact As B2Contact, OldManifold As B2Manifold) PostSolve (Contact As B2Contact, Impulse As B2ContactImpulse) RayCastCallback (Fixture As B2Fixture, Point As B2Vec2, Normal As B2Vec2, Fraction As Float) As Float
Create a rigid body given a definition. This function is locked during callbacks.
CreateJoint (JointDefAsB2JointDef) AsB2Joint
CreateVec2 (XAsFloat, YAsFloat) AsB2Vec2
Created a B2Vec2 vector.
DestroyBody (BodyAsB2Body)
This automatically deletes all associated shapes and joints. This function is locked during callbacks.
DestroyJoint (JointAsB2Joint)
DynamicBodiesAsList [read only]
Returns a list with all the bodies with dynamic body type.
FirstContactAsB2Contact
Returns the first contact. Note that the list of contacts includes non-touching contacts. Example: DimcontactAsB2Contact = world.FirstContact DoWhilecontact <> Null Ifcontact.IsTouchingThen '... EndIf contact = contact.NextContact Loop
FirstJointAsB2Joint
GravityAsB2Vec2
Gets or sets the world gravity.
Initialize (EventNameAsString, GravityAsB2Vec2)
Initializes the world and sets its gravity.
LockedAsBoolean [read only]
Returns True if the world is currently locked for changes.
QueryAABBToListOfFixtures (AABBAsB2AABB) AsList
Queries the world for all fixtures that potentially overlap the given AABB. Returns a List. Each item in the list is a B2Fixture.
QueryAABBToMapOfBodies (AABBAsB2AABB) AsMap
Queries the world for all fixtures that potentially overlap the given AABB. Returns a Map with the bodies as keys. The map values are not used.
RayCast (FromVecAsB2Vec2, ToVecAsB2Vec2)
Ray-cast the world for all fixtures in the path of the ray, going from FromVec to ToVec. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point.
The RayCastCallback event will be raised. The return value from this event determines the behavior: 0 - Terminate the ray cast. Fraction - Clip the ray to this point. 1 - Do not clip the ray and continue. -1 - Ignore this fixture.
Take a time step. This performs collision detection, integration, and constraint solution.
TimeStep - the amount of time to simulate, this should not vary. VelocityIterations - for the velocity constraint solver. PositionIterations - for the position constraint solver.