java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.RShapeCast
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class RShapeCast extends JoltPhysicsObject
A shape cast with an RVec3 start location.
  • Constructor Details

    • RShapeCast

      public RShapeCast(ConstShape shape, Vec3Arg scale, RMat44Arg comStart, Vec3Arg offset)
      Instantiate a shape cast with the specified parameters.
      Parameters:
      shape - the shape to use (not null, unaffected)
      scale - the scale vector to use (not null, unaffected)
      comStart - the desired start position (not null, unaffected)
      offset - the desired end offset from the start (not null, unaffected)
    • RShapeCast

      public RShapeCast(ConstShape shape, Vec3Arg scale, RMat44Arg comStart, Vec3Arg offset, ConstAaBox wsBounds)
      Instantiate a shape cast with the specified parameters.
      Parameters:
      shape - the shape to use (not null, unaffected)
      scale - the scale vector to use (not null, unaffected)
      comStart - the desired start position (not null, unaffected)
      offset - the desired end offset from the start (not null, unaffected)
      wsBounds - the world-space bounds to use (not null, unaffected)
  • Method Details

    • sFromWorldTransform

      public static RShapeCast sFromWorldTransform(ConstShape shape, Vec3Arg scale, RMat44Arg worldTransform, Vec3Arg direction)
      Create a shape cast using a world transform instead of a center-of-mass transform.
      Parameters:
      shape - the shape to use (not null, unaffected)
      scale - the scale to apply (not null, unaffected)
      worldTransform - the world transform to use (not null, unaffected)
      direction - the direction of casting (not null, unaffected)
      Returns:
      a new object
    • getCenterOfMassStart

      public RMat44 getCenterOfMassStart()
      Copy the starting center of mass. The shape cast is unaffected. (native attribute: mCenterOfMassStart)
      Returns:
      a new location vector
    • getDirection

      public Vec3 getDirection()
      Copy the direction. The shape cast is unaffected. (native attribute: mDirection)
      Returns:
      a new direction vector
    • getPointOnRay

      public RVec3 getPointOnRay(float fraction)
      Return a point on the ray with the specified fraction. The shape cast is unaffected.
      Parameters:
      fraction - (0→start of ray, 1→end of ray)
      Returns:
      a new location vector
    • getShape

      public ConstShape getShape()
      Access the shape. The shape cast is unaffected. (native attribute: mShape)
      Returns:
      a new JVM object with the pre-existing native object assigned