Table of Contents

Class DebugDrawGeometry

Namespace
Jitter2
Assembly
Jitter2.dll

Renderer-independent drawing geometry emitted through IDebugDrawer.

public static class DebugDrawGeometry
Inheritance
DebugDrawGeometry
Inherited Members

Remarks

Directions must be finite and nonzero. Reference directions are projected onto the drawing plane.

Methods

DrawArc(IDebugDrawer, JVector, JVector, JVector, JAngle, JAngle, float, uint, int)

Draws a circular arc. Angles are measured from the reference direction around the axis.

public static void DrawArc(this IDebugDrawer drawer, JVector center, JVector axis, JVector reference, JAngle from, JAngle to, float radius, uint color, int segments = 48)

Parameters

drawer IDebugDrawer
center JVector
axis JVector
reference JVector
from JAngle
to JAngle
radius float
color uint
segments int

DrawArrow(IDebugDrawer, JVector, JVector, uint)

Draws an arrow using the default visualization settings.

public static void DrawArrow(this IDebugDrawer drawer, JVector origin, JVector vector, uint color)

Parameters

drawer IDebugDrawer
origin JVector
vector JVector
color uint

DrawArrow(IDebugDrawer, JVector, JVector, uint, in DebugDrawSettings)

Draws an arrow using the settings' style, shaft thickness, arrowhead size, and detail.

public static void DrawArrow(this IDebugDrawer drawer, JVector origin, JVector vector, uint color, in DebugDrawSettings settings)

Parameters

drawer IDebugDrawer
origin JVector
vector JVector
color uint
settings DebugDrawSettings

DrawCircle(IDebugDrawer, JVector, JVector, JVector, float, uint, int)

Draws a circle in the plane perpendicular to the axis.

public static void DrawCircle(this IDebugDrawer drawer, JVector center, JVector axis, JVector reference, float radius, uint color, int segments = 48)

Parameters

drawer IDebugDrawer
center JVector
axis JVector
reference JVector
radius float
color uint
segments int

DrawCone(IDebugDrawer, JVector, JVector, JVector, JAngle, JAngle, float, uint, int, int)

Draws an elliptical cone on a sphere, using angular radii along two perpendicular directions.

public static void DrawCone(this IDebugDrawer drawer, JVector origin, JVector axis, JVector reference, JAngle alongReference, JAngle alongPerpendicular, float radius, uint color, int segments = 48, int spokeOffset = 0)

Parameters

drawer IDebugDrawer
origin JVector
axis JVector
reference JVector
alongReference JAngle
alongPerpendicular JAngle
radius float
color uint
segments int
spokeOffset int

DrawFrame(IDebugDrawer, JVector, JQuaternion)

Draws the three axes of an orientation using the default visualization settings.

public static void DrawFrame(this IDebugDrawer drawer, JVector center, JQuaternion orientation)

Parameters

drawer IDebugDrawer
center JVector
orientation JQuaternion

DrawFrame(IDebugDrawer, JVector, JQuaternion, in DebugDrawSettings)

Draws an orientation frame using the settings' frame size, axis colors, and arrowhead detail. Axis length uses FrameSize; shaft radius and arrowhead size stay fixed in world units.

public static void DrawFrame(this IDebugDrawer drawer, JVector center, JQuaternion orientation, in DebugDrawSettings settings)

Parameters

drawer IDebugDrawer
center JVector
orientation JQuaternion
settings DebugDrawSettings

DrawFrame(IDebugDrawer, JVector, JQuaternion, float, uint)

Draws an orientation frame with the requested size and a single color.

public static void DrawFrame(this IDebugDrawer drawer, JVector center, JQuaternion orientation, float size, uint color)

Parameters

drawer IDebugDrawer
center JVector
orientation JQuaternion
size float
color uint

DrawFrame(IDebugDrawer, JVector, JQuaternion, float, uint, uint, uint)

Draws an orientation frame with the requested size and axis colors.

public static void DrawFrame(this IDebugDrawer drawer, JVector center, JQuaternion orientation, float size, uint xColor, uint yColor, uint zColor)

Parameters

drawer IDebugDrawer
center JVector
orientation JQuaternion
size float
xColor uint
yColor uint
zColor uint

DrawPlane(IDebugDrawer, JVector, JVector, JVector, float, uint)

Draws a finite grid representing an infinite plane.

public static void DrawPlane(this IDebugDrawer drawer, JVector center, JVector normal, JVector reference, float halfExtent, uint color)

Parameters

drawer IDebugDrawer
center JVector
normal JVector
reference JVector
halfExtent float
color uint

DrawPoint(IDebugDrawer, JVector, float, uint)

Draws a spherical point marker.

public static void DrawPoint(this IDebugDrawer drawer, JVector point, float radius, uint color)

Parameters

drawer IDebugDrawer

The debug drawer receiving the triangles.

point JVector

The center of the marker in world space.

radius float

The sphere radius in world units. Must be finite and nonnegative.

color uint

The color packed as 0xRRGGBBAA.

Remarks

A zero radius draws nothing.

DrawSegment(IDebugDrawer, in JVector, in JVector)

Draws a white line segment between two points in world space.

public static void DrawSegment(this IDebugDrawer drawer, in JVector from, in JVector to)

Parameters

drawer IDebugDrawer
from JVector
to JVector

DrawSolidArrow(IDebugDrawer, JVector, JVector, float, uint, int)

Draws a closed solid arrow with a cylindrical shaft and a cone head.

public static void DrawSolidArrow(this IDebugDrawer drawer, JVector origin, JVector vector, float radius, uint color, int segments = 12)

Parameters

drawer IDebugDrawer
origin JVector
vector JVector
radius float

Shaft radius in world units, clamped to 5% of the arrow length and half the head's base radius. Must be finite and nonnegative.

color uint
segments int

Number of sides around the shaft and head, from 3 to 4096. Default is 12.

Remarks

Triangles face outward so the arrow can be rendered with back-face culling. Zero-radius and very short arrows are represented by a segment.

DrawSphere(IDebugDrawer, JVector, float, uint, int)

Draws three perpendicular great circles.

public static void DrawSphere(this IDebugDrawer drawer, JVector center, float radius, uint color, int segments = 48)

Parameters

drawer IDebugDrawer
center JVector
radius float
color uint
segments int

DrawSpring(IDebugDrawer, JVector, JVector, ref JVector, float, uint, int)

Draws a spring. Keep a separate reference direction for each spring and pass it back on each call to keep the coil's orientation continuous as the anchors move.

public static void DrawSpring(this IDebugDrawer drawer, JVector from, JVector to, ref JVector reference, float radius, uint color, int segments = 96)

Parameters

drawer IDebugDrawer
from JVector
to JVector
reference JVector
radius float
color uint
segments int

DrawStop(IDebugDrawer, JVector, JVector, float, uint)

Draws a cross perpendicular to an axis, for marking a linear stop.

public static void DrawStop(this IDebugDrawer drawer, JVector center, JVector axis, float size, uint color)

Parameters

drawer IDebugDrawer
center JVector
axis JVector
size float
color uint

DrawWireArrow(IDebugDrawer, JVector, JVector, uint, int)

Draws a wire arrow using the default arrowhead size, with every base vertex connected to the tip.

public static void DrawWireArrow(this IDebugDrawer drawer, JVector origin, JVector vector, uint color, int segments = 12)

Parameters

drawer IDebugDrawer
origin JVector
vector JVector
color uint
segments int

Number of segments around the head's base, from 3 to 4096. Default is 12.

DrawWireFrame(IDebugDrawer, JVector, JQuaternion, float, uint, int)

Draws a wire orientation frame with a single color.

public static void DrawWireFrame(this IDebugDrawer drawer, JVector center, JQuaternion orientation, float size, uint color, int segments = 12)

Parameters

drawer IDebugDrawer
center JVector
orientation JQuaternion
size float
color uint
segments int

Number of segments around each arrowhead base, from 3 to 4096. Default is 12.

DrawWireFrame(IDebugDrawer, JVector, JQuaternion, float, uint, uint, uint, int)

Draws a wire orientation frame with a separate color for each local axis. The colors follow the axes as the orientation changes.

public static void DrawWireFrame(this IDebugDrawer drawer, JVector center, JQuaternion orientation, float size, uint xColor, uint yColor, uint zColor, int segments = 12)

Parameters

drawer IDebugDrawer
center JVector
orientation JQuaternion
size float
xColor uint

Color of the local X axis, packed as 0xRRGGBBAA.

yColor uint

Color of the local Y axis, packed as 0xRRGGBBAA.

zColor uint

Color of the local Z axis, packed as 0xRRGGBBAA.

segments int

Number of segments around each arrowhead base, from 3 to 4096. Default is 12.