- addCentralForce
void addCentralForce(Vector2 force)
- addForce
void addForce(Vector2 offset, Vector2 force)
- addTorque
void addTorque(double torque)
- applyCentralImpulse
void applyCentralImpulse(Vector2 impulse)
- applyImpulse
void applyImpulse(Vector2 offset, Vector2 impulse)
- applyTorqueImpulse
void applyTorqueImpulse(double impulse)
- getAngularVelocity
double getAngularVelocity()
- getContactCollider
RID getContactCollider(long contact_idx)
Return the RID of the collider.
- getContactColliderId
long getContactColliderId(long contact_idx)
Return the object id of the collider.
- getContactColliderObject
GodotObject getContactColliderObject(long contact_idx)
Return the collider object, this depends on how it was created (will return a scene node if such was used to create it).
- getContactColliderPosition
Vector2 getContactColliderPosition(long contact_idx)
Return the contact position in the collider.
- getContactColliderShape
long getContactColliderShape(long contact_idx)
Return the collider shape index.
- getContactColliderShapeMetadata
Variant getContactColliderShapeMetadata(long contact_idx)
Return the metadata of the collided shape. This metadata is different from GodotObject.getMeta, and is set with Physics2DServer.shapeSetData.
- getContactColliderVelocityAtPosition
Vector2 getContactColliderVelocityAtPosition(long contact_idx)
Return the linear velocity vector at contact point of the collider.
- getContactCount
long getContactCount()
Return the amount of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts.
- getContactLocalNormal
Vector2 getContactLocalNormal(long contact_idx)
Return the local normal (of this body) of the contact point.
- getContactLocalPosition
Vector2 getContactLocalPosition(long contact_idx)
Return the local position (of this body) of the contact point.
- getContactLocalShape
long getContactLocalShape(long contact_idx)
Return the local shape index of the collision.
- getInverseInertia
double getInverseInertia()
- getInverseMass
double getInverseMass()
- getLinearVelocity
Vector2 getLinearVelocity()
- getSpaceState
Physics2DDirectSpaceState getSpaceState()
Return the current state of space, useful for queries.
- getStep
double getStep()
- getTotalAngularDamp
double getTotalAngularDamp()
- getTotalGravity
Vector2 getTotalGravity()
- getTotalLinearDamp
double getTotalLinearDamp()
- getTransform
Transform2D getTransform()
- integrateForces
void integrateForces()
Call the built-in force integration code.
- isSleeping
bool isSleeping()
- opAssign
Physics2DDirectBodyState opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(Physics2DDirectBodyState other)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
- setAngularVelocity
void setAngularVelocity(double velocity)
- setLinearVelocity
void setLinearVelocity(Vector2 velocity)
- setSleepState
void setSleepState(bool enabled)
- setTransform
void setTransform(Transform2D transform)
- angularVelocity
double angularVelocity [@property getter]
double angularVelocity [@property setter]
The angular velocity of the body.
- inverseInertia
double inverseInertia [@property getter]
The inverse of the inertia of the body.
- inverseMass
double inverseMass [@property getter]
The inverse of the mass of the body.
- linearVelocity
Vector2 linearVelocity [@property getter]
Vector2 linearVelocity [@property setter]
The linear velocity of the body.
- sleeping
bool sleeping [@property getter]
bool sleeping [@property setter]
true if this body is currently sleeping (not active).
- step
double step [@property getter]
The timestep (delta) used for the simulation.
- totalAngularDamp
double totalAngularDamp [@property getter]
The rate at which the body stops rotating, if there are not any other forces moving it.
- totalGravity
Vector2 totalGravity [@property getter]
The total gravity vector being currently applied to this body.
- totalLinearDamp
double totalLinearDamp [@property getter]
The rate at which the body stops moving, if there are not any other forces moving it.
- transform
Transform2D transform [@property getter]
Transform2D transform [@property setter]
The transformation matrix of the body.
Direct access object to a physics body in the Physics2DServer.
This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body.