Click or drag to resize

Body Class

Inheritance Hierarchy
SystemObject
  Internal.tainicom.Aether.Physics2D.DynamicsBody

Namespace:  Internal.tainicom.Aether.Physics2D.Dynamics
Assembly:  NeoAxis.Core (in NeoAxis.Core.dll) Version: 2024.1.1.0 (2024.1.1.0)
Syntax
C#
public class Body

The Body type exposes the following members.

Constructors
  NameDescription
Public methodBody
Initializes a new instance of the Body class
Top
Properties
  NameDescription
Public propertyAngularDamping
Gets or sets the angular damping.
Public propertyAngularVelocity
Gets or sets the angular velocity. Radians/second.
Public propertyAwake
Set the sleep state of the body. A sleeping body has very low CPU cost.
Public propertyBodyType
Gets or sets the body type. Warning: This property is readonly during callbacks.
Public propertyContactList
Get the list of all contacts attached to this body. Warning: this list changes during the time step and you may miss some collisions if you don't use callback events.
Public propertyEnabled
Set the active state of the body. An inactive body is not simulated and cannot be collided with or woken up. If you pass a flag of true, all fixtures will be added to the broad-phase. If you pass a flag of false, all fixtures will be removed from the broad-phase and all contacts will be destroyed. Fixtures and joints are otherwise unaffected. You may continue to create/destroy fixtures and joints on inactive bodies. Fixtures on an inactive body are implicitly inactive and will not participate in collisions, ray-casts, or queries. Joints connected to an inactive body are implicitly inactive. An inactive body is still owned by a b2World object and remains in the body list. Warning: This property is readonly during callbacks.
Public propertyFixedRotation
Set this body to have fixed rotation. This causes the mass to be reset.
Public propertyIgnoreCCD
Public propertyIgnoreGravity
Gets or sets a value indicating whether this body ignores gravity.
Public propertyInertia
Get or set the rotational inertia of the body about the local origin. usually in kg-m^2. Warning: This property is readonly during callbacks.
Public propertyIsBullet
Gets or sets a value indicating whether this body should be included in the CCD solver.
Public propertyIslandIndex
Public propertyJointList
Get the list of all joints attached to this body.
Public propertyLinearDamping
Gets or sets the linear damping.
Public propertyLinearVelocity
Get or sets the linear velocity of the center of mass.
Public propertyLocalCenter
Get the local position of the center of mass. Warning: This property is readonly during callbacks.
Public propertyMass
Gets or sets the mass. Usually in kilograms (kg). Warning: This property is readonly during callbacks.
Public propertyPosition
Get the world body origin position.
Public propertyRevolutions
Gets the total number revolutions the body has made.
Public propertyRotation
Get the angle in radians.
Public propertySleepingAllowed
You can disable sleeping on this body. If you disable sleeping, the body will be woken.
Public propertyWorld
Get the parent World of this body. This is null if the body is not attached.
Public propertyWorldCenter
Get the world position of the center of mass.
Top
Methods
  NameDescription
Public methodAdd
Warning: This method is locked during callbacks.
Public methodApplyAngularImpulse
Apply an angular impulse.
Public methodApplyForce(Vector2)
Applies a force at the center of mass.
Public methodApplyForce(Vector2)
Applies a force at the center of mass.
Public methodApplyForce(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.
Public methodApplyForce(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.
Public methodApplyLinearImpulse(Vector2)
Apply an impulse at a point. This immediately modifies the velocity. This wakes up the body.
Public methodApplyLinearImpulse(Vector2)
Apply an impulse at a point. This immediately modifies the velocity. This wakes up the body.
Public methodApplyLinearImpulse(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.
Public methodApplyLinearImpulse(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.
Public methodApplyTorque
Apply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up the body.
Public methodClone
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.
Public methodCreateChainShape
Public methodCreateCircle(Single, Single)
Public methodCreateCircle(Single, Single, Vector2)
Public methodCreateCompoundPolygon
Public methodCreateEdge
Public methodCreateEllipse
Public methodCreateFixture
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.
Public methodCreateLineArc
Public methodCreateLoopShape
Public methodCreatePolygon
Public methodCreateRectangle
Public methodCreateSolidArc
Public methodDeepClone
Clones the body and all attached fixtures and shapes. Simply said, it makes a complete copy of the body.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetLinearVelocityFromLocalPoint(Vector2)
Get the world velocity of a local point.
Public methodGetLinearVelocityFromLocalPoint(Vector2)
Get the world velocity of a local point.
Public methodGetLinearVelocityFromWorldPoint(Vector2)
Get the world linear velocity of a world point attached to this body.
Public methodGetLinearVelocityFromWorldPoint(Vector2)
Get the world linear velocity of a world point attached to this body.
Public methodGetLocalPoint(Vector2)
Gets a local point relative to the body's origin given a world point.
Public methodGetLocalPoint(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.
Public methodGetLocalVector(Vector2)
Gets a local vector given a world vector. Note that the vector only takes the rotation into account, not the position.
Public methodGetLocalVector(Vector2)
Gets a local vector given a world vector. Note that the vector only takes the rotation into account, not the position.
Public methodGetTransform
Get the body transform for the body's origin.
Public methodGetTransform(Transform)
Get the body transform for the body's origin.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetWorldPoint(Vector2)
Get the world coordinates of a point given the local coordinates.
Public methodGetWorldPoint(Vector2)
Get the world coordinates of a point given the local coordinates.
Public methodGetWorldVector(Vector2)
Get the world coordinates of a vector given the local coordinates.
Public methodGetWorldVector(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.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove
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.
Public methodResetDynamics
Resets the dynamics of this body. Sets torque, force and linear/angular velocity to 0
Public methodResetMassData
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.
Public methodSetCollidesWith Obsolete.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
Public methodSetCollisionCategories Obsolete.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
Public methodSetCollisionGroup Obsolete.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
Public methodSetFriction Obsolete.
Set friction on all fixtures. Warning: This method applies the value on existing Fixtures. It's not a property of Body.
Public methodSetIsSensor Obsolete.
Warning: This method applies the value on existing Fixtures. It's not a property of Body.
Public methodSetRestitution Obsolete.
Set restitution on all fixtures. Warning: This method applies the value on existing Fixtures. It's not a property of Body.
Public methodSetTransform(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.
Public methodSetTransform(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.
Public methodSetTransformIgnoreContacts
For teleporting a body without considering new contacts immediately. Warning: This method is locked during callbacks.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventOnCollision
Public eventOnSeparation
Top
Fields
  NameDescription
Public fieldControllerFilter
Public fieldFixtureList
Gets all the fixtures attached to this body.
Public fieldTag
Set the user data. Use this to store your application specific data.
Top
Extension Methods
See Also