Body Methods |
The Body type exposes the following members.
Name | Description | |
---|---|---|
Add |
Warning: This method is locked during callbacks.
| |
ApplyAngularImpulse |
Apply an angular impulse.
| |
ApplyForce(Vector2) |
Applies a force at the center of mass.
| |
ApplyForce(Vector2) |
Applies a force at the center of mass.
| |
ApplyForce(Vector2, Vector2) |
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.
| |
ApplyForce(Vector2, Vector2) |
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.
| |
ApplyLinearImpulse(Vector2) |
Apply an impulse at a point. This immediately modifies the velocity.
This wakes up the body.
| |
ApplyLinearImpulse(Vector2) |
Apply an impulse at a point. This immediately modifies the velocity.
This wakes up the body.
| |
ApplyLinearImpulse(Vector2, Vector2) |
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.
| |
ApplyLinearImpulse(Vector2, Vector2) |
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.
| |
ApplyTorque |
Apply a torque. This affects the angular velocity
without affecting the linear velocity of the center of mass.
This wakes up the body.
| |
Clone |
Makes a clone of the body. Fixtures and therefore shapes are not included.
Use DeepClone() to clone the body, as well as fixtures and shapes.
| |
CreateChainShape | ||
CreateCircle(Single, Single) | ||
CreateCircle(Single, Single, Vector2) | ||
CreateCompoundPolygon | ||
CreateEdge | ||
CreateEllipse | ||
CreateFixture |
Creates a fixture and attach it to this body.
If the density is non-zero, this function automatically updates the mass of the body.
Contacts are not created until the next time step.
Warning: This method is locked during callbacks.
| |
CreateLineArc | ||
CreateLoopShape | ||
CreatePolygon | ||
CreateRectangle | ||
CreateSolidArc | ||
DeepClone |
Clones the body and all attached fixtures and shapes. Simply said, it makes a complete copy of the body.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetLinearVelocityFromLocalPoint(Vector2) |
Get the world velocity of a local point.
| |
GetLinearVelocityFromLocalPoint(Vector2) |
Get the world velocity of a local point.
| |
GetLinearVelocityFromWorldPoint(Vector2) |
Get the world linear velocity of a world point attached to this body.
| |
GetLinearVelocityFromWorldPoint(Vector2) |
Get the world linear velocity of a world point attached to this body.
| |
GetLocalPoint(Vector2) |
Gets a local point relative to the body's origin given a world point.
| |
GetLocalPoint(Vector2) |
Gets a local point relative to the body's origin given a world point.
Note that the vector only takes the rotation into account, not the position.
| |
GetLocalVector(Vector2) |
Gets a local vector given a world vector.
Note that the vector only takes the rotation into account, not the position.
| |
GetLocalVector(Vector2) |
Gets a local vector given a world vector.
Note that the vector only takes the rotation into account, not the position.
| |
GetTransform |
Get the body transform for the body's origin.
| |
GetTransform(Transform) |
Get the body transform for the body's origin.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetWorldPoint(Vector2) |
Get the world coordinates of a point given the local coordinates.
| |
GetWorldPoint(Vector2) |
Get the world coordinates of a point given the local coordinates.
| |
GetWorldVector(Vector2) |
Get the world coordinates of a vector given the local coordinates.
| |
GetWorldVector(Vector2) |
Get the world coordinates of a vector given the local coordinates.
Note that the vector only takes the rotation into account, not the position.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Remove |
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.
Warning: This method is locked during callbacks.
| |
ResetDynamics |
Resets the dynamics of this body.
Sets torque, force and linear/angular velocity to 0
| |
ResetMassData |
This resets the mass properties to the sum of the mass properties of the fixtures.
This normally does not need to be called unless you called SetMassData to override
the mass and you later want to reset the mass.
| |
SetCollidesWith | Obsolete.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
| |
SetCollisionCategories | Obsolete.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
| |
SetCollisionGroup | Obsolete.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
| |
SetFriction | Obsolete.
Set friction on all fixtures.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
| |
SetIsSensor | Obsolete.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
| |
SetRestitution | Obsolete.
Set restitution on all fixtures.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
| |
SetTransform(Vector2, Single) |
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.
Warning: This method is locked during callbacks.
| |
SetTransform(Vector2, Single) |
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.
Warning: This method is locked during callbacks.
| |
SetTransformIgnoreContacts |
For teleporting a body without considering new contacts immediately.
Warning: This method is locked during callbacks.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
MethodInvoke |
Calls the object method by name.
(Defined by ObjectEx.) | |
PropertyGet(String, Object, Boolean) | Overloaded.
Gets the value of the object property by name.
(Defined by ObjectEx.) | |
PropertyGetT(String, Object, Boolean) | Overloaded.
Gets the value of the object property by name.
(Defined by ObjectEx.) | |
PropertySet |
Sets the value of the object property by name.
(Defined by ObjectEx.) |