java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.DebugRenderer
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
DebugRendererRecorder
,DebugRendererSimple
Visualization for debugging purposes.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drawArrow
(RVec3Arg from, RVec3Arg to, ConstColor color, float size) Draw the specified 3-D arrow.void
drawBox
(ConstAaBox box, ConstColor color) Draw the specified axis-aligned 3-D box.void
drawBox
(ConstAaBox box, ConstColor color, ECastShadow castShadow) Draw the specified axis-aligned 3-D box.void
drawBox
(ConstAaBox box, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the specified axis-aligned 3-D box.void
drawBox
(RMat44Arg transform, ConstAaBox box, ConstColor color) Draw the specified 3-D box.void
drawBox
(RMat44Arg transform, ConstAaBox box, ConstColor color, ECastShadow castShadow) Draw the specified 3-D box.void
drawBox
(RMat44Arg transform, ConstAaBox box, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the specified 3-D box.void
drawCapsule
(RMat44Arg transform, float halfHeight, float radius, ConstColor color) Draw the specified capsule.void
drawCapsule
(RMat44Arg transform, float halfHeight, float radius, ConstColor color, ECastShadow castShadow) Draw the specified capsule.void
drawCapsule
(RMat44Arg transform, float halfHeight, float radius, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the specified capsule.void
drawCoordinateSystem
(RMat44Arg transform) Draw the specified 3-D coordinate axes.void
drawCoordinateSystem
(RMat44Arg transform, float size) Draw the specified 3-D coordinate axes.void
drawCylinder
(RMat44Arg transform, float halfHeight, float radius, ConstColor color) Draw the specified cylinder.void
drawCylinder
(RMat44Arg transform, float halfHeight, float radius, ConstColor color, ECastShadow castShadow) Draw the specified cylinder.void
drawCylinder
(RMat44Arg transform, float halfHeight, float radius, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the specified cylinder.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.void
drawGeometry
(RMat44Arg transform, ConstColor modelColor, GeometryRef geometry, ECullMode cullMode, ECastShadow castShadow, EDrawMode drawMode) Draw the specified geometry.void
drawLine
(RVec3Arg from, RVec3Arg to, ConstColor color) Draw the specified 3-D line.void
drawMarker
(RVec3Arg location, ConstColor color, float size) Draw a marker at the specified location.void
drawOpenCone
(RVec3Arg top, Vec3Arg axis, Vec3Arg perpendicular, float halfAngle, float length, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the specified open cone.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.void
drawPlane
(RVec3Arg location, Vec3Arg normal, ConstColor color, float size) Draw the specified plane.void
drawSphere
(RVec3Arg location, float radius, ConstColor color) Draw the specified sphere.void
drawSphere
(RVec3Arg location, float radius, ConstColor color, ECastShadow castShadow) Draw the specified sphere.void
drawSphere
(RVec3Arg location, float radius, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the specified sphere.void
drawSwingConeLimits
(RMat44Arg transform, float swingYHalfAngle, float swingZHalfAngle, float edgeLength, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the rotation-limits cone of aSwingTwistConstraintPart
.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 aSwingTwistConstraintPart
.void
drawTaperedCylinder
(RMat44Arg transform, float top, float bottom, float topRadius, float bottomRadius, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the specified tapered cylinder.void
drawText3D
(RVec3Arg location, String text) Draw the specified 3-D text.void
drawText3D
(RVec3Arg location, String text, ConstColor color) Draw the specified 3-D text.void
drawText3D
(RVec3Arg location, String text, ConstColor color, float height) Draw the specified 3-D text.void
drawTriangle
(RVec3Arg v1, RVec3Arg v2, RVec3Arg v3, ConstColor color) Draw the specified 3-D triangle.void
drawUnitSphere
(RMat44Arg transform, ConstColor color, ECastShadow castShadow, EDrawMode drawMode) Draw the specified unit sphere.void
drawWireBox
(ConstAaBox box, ConstColor color) Draw a wire-frame of the specified axis-aligned box.void
drawWireBox
(ConstOrientedBox box, ConstColor color) Draw a wire-frame of the specified 3-D box.void
drawWireBox
(RMat44Arg transform, ConstAaBox box, ConstColor color) Draw a wire frame of the specified 3-D box.void
drawWirePolygon
(RMat44Arg transform, VertexArray face, ConstColor color) Draw the outline of the specified polygon.void
drawWirePolygon
(RMat44Arg transform, VertexArray face, ConstColor color, float arrowSize) Draw the outline of the specified polygon.void
drawWireSphere
(RVec3Arg location, float radius, ConstColor color) Draw a wire frame of the specified sphere.void
drawWireSphere
(RVec3Arg location, float radius, ConstColor color, int level) Draw a wire frame of the specified sphere.void
drawWireTriangle
(RVec3Arg v1, RVec3Arg v2, RVec3Arg v3, ConstColor color) Draw a wire frame of the specified 3-D triangle.void
drawWireUnitSphere
(RMat44Arg transform, ConstColor color) Draw a wire frame of the specified unit sphere.void
drawWireUnitSphere
(RMat44Arg transform, ConstColor color, int level) Draw a wire frame of the specified unit sphere.void
Notify that the current frame is complete.static DebugRenderer
Access the instance from a static context.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
drawArrow
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
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
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
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
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
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
Draw the specified capsule.- Parameters:
transform
- the desired coordinate transform (not null, unaffected)halfHeight
- half the desired height of the cylindrical portionradius
- the desired radius of the capsulecolor
- 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 portionradius
- the desired radius of the capsulecolor
- 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 portionradius
- the desired radius of the capsulecolor
- 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
Draw the specified 3-D coordinate axes.- Parameters:
transform
- the desired coordinate transform (not null, unaffected)
-
drawCoordinateSystem
Draw the specified 3-D coordinate axes.- Parameters:
transform
- the desired coordinate transform (not null, unaffected)size
- the desired size (default=1)
-
drawCylinder
Draw the specified cylinder.- Parameters:
transform
- the desired coordinate transform (not null, unaffected)halfHeight
- half of the desired heightradius
- the desired radiuscolor
- 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 heightradius
- the desired radiuscolor
- 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 heightradius
- the desired radiuscolor
- 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 scalemodelColor
- 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
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 toaxis
(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
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
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
Draw the specified sphere.- Parameters:
location
- the location of the sphere's center (not null, unaffected)radius
- the desired radiuscolor
- the desired color (not null, unaffected)
-
drawSphere
Draw the specified sphere.- Parameters:
location
- the location of the sphere's center (not null, unaffected)radius
- the desired radiuscolor
- 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 radiuscolor
- 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 aSwingTwistConstraintPart
.- 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 conecolor
- 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 aSwingTwistConstraintPart
.- 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 pyramidcolor
- 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 topbottom
- the local Y coordinate of the center of the bottomtopRadius
- the radius of the topbottomRadius
- the radius of the bottomcolor
- 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
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
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
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
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
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
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
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
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
Draw a wire frame of the specified sphere.- Parameters:
location
- the location of the sphere's center (not null, unaffected)radius
- the desired radiuscolor
- the desired color (not null, unaffected)
-
drawWireSphere
Draw a wire frame of the specified sphere.- Parameters:
location
- the location of the sphere's center (not null, unaffected)radius
- the desired radiuscolor
- the desired color (not null, unaffected)level
- the desired level of detail (default=3)
-
drawWireTriangle
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
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
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
Access the instance from a static context.- Returns:
- the pre-existing instance
-