Skip to content

RigidBody

0880 edited this page Apr 5, 2024 · 1 revision

Properties

  • isStatic: A boolean indicating whether the rigid body is static.
  • fixedRotation: A boolean indicating whether the rotation of the rigid body is fixed.
  • bullet: A boolean indicating whether the rigid body is a bullet.
  • userData: A string representing user data associated with the rigid body.

Methods

setAwake(boolean awake)

  • Sets the awake state of the rigid body.

setPosition(float x, float y)

  • Sets the position of the rigid body.

setAngle(float angle)

  • Sets the rotation angle of the rigid body.

setTransform(float x, float y, float angle)

  • Sets the position and rotation angle of the rigid body.

applyForce(float forceX, float forceY, float pointX, float pointY, boolean wake)

  • Applies a force to the rigid body at a specific point.

applyForce(Vector2 force, Vector2 point, boolean wake)

  • Applies a force to the rigid body at a specific point.

applyForceToCenter(float forceX, float forceY, boolean wake)

  • Applies a force to the center of mass of the rigid body.

applyForceToCenter(Vector2 force, boolean wake)

  • Applies a force to the center of mass of the rigid body.

applyLinearImpulse(float impulseX, float impulseY, float pointX, float pointY, boolean wake)

  • Applies a linear impulse to the rigid body at a specific point.

applyLinearImpulse(Vector2 impulse, Vector2 point, boolean wake)

  • Applies a linear impulse to the rigid body at a specific point.

applyAngularImpulse(float impulse, boolean wake)

  • Applies an angular impulse to the rigid body.

applyTorque(float torque, boolean wake)

  • Applies a torque to the rigid body.

setLinearVelocity(float velocityX, float velocityY)

  • Sets the linear velocity of the rigid body.

setLinearVelocity(Vector2 velocity)

  • Sets the linear velocity of the rigid body.

setAngularVelocity(float omega)

  • Sets the angular velocity of the rigid body.

getLinearVelocity()

  • Returns the linear velocity of the rigid body as a Vector2.

getLinearVelocityX()

  • Returns the linear velocity of the rigid body along the x-axis.

getLinearVelocityY()

  • Returns the linear velocity of the rigid body along the y-axis.

getAngularVelocity()

  • Returns the angular velocity of the rigid body.

Clone this wiki locally