//
// 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
{
///
///
/// Implementation of DebugRenderer that records the API invocations to be played back later
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:19
///
/// class JPH_DEBUG_RENDERER_EXPORT DebugRendererRecorder final : public DebugRenderer
///
///
[InteropHandle]
public readonly partial struct DebugRendererRecorder : IDisposable
{
///
///
/// Control commands written into the stream
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:39
///
/// enum class ECommand : uint8
///
///
public enum Command : byte
{
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:41
///
/// CreateBatch
///
///
CreateBatch,
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:42
///
/// CreateBatchIndexed
///
///
CreateBatchIndexed,
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:43
///
/// CreateGeometry
///
///
CreateGeometry,
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:44
///
/// EndFrame
///
///
EndFrame,
}
///
///
/// Holds a single line segment
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:48
///
/// struct LineBlob
///
///
[StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct LineBlob
{
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:50
///
/// RVec3 mFrom
///
///
[FieldOffset(0)]
public float3 From;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:51
///
/// RVec3 mTo
///
///
[FieldOffset(16)]
public float3 To;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:52
///
/// Color mColor
///
///
[FieldOffset(32)]
public uint Color;
}
///
///
/// Holds a single triangle
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:56
///
/// struct TriangleBlob
///
///
[StructLayout(LayoutKind.Explicit, Size = 64)]
public partial struct TriangleBlob
{
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:58
///
/// RVec3 mV1
///
///
[FieldOffset(0)]
public float3 V1;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:59
///
/// RVec3 mV2
///
///
[FieldOffset(16)]
public float3 V2;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:60
///
/// RVec3 mV3
///
///
[FieldOffset(32)]
public float3 V3;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:61
///
/// Color mColor
///
///
[FieldOffset(48)]
public uint Color;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:62
///
/// ECastShadow mCastShadow
///
///
[FieldOffset(52)]
public DebugRenderer.CastShadow CastShadow;
}
///
///
/// Holds a single geometry draw call
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:78
///
/// struct GeometryBlob
///
///
[StructLayout(LayoutKind.Explicit, Size = 96)]
public partial struct GeometryBlob
{
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:80
///
/// RMat44 mModelMatrix
///
///
[FieldOffset(0)]
public float4x4 ModelMatrix;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:81
///
/// Color mModelColor
///
///
[FieldOffset(64)]
public uint ModelColor;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:82
///
/// uint32 mGeometryID
///
///
[FieldOffset(68)]
public uint GeometryID;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:83
///
/// ECullMode mCullMode
///
///
[FieldOffset(72)]
public DebugRenderer.CullMode CullMode;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:84
///
/// ECastShadow mCastShadow
///
///
[FieldOffset(76)]
public DebugRenderer.CastShadow CastShadow;
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:85
///
/// EDrawMode mDrawMode
///
///
[FieldOffset(80)]
public DebugRenderer.DrawMode DrawMode;
}
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:25
///
/// DebugRendererRecorder(StreamOut &inStream)
///
///
public static DebugRendererRecorder Create(StreamOut stream) =>
Jolt.PInvoke.DebugRendererRecorder_Create(stream);
///
public void DrawLine(float3 from, float3 to, uint color) => ((DebugRenderer)this).DrawLine(from, to, color);
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:29
///
/// 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.DebugRendererRecorder_DrawTriangle(this, v1, v2, v3, color, castShadow);
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:33
///
/// virtual void DrawText3D(RVec3Arg inPosition, const string_view &inString, ColorArg inColor, float inHeight) override
///
///
public unsafe void DrawText3D(float3 position, RefString8 @string, uint color, float height)
{
fixed (byte* @string_fixed = @string)
{
Jolt.PInvoke.DebugRendererRecorder_DrawText3D(this, position, @string_fixed, color, height);
}
}
///
///
/// Mark the end of a frame
///
///
/// C++:
/// Jolt/Renderer/DebugRendererRecorder.h:36
///
/// void EndFrame()
///
///
public void EndFrame() => Jolt.PInvoke.DebugRendererRecorder_EndFrame(this);
public static implicit operator DebugRenderer(DebugRendererRecorder value) =>
Unsafe.BitCast(value);
public void Dispose() => Jolt.PInvoke.DebugRendererRecorder_Destroy(this);
///
public void NextFrame() => ((DebugRenderer)this).NextFrame();
///
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
);
}
}