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
drawerIDebugDrawercenterJVectoraxisJVectorreferenceJVectorfromJAngletoJAngleradiusfloatcoloruintsegmentsint
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
drawerIDebugDraweroriginJVectorvectorJVectorcoloruint
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
drawerIDebugDraweroriginJVectorvectorJVectorcoloruintsettingsDebugDrawSettings
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
drawerIDebugDrawercenterJVectoraxisJVectorreferenceJVectorradiusfloatcoloruintsegmentsint
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
drawerIDebugDraweroriginJVectoraxisJVectorreferenceJVectoralongReferenceJAnglealongPerpendicularJAngleradiusfloatcoloruintsegmentsintspokeOffsetint
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
drawerIDebugDrawercenterJVectororientationJQuaternion
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
drawerIDebugDrawercenterJVectororientationJQuaternionsettingsDebugDrawSettings
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
drawerIDebugDrawercenterJVectororientationJQuaternionsizefloatcoloruint
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
drawerIDebugDrawercenterJVectororientationJQuaternionsizefloatxColoruintyColoruintzColoruint
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
DrawPoint(IDebugDrawer, JVector, float, uint)
Draws a spherical point marker.
public static void DrawPoint(this IDebugDrawer drawer, JVector point, float radius, uint color)
Parameters
drawerIDebugDrawerThe debug drawer receiving the triangles.
pointJVectorThe center of the marker in world space.
radiusfloatThe sphere radius in world units. Must be finite and nonnegative.
coloruintThe 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
drawerIDebugDrawerfromJVectortoJVector
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
drawerIDebugDraweroriginJVectorvectorJVectorradiusfloatShaft radius in world units, clamped to 5% of the arrow length and half the head's base radius. Must be finite and nonnegative.
coloruintsegmentsintNumber 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
drawerIDebugDrawercenterJVectorradiusfloatcoloruintsegmentsint
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
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
drawerIDebugDrawercenterJVectoraxisJVectorsizefloatcoloruint
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
drawerIDebugDraweroriginJVectorvectorJVectorcoloruintsegmentsintNumber 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
drawerIDebugDrawercenterJVectororientationJQuaternionsizefloatcoloruintsegmentsintNumber 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
drawerIDebugDrawercenterJVectororientationJQuaternionsizefloatxColoruintColor of the local X axis, packed as
0xRRGGBBAA.yColoruintColor of the local Y axis, packed as
0xRRGGBBAA.zColoruintColor of the local Z axis, packed as
0xRRGGBBAA.segmentsintNumber of segments around each arrowhead base, from 3 to 4096. Default is 12.