All Superinterfaces:
Comparable<JoltPhysicsObject>, ConstJoltPhysicsObject
All Known Implementing Classes:
Body

public interface ConstBody extends ConstJoltPhysicsObject
Read-only access to a Body. (native type: const Body)
  • Method Details

    • canBeKinematicOrDynamic

      boolean canBeKinematicOrDynamic()
      Test whether the body could be made kinematic or dynamic. The body is unaffected.
      Returns:
      true if possible, otherwise false
    • getAccumulatedForce

      Vec3 getAccumulatedForce()
      Copy the net force acting on the body. The body is unaffected.
      Returns:
      a new force vector (Newtons in system coordinates)
    • getAccumulatedTorque

      Vec3 getAccumulatedTorque()
      Copy the net torque acting on the body. The body is unaffected.
      Returns:
      a new torque vector (Newton.meters in system coordinates)
    • getAllowSleeping

      boolean getAllowSleeping()
      Test whether the body is allowed to fall asleep. The body is unaffected.
      Returns:
      true if allowed, otherwise false
    • getAngularVelocity

      Vec3 getAngularVelocity()
      Copy the body's angular velocity. The body is unaffected.
      Returns:
      a new velocity vector (radians per second in system coordinates)
    • getBodyCreationSettings

      BodyCreationSettings getBodyCreationSettings()
      Convert the body to a BodyCreationSettings object. The body is unaffected.
      Returns:
      a new object
    • getBodyType

      EBodyType getBodyType()
      Return the body type (rigid or soft). The body is unaffected.
      Returns:
      an enum value (not null)
    • getBroadPhaseLayer

      int getBroadPhaseLayer()
      Return the broadphase layer. The body is unaffected.
      Returns:
      the layer ID
    • getCenterOfMassPosition

      RVec3 getCenterOfMassPosition()
      Copy the location of the body's center of mass (which might not coincide with its origin). The body is unaffected.
      Returns:
      a new location vector (in system coordinates, all components finite)
    • getCenterOfMassPosition

      void getCenterOfMassPosition(RVec3 storeLocation)
      Copy the location of the body's center of mass (which might not coincide with its origin). The body is unaffected.
      Parameters:
      storeLocation - storage for the location (in system coordinates, not null, modified)
    • getCenterOfMassTransform

      RMat44 getCenterOfMassTransform()
      Copy the coordinate transform of the body's center of mass. The body is unaffected.
      Returns:
      a new transform matrix (relative to system coordinates)
    • getCollisionGroup

      ConstCollisionGroup getCollisionGroup()
      Access the body's collision group.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getEnhancedInternalEdgeRemoval

      boolean getEnhancedInternalEdgeRemoval()
      Test whether extra effort should be made to remove ghost contacts. The body is unaffected.
      Returns:
      true for extra effort, otherwise false
    • getFriction

      float getFriction()
      Return the body's friction ratio. The body is unaffected.
      Returns:
      the ratio
    • getId

      int getId()
      Return the body's ID for use with BodyInterface. The body is unaffected.
      Returns:
      the BodyID value
    • getInverseCenterOfMassTransform

      RMat44 getInverseCenterOfMassTransform()
      Copy the inverse coordinate transform of the body's center of mass. The body is unaffected.
      Returns:
      a new transform matrix (relative to local coordinates)
    • getLinearVelocity

      Vec3 getLinearVelocity()
      Copy the body's linear velocity. The body is unaffected.
      Returns:
      a new velocity vector (meters per second in system coordinates)
    • getMotionProperties

      ConstMotionProperties getMotionProperties()
      Access the body's motion properties.
      Returns:
      a new JVM object with the pre-existing native object assigned, or null if none
    • getMotionType

      EMotionType getMotionType()
      Return the body's motion type. The body is unaffected.
      Returns:
      an enum value (not null)
    • getObjectLayer

      int getObjectLayer()
      Return the body's object layer. The body is unaffected.
      Returns:
      a layer index (≥0)
    • getPosition

      RVec3 getPosition()
      Copy the location of the body's origin (which might not coincide with its center of mass). The body is unaffected.
      Returns:
      a new location vector (in system coordinates, all components finite)
    • getPositionAndRotation

      void getPositionAndRotation(RVec3 storeLocation, Quat storeOrientation)
      Copy the position of the body. The body is unaffected.
      Parameters:
      storeLocation - storage for the location (in system coordinates, not null, modified)
      storeOrientation - storage for the orientation (in system coordinates, not null, modified)
    • getRestitution

      float getRestitution()
      Return the body's restitution ratio. The body is unaffected.
      Returns:
      the value (typically ≥0 and ≤1)
    • getRotation

      Quat getRotation()
      Copy the body's orientation. The body is unaffected.
      Returns:
      a new rotation quaternion (relative to the system axes)
    • getShape

      ConstShape getShape()
      Access the body's shape.
      Returns:
      a new immutable JVM object with the pre-existing native object assigned, or null if none
    • getSoftBodyCreationSettings

      SoftBodyCreationSettings getSoftBodyCreationSettings()
      Convert the body to a SoftBodyCreationSettings object. The body is unaffected.
      Returns:
      a new object
    • getTransformedShape

      TransformedShape getTransformedShape()
      Convert the body to a TransformedShape object. The body is unaffected.
      Returns:
      a new object
    • getUserData

      long getUserData()
      Return the body's user data: can be used for anything. The body is unaffected.
      Returns:
      the value
    • getWorldSpaceBounds

      ConstAaBox getWorldSpaceBounds()
      Access the body's bounding box. The body is unaffected.
      Returns:
      a new immutable JVM object with the pre-existing native object assigned
    • getWorldSpaceSurfaceNormal

      Vec3 getWorldSpaceSurfaceNormal(int subShapeId, RVec3Arg location)
      Copy the surface normal of the specified sub-shape at the specified location. The body is unaffected.
      Parameters:
      subShapeId - the ID of the sub-shape to use
      location - the location to use (not null, unaffected)
      Returns:
      a new direction vector
    • getWorldTransform

      RMat44 getWorldTransform()
      Copy the world transform. The body is unaffected.
      Returns:
      a new matrix relative to system coordinates
    • isActive

      boolean isActive()
      Test whether the body is deactivated. The body is unaffected.
      Returns:
      false if deactivated, otherwise true
    • isDynamic

      boolean isDynamic()
      Test whether the body is dynamic. The body is unaffected.
      Returns:
      true if dynamic, otherwise false
    • isInBroadPhase

      boolean isInBroadPhase()
      Test whether the body has been added to its PhysicsSystem. The body is unaffected.
      Returns:
      true if added, otherwise false
    • isKinematic

      boolean isKinematic()
      Test whether the body is kinematic. It is unaffected.
      Returns:
      true if kinematic, otherwise false
    • isRigidBody

      boolean isRigidBody()
      Test whether the body is a rigid body. It is unaffected.
      Returns:
      true if rigid body, otherwise false
    • isSensor

      boolean isSensor()
      Test whether the body is a sensor. It is unaffected.
      Returns:
      true if a sensor, otherwise false
    • isSoftBody

      boolean isSoftBody()
      Test whether the body is soft. It is unaffected.
      Returns:
      true if soft, otherwise false
    • isStatic

      boolean isStatic()
      Test whether the body is static (non-moving). It is unaffected.
      Returns:
      true if static, otherwise false