//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// Simple triangle renderer for debugging purposes.
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:46
///
/// class JPH_DEBUG_RENDERER_EXPORT DebugRenderer : public NonCopyable
///
///
///
///
/// Simple triangle renderer for debugging purposes.
///
/// Inherit from this class to provide your own implementation.
///
/// Implement the following virtual functions:
/// - DrawLine
/// - DrawTriangle
/// - DrawText3D
/// - CreateTriangleBatch
/// - DrawGeometry
///
/// Make sure you call Initialize() from the constructor of your implementation.
///
/// The CreateTriangleBatch is used to prepare a batch of triangles to be drawn by a single DrawGeometry call,
/// which means that Jolt can render a complex scene much more efficiently than when each triangle in that scene would have been drawn through DrawTriangle.
///
/// Note that an implementation that implements CreateTriangleBatch and DrawGeometry is provided by DebugRendererSimple which can be used to start quickly.
///
///
[InteropHandle]
public readonly partial struct DebugRenderer
{
///
///
/// Enum that determines if a shadow should be cast or not
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:90
///
/// enum class ECastShadow
///
///
public enum CastShadow : int
{
///
///
/// This shape should cast a shadow
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:92
///
/// On
///
///
On,
///
///
/// This shape should not cast a shadow
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:93
///
/// Off
///
///
Off,
}
///
///
/// Determines how triangles are drawn
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:97
///
/// enum class EDrawMode
///
///
public enum DrawMode : int
{
///
///
/// Draw as a solid shape
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:99
///
/// Solid
///
///
Solid,
///
///
/// Draw as wireframe
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:100
///
/// Wireframe
///
///
Wireframe,
}
///
///
/// Determines which polygons are culled
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:265
///
/// enum class ECullMode
///
///
public enum CullMode : int
{
///
///
/// Don't draw backfacing polygons
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:267
///
/// CullBackFace
///
///
CullBackFace,
///
///
/// Don't draw front facing polygons
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:268
///
/// CullFrontFace
///
///
CullFrontFace,
///
///
/// Don't do culling and draw both sides
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:269
///
/// Off
///
///
Off,
}
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:317
///
/// struct SwingConeLimits
///
///
[StructLayout(LayoutKind.Explicit, Size = 8)]
public partial struct SwingConeLimits
{
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:325
///
/// float mSwingYHalfAngle
///
///
[FieldOffset(0)]
public float SwingYHalfAngle;
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:326
///
/// float mSwingZHalfAngle
///
///
[FieldOffset(4)]
public float SwingZHalfAngle;
}
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:335
///
/// struct SwingPyramidLimits
///
///
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct SwingPyramidLimits
{
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:345
///
/// float mMinSwingYAngle
///
///
[FieldOffset(0)]
public float MinSwingYAngle;
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:346
///
/// float mMaxSwingYAngle
///
///
[FieldOffset(4)]
public float MaxSwingYAngle;
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:347
///
/// float mMinSwingZAngle
///
///
[FieldOffset(8)]
public float MinSwingZAngle;
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:348
///
/// float mMaxSwingZAngle
///
///
[FieldOffset(12)]
public float MaxSwingZAngle;
}
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:361
///
/// struct TaperedCylinder
///
///
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct TaperedCylinder
{
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:371
///
/// float mTop
///
///
[FieldOffset(0)]
public float Top;
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:372
///
/// float mBottom
///
///
[FieldOffset(4)]
public float Bottom;
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:373
///
/// float mTopRadius
///
///
[FieldOffset(8)]
public float TopRadius;
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:374
///
/// float mBottomRadius
///
///
[FieldOffset(12)]
public float BottomRadius;
}
///
///
/// Call once after frame is complete. Releases unused dynamically generated geometry assets.
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:56
///
/// void NextFrame()
///
///
public void NextFrame() => Jolt.PInvoke.DebugRenderer_NextFrame(this);
///
///
/// Draw line
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:59
///
/// virtual void DrawLine(RVec3Arg inFrom, RVec3Arg inTo, ColorArg inColor) = 0
///
///
public void DrawLine(float3 from, float3 to, uint color) =>
Jolt.PInvoke.DebugRenderer_DrawLine(this, from, to, color);
///
///
/// Draw wireframe box
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:62
///
/// void DrawWireBox(const AABox &inBox, ColorArg inColor)
///
///
public void DrawWireBox(in AABox box, uint color) =>
Jolt.PInvoke.DebugRenderer_DrawWireBox(this, in box, color);
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:63
///
/// void DrawWireBox(const OrientedBox &inBox, ColorArg inColor)
///
///
public void DrawWireBox(OrientedBox box, uint color) =>
Jolt.PInvoke.DebugRenderer_DrawWireBox_2(this, box, color);
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:64
///
/// void DrawWireBox(RMat44Arg inMatrix, const AABox &inBox, ColorArg inColor)
///
///
public void DrawWireBox(in float4x4 matrix, in AABox box, uint color) =>
Jolt.PInvoke.DebugRenderer_DrawWireBox_3(this, in matrix, in box, color);
///
///
/// Draw a marker on a position
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:67
///
/// void DrawMarker(RVec3Arg inPosition, ColorArg inColor, float inSize)
///
///
public void DrawMarker(float3 position, uint color, float size) =>
Jolt.PInvoke.DebugRenderer_DrawMarker(this, position, color, size);
///
///
/// Draw an arrow
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:70
///
/// void DrawArrow(RVec3Arg inFrom, RVec3Arg inTo, ColorArg inColor, float inSize)
///
///
public void DrawArrow(float3 from, float3 to, uint color, float size) =>
Jolt.PInvoke.DebugRenderer_DrawArrow(this, from, to, color, size);
///
///
/// Draw coordinate system (3 arrows, x = red, y = green, z = blue)
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:73
///
/// void DrawCoordinateSystem(RMat44Arg inTransform, float inSize = 1.0f)
///
///
public void DrawCoordinateSystem(in float4x4 transform, float size = 1f) =>
Jolt.PInvoke.DebugRenderer_DrawCoordinateSystem(this, in transform, size);
///
///
/// Draw a plane through inPoint with normal inNormal
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:76
///
/// void DrawPlane(RVec3Arg inPoint, Vec3Arg inNormal, ColorArg inColor, float inSize)
///
///
public void DrawPlane(float3 point, float3 normal, uint color, float size) =>
Jolt.PInvoke.DebugRenderer_DrawPlane(this, point, normal, color, size);
///
///
/// Draw wireframe triangle
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:79
///
/// void DrawWireTriangle(RVec3Arg inV1, RVec3Arg inV2, RVec3Arg inV3, ColorArg inColor)
///
///
public void DrawWireTriangle(float3 v1, float3 v2, float3 v3, uint color) =>
Jolt.PInvoke.DebugRenderer_DrawWireTriangle(this, v1, v2, v3, color);
///
///
/// Draw wireframe sphere
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:86
///
/// void DrawWireSphere(RVec3Arg inCenter, float inRadius, ColorArg inColor, int inLevel = 3)
///
///
public void DrawWireSphere(float3 center, float radius, uint color, int level = 3) =>
Jolt.PInvoke.DebugRenderer_DrawWireSphere(this, center, radius, color, level);
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:87
///
/// void DrawWireUnitSphere(RMat44Arg inMatrix, ColorArg inColor, int inLevel = 3)
///
///
public void DrawWireUnitSphere(in float4x4 matrix, uint color, int level = 3) =>
Jolt.PInvoke.DebugRenderer_DrawWireUnitSphere(this, in matrix, color, level);
///
///
/// Draw a single back face culled triangle
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:104
///
/// virtual void DrawTriangle(RVec3Arg inV1, RVec3Arg inV2, RVec3Arg inV3, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::Off) = 0
///
///
public void DrawTriangle(
float3 v1,
float3 v2,
float3 v3,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.Off
) => Jolt.PInvoke.DebugRenderer_DrawTriangle(this, v1, v2, v3, color, castShadow);
///
///
/// Draw a box
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:107
///
/// void DrawBox(const AABox &inBox, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
public void DrawBox(
in AABox box,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => Jolt.PInvoke.DebugRenderer_DrawBox(this, in box, color, castShadow, drawMode);
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:108
///
/// void DrawBox(RMat44Arg inMatrix, const AABox &inBox, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
public void DrawBox(
in float4x4 matrix,
in AABox box,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => Jolt.PInvoke.DebugRenderer_DrawBox_2(this, in matrix, in box, color, castShadow, drawMode);
///
///
/// Draw a sphere
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:111
///
/// void DrawSphere(RVec3Arg inCenter, float inRadius, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
public void DrawSphere(
float3 center,
float radius,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => Jolt.PInvoke.DebugRenderer_DrawSphere(this, center, radius, color, castShadow, drawMode);
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:112
///
/// void DrawUnitSphere(RMat44Arg inMatrix, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
public void DrawUnitSphere(
in float4x4 matrix,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => Jolt.PInvoke.DebugRenderer_DrawUnitSphere(this, in matrix, color, castShadow, drawMode);
///
///
/// Draw a capsule with one half sphere at (0, -inHalfHeightOfCylinder, 0) and the other half sphere at (0,
/// inHalfHeightOfCylinder, 0) and radius inRadius. The capsule will be transformed by inMatrix.
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:116
///
/// void DrawCapsule(RMat44Arg inMatrix, float inHalfHeightOfCylinder, float inRadius, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
public void DrawCapsule(
in float4x4 matrix,
float halfHeightOfCylinder,
float radius,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) =>
Jolt.PInvoke.DebugRenderer_DrawCapsule(
this,
in matrix,
halfHeightOfCylinder,
radius,
color,
castShadow,
drawMode
);
///
///
/// Draw a cylinder with top (0, inHalfHeight, 0) and bottom (0, -inHalfHeight, 0) and radius inRadius. The
/// cylinder will be transformed by inMatrix
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:120
///
/// void DrawCylinder(RMat44Arg inMatrix, float inHalfHeight, float inRadius, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
public void DrawCylinder(
in float4x4 matrix,
float halfHeight,
float radius,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => Jolt.PInvoke.DebugRenderer_DrawCylinder(this, in matrix, halfHeight, radius, color, castShadow, drawMode);
///
///
/// Draw a bottomless cone.
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:131
///
/// void DrawOpenCone(RVec3Arg inTop, Vec3Arg inAxis, Vec3Arg inPerpendicular, float inHalfAngle, float inLength, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
///
///
/// Draw a bottomless cone.
/// @param inTop Top of cone, center of base is at inTop + inAxis.
/// @param inAxis Height and direction of cone
/// @param inPerpendicular Perpendicular vector to inAxis.
/// @param inHalfAngle Specifies the cone angle in radians (angle measured between inAxis and cone surface).
/// @param inLength The length of the cone.
/// @param inColor Color to use for drawing the cone.
/// @param inCastShadow determines if this geometry should cast a shadow or not.
/// @param inDrawMode determines if we draw the geometry solid or in wireframe.
///
///
public void DrawOpenCone(
float3 top,
float3 axis,
float3 perpendicular,
float halfAngle,
float length,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) =>
Jolt.PInvoke.DebugRenderer_DrawOpenCone(
this,
top,
axis,
perpendicular,
halfAngle,
length,
color,
castShadow,
drawMode
);
///
///
/// Draws cone rotation limits as used by the SwingTwistConstraintPart.
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:141
///
/// void DrawSwingConeLimits(RMat44Arg inMatrix, float inSwingYHalfAngle, float inSwingZHalfAngle, float inEdgeLength, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
///
///
/// Draws cone rotation limits as used by the SwingTwistConstraintPart.
/// @param inMatrix Matrix that transforms from constraint space to world space
/// @param inSwingYHalfAngle See SwingTwistConstraintPart
/// @param inSwingZHalfAngle See SwingTwistConstraintPart
/// @param inEdgeLength Size of the edge of the cone shape
/// @param inColor Color to use for drawing the cone.
/// @param inCastShadow determines if this geometry should cast a shadow or not.
/// @param inDrawMode determines if we draw the geometry solid or in wireframe.
///
///
public void DrawSwingConeLimits(
in float4x4 matrix,
float swingYHalfAngle,
float swingZHalfAngle,
float edgeLength,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) =>
Jolt.PInvoke.DebugRenderer_DrawSwingConeLimits(
this,
in matrix,
swingYHalfAngle,
swingZHalfAngle,
edgeLength,
color,
castShadow,
drawMode
);
///
///
/// Draws rotation limits as used by the SwingTwistConstraintPart.
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:153
///
/// void DrawSwingPyramidLimits(RMat44Arg inMatrix, float inMinSwingYAngle, float inMaxSwingYAngle, float inMinSwingZAngle, float inMaxSwingZAngle, float inEdgeLength, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
///
///
/// Draws rotation limits as used by the SwingTwistConstraintPart.
/// @param inMatrix Matrix that transforms from constraint space to world space
/// @param inMinSwingYAngle See SwingTwistConstraintPart
/// @param inMaxSwingYAngle See SwingTwistConstraintPart
/// @param inMinSwingZAngle See SwingTwistConstraintPart
/// @param inMaxSwingZAngle See SwingTwistConstraintPart
/// @param inEdgeLength Size of the edge of the cone shape
/// @param inColor Color to use for drawing the cone.
/// @param inCastShadow determines if this geometry should cast a shadow or not.
/// @param inDrawMode determines if we draw the geometry solid or in wireframe.
///
///
public void DrawSwingPyramidLimits(
in float4x4 matrix,
float minSwingYAngle,
float maxSwingYAngle,
float minSwingZAngle,
float maxSwingZAngle,
float edgeLength,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) =>
Jolt.PInvoke.DebugRenderer_DrawSwingPyramidLimits(
this,
in matrix,
minSwingYAngle,
maxSwingYAngle,
minSwingZAngle,
maxSwingZAngle,
edgeLength,
color,
castShadow,
drawMode
);
///
///
/// Draw a pie (part of a circle).
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:165
///
/// void DrawPie(RVec3Arg inCenter, float inRadius, Vec3Arg inNormal, Vec3Arg inAxis, float inMinAngle, float inMaxAngle, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
///
///
/// Draw a pie (part of a circle).
/// @param inCenter The center of the circle.
/// @param inRadius Radius of the circle.
/// @param inNormal The plane normal in which the pie resides.
/// @param inAxis The axis that defines an angle of 0 radians.
/// @param inMinAngle The pie will be drawn between [inMinAngle, inMaxAngle] (in radians).
/// @param inMaxAngle The pie will be drawn between [inMinAngle, inMaxAngle] (in radians).
/// @param inColor Color to use for drawing the pie.
/// @param inCastShadow determines if this geometry should cast a shadow or not.
/// @param inDrawMode determines if we draw the geometry solid or in wireframe.
///
///
public void DrawPie(
float3 center,
float radius,
float3 normal,
float3 axis,
float minAngle,
float maxAngle,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) =>
Jolt.PInvoke.DebugRenderer_DrawPie(
this,
center,
radius,
normal,
axis,
minAngle,
maxAngle,
color,
castShadow,
drawMode
);
///
///
/// Draw a tapered cylinder
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:176
///
/// void DrawTaperedCylinder(RMat44Arg inMatrix, float inTop, float inBottom, float inTopRadius, float inBottomRadius, ColorArg inColor, ECastShadow inCastShadow = ECastShadow::On, EDrawMode inDrawMode = EDrawMode::Solid)
///
///
///
///
/// Draw a tapered cylinder
/// @param inMatrix Matrix that transforms the cylinder to world space.
/// @param inTop Top of cylinder (along Y axis)
/// @param inBottom Bottom of cylinder (along Y axis)
/// @param inTopRadius Radius at the top
/// @param inBottomRadius Radius at the bottom
/// @param inColor Color to use for drawing the pie.
/// @param inCastShadow determines if this geometry should cast a shadow or not.
/// @param inDrawMode determines if we draw the geometry solid or in wireframe.
///
///
public void DrawTaperedCylinder(
in float4x4 matrix,
float top,
float bottom,
float topRadius,
float bottomRadius,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) =>
Jolt.PInvoke.DebugRenderer_DrawTaperedCylinder(
this,
in matrix,
top,
bottom,
topRadius,
bottomRadius,
color,
castShadow,
drawMode
);
///
///
/// Draw text
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:285
///
/// virtual void DrawText3D(RVec3Arg inPosition, const string_view &inString, ColorArg inColor = Color::sWhite, float inHeight = 0.5f) = 0
///
///
public unsafe void DrawText3D(float3 position, RefString8 @string, uint color, float height = 0.5f)
{
fixed (byte* @string_fixed = @string)
{
Jolt.PInvoke.DebugRenderer_DrawText3D(this, position, @string_fixed, color, height);
}
}
///
///
/// Singleton instance
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:179
///
/// static DebugRenderer * sInstance
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public static DebugRenderer GetInstance() => Jolt.PInvoke.DebugRenderer_GetInstance();
///
///
/// Singleton instance
///
///
/// C++:
/// Jolt/Renderer/DebugRenderer.h:179
///
/// static DebugRenderer * sInstance
///
///
public static void SetInstance(DebugRenderer value) => Jolt.PInvoke.DebugRenderer_SetInstance(value);
}
}