Class MultiBodyCollider

All Implemented Interfaces:
Comparable<NativePhysicsObject>

public class MultiBodyCollider extends PhysicsCollisionObject
A collision object for a link or base in a MultiBody, based on Bullet's btMultiBodyLinkCollider.
  • Field Details

    • logger2

      public static final Logger logger2
      message logger for this class
  • Constructor Details

    • MultiBodyCollider

      public MultiBodyCollider(MultiBody multiBody, int linkIndex)
      Instantiate a collider for the indexed link in the specified MultiBody. Used internally.
      Parameters:
      multiBody - (not null, alias created)
      linkIndex - the link index, or -1 for the base
  • Method Details

    • attachShape

      public void attachShape(CollisionShape shape)
      Attach the specified collision shape to this collider. Used internally.
      Parameters:
      shape - the shape to attach (not null, alias created)
    • getMultiBody

      public MultiBody getMultiBody()
      Access the MultiBody that contains this collider.
      Returns:
      the pre-existing instance (not null)
    • linkIndex

      public int linkIndex()
      Determine the index of the corresponding MultiBodyLink.
      Returns:
      the index (≥0) or -1 if this is the base collider
    • mass

      public float mass()
      Determine the mass of this collider.
      Returns:
      the mass (>0)
    • setPhysicsLocation

      public void setPhysicsLocation(Vector3f location)
      Directly alter the location of this collider's center.
      Parameters:
      location - the desired location (in physics-space coordinates, not null, finite, unaffected)
    • setPhysicsLocationDp

      public void setPhysicsLocationDp(Vec3d location)
      Directly alter the location of this collider's center.
      Parameters:
      location - the desired location (in physics-space coordinates, not null, finite, unaffected)
    • setPhysicsRotation

      public void setPhysicsRotation(Matrix3f orientation)
      Directly alter this collider's orientation.
      Parameters:
      orientation - the desired orientation (a rotation matrix in physics-space coordinates, not null, unaffected)
    • setPhysicsRotationDp

      public void setPhysicsRotationDp(Matrix3d orientation)
      Directly alter this collider's orientation.
      Parameters:
      orientation - the desired orientation (a rotation matrix in physics-space coordinates, not null, unaffected)