Class DebugRenderer

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

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)
    • drawGeometry

      public void drawGeometry(RMat44Arg transform, ConstColor modelColor, GeometryRef geometry, ECullMode cullMode, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified geometry.
      Parameters:
      transform - to transform the geometry to world space (not null, unaffected)
      modelColor - the desired color (not null, unaffected)
      geometry - the geometry to draw (not null, unaffected)
      cullMode - the desired culling mode for polygons (not null)
      castShadow - the desired shadow mode (not null, default=On)
      drawMode - the desired draw mode (not null, default=Solid)
    • drawGeometry

      public void drawGeometry(RMat44Arg transform, ConstAaBox worldSpaceBounds, float lodScaleSq, ConstColor modelColor, GeometryRef geometry, ECullMode cullMode, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified geometry with the specified bounds and scaling.
      Parameters:
      transform - to transform the geometry to world space (not null, unaffected)
      worldSpaceBounds - the bounds of the region to render (not null, unaffected)
      lodScaleSq - the square of the level-of-detail scale
      modelColor - the desired color (not null, unaffected)
      geometry - the geometry to draw (not null, unaffected)
      cullMode - the desired culling mode for polygons (not null)
      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)
    • drawOpenCone

      public void drawOpenCone(RVec3Arg top, Vec3Arg axis, Vec3Arg perpendicular, float halfAngle, float length, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified open cone.
      Parameters:
      top - the desired location of the cone's vertex (not null, unaffected)
      axis - the desired offset of the center of the base, relative to the vertex (not null, unaffected)
      perpendicular - a vector perpendicular to axis (not null, unaffected)
      halfAngle - the desired angle between the axis and the surface of the code (in radians)
      length - the desired length of the cone (in meters)
      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)
    • 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
    • drawPie

      public void drawPie(RVec3Arg center, float radius, Vec3Arg normal, Vec3Arg axis, float minAngle, float maxAngle, ConstColor color, ECastShadow castShadow)
      Draw the specified sector of a circle.
      Parameters:
      center - the desired location of the circle's center (not null, unaffected)
      radius - the desired radius of the circle (in meters)
      normal - a normal to the plane that contains the desired circle (not null, unaffected)
      axis - the desired zero-angle direction (not null, unaffected)
      minAngle - the desired angle where the sector begins (in radians)
      maxAngle - the desired angle where the sector ends (in radians)
      color - the desired color (not null, unaffected)
      castShadow - the desired shadow mode (not null, default=On)
    • 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)
    • drawSwingConeLimits

      public void drawSwingConeLimits(RMat44Arg transform, float swingYHalfAngle, float swingZHalfAngle, float edgeLength, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the rotation-limits cone of a SwingTwistConstraintPart.
      Parameters:
      transform - the desired transform from constraint coordinates to system coordinates (not null, unaffected)
      swingYHalfAngle - half the desired Y-axis swing-angle limit (in radians)
      swingZHalfAngle - half the desired Z-axis swing-angle limit (in radians)
      edgeLength - the desired length of the edges of the cone
      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)
    • drawSwingPyramidLimits

      public void drawSwingPyramidLimits(RMat44Arg transform, float minSwingYAngle, float maxSwingYAngle, float minSwingZAngle, float maxSwingZAngle, float edgeLength, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the rotation-limits pyramid of a SwingTwistConstraintPart.
      Parameters:
      transform - the desired transform from constraint coordinates to system coordinates (not null, unaffected)
      minSwingYAngle - the desired Y-axis swing-angle lower limit (in radians)
      maxSwingYAngle - the desired Y-axis swing-angle upper limit (in radians)
      minSwingZAngle - the desired Z-axis swing-angle lower limit (in radians)
      maxSwingZAngle - the desired Z-axis swing-angle upper limit (in radians)
      edgeLength - the desired length of the edges of the pyramid
      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)
    • drawTaperedCylinder

      public void drawTaperedCylinder(RMat44Arg transform, float top, float bottom, float topRadius, float bottomRadius, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified tapered cylinder.
      Parameters:
      transform - the desired transform from local coordinates to system coordinates (not null, unaffected)
      top - the local Y coordinate of the center of the top
      bottom - the local Y coordinate of the center of the bottom
      topRadius - the radius of the top
      bottomRadius - the radius of the bottom
      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. (native method: DrawText3D)
      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. (native method: DrawText3D)
      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. (native method: DrawText3D)
      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)
    • drawUnitSphere

      public void drawUnitSphere(RMat44Arg transform, ConstColor color, ECastShadow castShadow, EDrawMode drawMode)
      Draw the specified unit sphere.
      Parameters:
      transform - the desired transform from local to system coordinates (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)
    • 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