Class DebugRenderer

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
DebugRendererRecorder

public abstract class DebugRenderer extends NonCopyable
Visualization for debugging purposes.
  • Method Details

    • drawArrow

      public void drawArrow(RVec3Arg from, RVec3Arg to, ConstColor color, float size)
      Draw the specified 3-D arrow.
      Parameters:
      from - the desired starting point (not null, unaffected)
      to - the desired ending point (not null, unaffected)
      color - the desired color (not null, unaffected)
      size - the desired size
    • drawBox

      public void drawBox(ConstAaBox box, ConstColor color)
      Draw the specified axis-aligned 3-D box.
      Parameters:
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawBox

      public void drawBox(ConstAaBox box, ConstColor color, ECastShadow castShadow)
      Draw the specified axis-aligned 3-D box.
      Parameters:
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
    • drawBox

      public void drawBox(ConstAaBox box, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified axis-aligned 3-D box.
      Parameters:
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
      drawMode - the desired draw mode (not null, default=Solid)
    • drawBox

      public void drawBox(RMat44Arg transform, ConstAaBox box, ConstColor color)
      Draw the specified 3-D box.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawBox

      public void drawBox(RMat44Arg transform, ConstAaBox box, ConstColor color, ECastShadow castShadow)
      Draw the specified 3-D box.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
    • drawBox

      public void drawBox(RMat44Arg transform, ConstAaBox box, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified 3-D box.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
      drawMode - the desired draw mode (not null, default=Solid)
    • drawCapsule

      public void drawCapsule(RMat44Arg transform, float halfHeight, float radius, ConstColor color)
      Draw the specified capsule.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      halfHeight - half the desired height of the cylindrical portion
      radius - the desired radius of the capsule
      color - the desired color (not null, unaffected)
    • drawCapsule

      public void drawCapsule(RMat44Arg transform, float halfHeight, float radius, ConstColor color, ECastShadow castShadow)
      Draw the specified capsule.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      halfHeight - half the desired height of the cylindrical portion
      radius - the desired radius of the capsule
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
    • drawCapsule

      public void drawCapsule(RMat44Arg transform, float halfHeight, float radius, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified capsule.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      halfHeight - half the desired height of the cylindrical portion
      radius - the desired radius of the capsule
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
      drawMode - the desired draw mode (not null, default=Solid)
    • drawCoordinateSystem

      public void drawCoordinateSystem(RMat44Arg transform)
      Draw the specified 3-D coordinate axes.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
    • drawCoordinateSystem

      public void drawCoordinateSystem(RMat44Arg transform, float size)
      Draw the specified 3-D coordinate axes.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      size - the desired size (default=1)
    • drawCylinder

      public void drawCylinder(RMat44Arg transform, float halfHeight, float radius, ConstColor color)
      Draw the specified cylinder.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      halfHeight - half of the desired height
      radius - the desired radius
      color - the desired color (not null, unaffected)
    • drawCylinder

      public void drawCylinder(RMat44Arg transform, float halfHeight, float radius, ConstColor color, ECastShadow castShadow)
      Draw the specified cylinder.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      halfHeight - half of the desired height
      radius - the desired radius
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
    • drawCylinder

      public void drawCylinder(RMat44Arg transform, float halfHeight, float radius, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified cylinder.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      halfHeight - half of the desired height
      radius - the desired radius
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
      drawMode - the desired draw mode (not null, default=Solid)
    • drawLine

      public void drawLine(RVec3Arg from, RVec3Arg to, ConstColor color)
      Draw the specified 3-D line.
      Parameters:
      from - the desired first endpoint (not null, unaffected)
      to - the desired 2nd endpoint (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawMarker

      public void drawMarker(RVec3Arg location, ConstColor color, float size)
      Draw a marker at the specified location.
      Parameters:
      location - the desired location (not null, unaffected)
      color - the desired color (not null, unaffected)
      size - the desired size
    • drawPlane

      public void drawPlane(RVec3Arg location, Vec3Arg normal, ConstColor color, float size)
      Draw the specified plane.
      Parameters:
      location - the location of a point through which the plane passes (not null, unaffected)
      normal - a direction normal to the plane's surface (not null, unaffected)
      color - the desired color (not null, unaffected)
      size - the desired size
    • drawSphere

      public void drawSphere(RVec3Arg location, float radius, ConstColor color)
      Draw the specified sphere.
      Parameters:
      location - the location of the sphere's center (not null, unaffected)
      radius - the desired radius
      color - the desired color (not null, unaffected)
    • drawSphere

      public void drawSphere(RVec3Arg location, float radius, ConstColor color, ECastShadow castShadow)
      Draw the specified sphere.
      Parameters:
      location - the location of the sphere's center (not null, unaffected)
      radius - the desired radius
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
    • drawSphere

      public void drawSphere(RVec3Arg location, float radius, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified sphere.
      Parameters:
      location - the location of the sphere's center (not null, unaffected)
      radius - the desired radius
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
      drawMode - the desired draw mode (not null, default=Solid)
    • drawText3D

      public void drawText3D(RVec3Arg location, String text)
      Draw the specified 3-D text.
      Parameters:
      location - the location of the text (not null, unaffected)
      text - the text to display (not null)
    • drawText3D

      public void drawText3D(RVec3Arg location, String text, ConstColor color)
      Draw the specified 3-D text.
      Parameters:
      location - the location of the text (not null, unaffected)
      text - the text to display (not null)
      color - the desired text color (not null, unaffected, default=sWhite)
    • drawText3D

      public void drawText3D(RVec3Arg location, String text, ConstColor color, float height)
      Draw the specified 3-D text.
      Parameters:
      location - the location of the text (not null, unaffected)
      text - the text to display (not null)
      color - the desired text color (not null, unaffected, default=sWhite)
      height - the desired text height (default=0.5)
    • drawTriangle

      public void drawTriangle(RVec3Arg v1, RVec3Arg v2, RVec3Arg v3, ConstColor color)
      Draw the specified 3-D triangle.
      Parameters:
      v1 - the location of the first vertex (not null, unaffected)
      v2 - the location of the 2nd vertex (not null, unaffected)
      v3 - the location of the 3rd vertex (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawWireBox

      public void drawWireBox(ConstAaBox box, ConstColor color)
      Draw a wire-frame of the specified axis-aligned box.
      Parameters:
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawWireBox

      public void drawWireBox(ConstOrientedBox box, ConstColor color)
      Draw a wire-frame of the specified 3-D box.
      Parameters:
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawWireBox

      public void drawWireBox(RMat44Arg transform, ConstAaBox box, ConstColor color)
      Draw a wire frame of the specified 3-D box.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      box - the desired geometric properties (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawWirePolygon

      public void drawWirePolygon(RMat44Arg transform, VertexArray face, ConstColor color)
      Draw the outline of the specified polygon.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      face - the vertex coordinates (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawWirePolygon

      public void drawWirePolygon(RMat44Arg transform, VertexArray face, ConstColor color, float arrowSize)
      Draw the outline of the specified polygon.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      face - the vertex coordinates (not null, unaffected)
      color - the desired color (not null, unaffected)
      arrowSize - the desired size for arrows (default=0)
    • drawWireSphere

      public void drawWireSphere(RVec3Arg location, float radius, ConstColor color)
      Draw a wire frame of the specified sphere.
      Parameters:
      location - the location of the sphere's center (not null, unaffected)
      radius - the desired radius
      color - the desired color (not null, unaffected)
    • drawWireSphere

      public void drawWireSphere(RVec3Arg location, float radius, ConstColor color, int level)
      Draw a wire frame of the specified sphere.
      Parameters:
      location - the location of the sphere's center (not null, unaffected)
      radius - the desired radius
      color - the desired color (not null, unaffected)
      level - the desired level of detail (default=3)
    • drawWireTriangle

      public void drawWireTriangle(RVec3Arg v1, RVec3Arg v2, RVec3Arg v3, ConstColor color)
      Draw a wire frame of the specified 3-D triangle.
      Parameters:
      v1 - the location of the first vertex (not null, unaffected)
      v2 - the location of the 2nd vertex (not null, unaffected)
      v3 - the location of the 3rd vertex (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawWireUnitSphere

      public void drawWireUnitSphere(RMat44Arg transform, ConstColor color)
      Draw a wire frame of the specified unit sphere.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      color - the desired color (not null, unaffected)
    • drawWireUnitSphere

      public void drawWireUnitSphere(RMat44Arg transform, ConstColor color, int level)
      Draw a wire frame of the specified unit sphere.
      Parameters:
      transform - the desired coordinate transform (not null, unaffected)
      color - the desired color (not null, unaffected)
      level - the desired level of detail (default=3)
    • nextFrame

      public void nextFrame()
      Notify that the current frame is complete.
    • sInstance

      public static DebugRenderer sInstance()
      Access the instance from a static context.
      Returns:
      the pre-existing instance