//
// 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
{
///
///
/// Inherit from this class to simplify implementing a debug renderer, start with this implementation:
///
///
/// C++:
/// Jolt/Renderer/DebugRendererSimple.h:37
///
/// class JPH_DEBUG_RENDERER_EXPORT DebugRendererSimple : public DebugRenderer
///
///
///
///
/// Inherit from this class to simplify implementing a debug renderer, start with this implementation:
///
/// class MyDebugRenderer : public JPH::DebugRendererSimple
/// {
/// public:
/// virtual void DrawLine(JPH::RVec3Arg inFrom, JPH::RVec3Arg inTo, JPH::ColorArg inColor) override
/// {
/// // Implement
/// }
///
/// virtual void DrawTriangle(JPH::RVec3Arg inV1, JPH::RVec3Arg inV2, JPH::RVec3Arg inV3, JPH::ColorArg inColor, ECastShadow inCastShadow) override
/// {
/// // Implement
/// }
///
/// virtual void DrawText3D(JPH::RVec3Arg inPosition, const string_view &inString, JPH::ColorArg inColor, float inHeight) override
/// {
/// // Implement
/// }
/// };
///
/// Note that this class is meant to be a quick start for implementing a debug renderer, it is not the most efficient way to implement a debug renderer.
///
///
[InteropHandle]
public readonly partial struct DebugRendererSimple
{
///
///
/// Should be called every frame by the application to provide the camera position. This is used to
/// determine the correct LOD for rendering.
///
///
/// C++:
/// Jolt/Renderer/DebugRendererSimple.h:47
///
/// void SetCameraPos(RVec3Arg inCameraPos)
///
///
public void SetCameraPos(float3 cameraPos) => Jolt.PInvoke.DebugRendererSimple_SetCameraPos(this, cameraPos);
///
///
/// Fallback implementation that uses DrawLine to draw a triangle (override this if you have a version that
/// renders solid triangles)
///
///
/// C++:
/// Jolt/Renderer/DebugRendererSimple.h:54
///
/// virtual void DrawTriangle(RVec3Arg inV1, RVec3Arg inV2, RVec3Arg inV3, ColorArg inColor, ECastShadow inCastShadow) override
///
///
public void DrawTriangle(float3 v1, float3 v2, float3 v3, uint color, DebugRenderer.CastShadow castShadow) =>
Jolt.PInvoke.DebugRendererSimple_DrawTriangle(this, v1, v2, v3, color, castShadow);
public static implicit operator DebugRenderer(DebugRendererSimple value) =>
Unsafe.BitCast(value);
///
public void NextFrame() => ((DebugRenderer)this).NextFrame();
///
public void DrawLine(float3 from, float3 to, uint color) => ((DebugRenderer)this).DrawLine(from, to, color);
///
public void DrawWireBox(in AABox box, uint color) => ((DebugRenderer)this).DrawWireBox(in box, color);
///
public void DrawWireBox(OrientedBox box, uint color) => ((DebugRenderer)this).DrawWireBox(box, color);
///
public void DrawWireBox(in float4x4 matrix, in AABox box, uint color) =>
((DebugRenderer)this).DrawWireBox(in matrix, in box, color);
///
public void DrawMarker(float3 position, uint color, float size) =>
((DebugRenderer)this).DrawMarker(position, color, size);
///
public void DrawArrow(float3 from, float3 to, uint color, float size) =>
((DebugRenderer)this).DrawArrow(from, to, color, size);
///
public void DrawCoordinateSystem(in float4x4 transform, float size = 1f) =>
((DebugRenderer)this).DrawCoordinateSystem(in transform, size);
///
public void DrawPlane(float3 point, float3 normal, uint color, float size) =>
((DebugRenderer)this).DrawPlane(point, normal, color, size);
///
public void DrawWireTriangle(float3 v1, float3 v2, float3 v3, uint color) =>
((DebugRenderer)this).DrawWireTriangle(v1, v2, v3, color);
///
public void DrawWireSphere(float3 center, float radius, uint color, int level = 3) =>
((DebugRenderer)this).DrawWireSphere(center, radius, color, level);
///
public void DrawWireUnitSphere(in float4x4 matrix, uint color, int level = 3) =>
((DebugRenderer)this).DrawWireUnitSphere(in matrix, color, level);
///
public void DrawBox(
in AABox box,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => ((DebugRenderer)this).DrawBox(in box, color, castShadow, drawMode);
///
public void DrawBox(
in float4x4 matrix,
in AABox box,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => ((DebugRenderer)this).DrawBox(in matrix, in box, color, castShadow, drawMode);
///
public void DrawSphere(
float3 center,
float radius,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => ((DebugRenderer)this).DrawSphere(center, radius, color, castShadow, drawMode);
///
public void DrawUnitSphere(
in float4x4 matrix,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => ((DebugRenderer)this).DrawUnitSphere(in matrix, color, castShadow, drawMode);
///
public void DrawCapsule(
in float4x4 matrix,
float halfHeightOfCylinder,
float radius,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => ((DebugRenderer)this).DrawCapsule(in matrix, halfHeightOfCylinder, radius, color, castShadow, drawMode);
///
public void DrawCylinder(
in float4x4 matrix,
float halfHeight,
float radius,
uint color,
DebugRenderer.CastShadow castShadow = DebugRenderer.CastShadow.On,
DebugRenderer.DrawMode drawMode = DebugRenderer.DrawMode.Solid
) => ((DebugRenderer)this).DrawCylinder(in matrix, halfHeight, radius, color, castShadow, drawMode);
///
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
) =>
((DebugRenderer)this).DrawOpenCone(
top,
axis,
perpendicular,
halfAngle,
length,
color,
castShadow,
drawMode
);
///
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
) =>
((DebugRenderer)this).DrawSwingConeLimits(
in matrix,
swingYHalfAngle,
swingZHalfAngle,
edgeLength,
color,
castShadow,
drawMode
);
///
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
) =>
((DebugRenderer)this).DrawSwingPyramidLimits(
in matrix,
minSwingYAngle,
maxSwingYAngle,
minSwingZAngle,
maxSwingZAngle,
edgeLength,
color,
castShadow,
drawMode
);
///
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
) =>
((DebugRenderer)this).DrawPie(
center,
radius,
normal,
axis,
minAngle,
maxAngle,
color,
castShadow,
drawMode
);
///
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
) =>
((DebugRenderer)this).DrawTaperedCylinder(
in matrix,
top,
bottom,
topRadius,
bottomRadius,
color,
castShadow,
drawMode
);
///
public unsafe void DrawText3D(float3 position, RefString8 @string, uint color, float height = 0.5f) =>
((DebugRenderer)this).DrawText3D(position, @string, color, height);
}
}