Click or drag to resize

Body Properties

The Body type exposes the following members.

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
See Also