7#ifndef JPH_DEBUG_RENDERER
8 #error This file should only be included when JPH_DEBUG_RENDERER is defined
31 virtual Batch
CreateTriangleBatch(
const Vertex *inVertices,
int inVertexCount,
const uint32 *inIndices,
int inIndexCount)
override;
32 virtual void DrawGeometry(
RMat44Arg inModelMatrix,
const AABox &inWorldSpaceBounds,
float inLODScaleSq,
ColorArg inModelColor,
const GeometryRef &inGeometry, ECullMode inCullMode, ECastShadow inCastShadow, EDrawMode inDrawMode)
override;
69 TextBlob(
RVec3Arg inPosition,
const string_view &inString,
ColorArg inColor,
float inHeight) : mPosition(inPosition), mString(inString), mColor(inColor), mHeight(inHeight) { }
104 BatchImpl(
uint32 inID) : mID(inID) { }
106 virtual void AddRef()
override { ++mRefCount; }
107 virtual void Release()
override {
if (--mRefCount == 0)
delete this; }
109 atomic<uint32> mRefCount = 0;
121 uint32 mNextGeometryID = 1;
std::uint8_t uint8
Definition Core.h:482
#define JPH_NAMESPACE_END
Definition Core.h:414
std::uint32_t uint32
Definition Core.h:484
#define JPH_NAMESPACE_BEGIN
Definition Core.h:408
#define JPH_DEBUG_RENDERER_EXPORT
Definition DebugRenderer.h:13
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:31
std::basic_string< char, std::char_traits< char >, STLAllocator< char > > String
Definition STLAllocator.h:107
Axis aligned box.
Definition AABox.h:16
Class that holds an RGBA color with 8-bits per component.
Definition Color.h:16
Definition DebugRenderer.h:47
virtual void DrawText3D(RVec3Arg inPosition, const string_view &inString, ColorArg inColor=Color::sWhite, float inHeight=0.5f)=0
Draw text.
void Initialize()
Initialize the system, must be called from the constructor of the DebugRenderer implementation.
Definition DebugRenderer.cpp:463
ECullMode
Determines which polygons are culled.
Definition DebugRenderer.h:265
virtual Batch CreateTriangleBatch(const Triangle *inTriangles, int inTriangleCount)=0
Create a batch of triangles that can be drawn efficiently.
virtual void DrawGeometry(RMat44Arg inModelMatrix, const AABox &inWorldSpaceBounds, float inLODScaleSq, ColorArg inModelColor, const GeometryRef &inGeometry, ECullMode inCullMode=ECullMode::CullBackFace, ECastShadow inCastShadow=ECastShadow::On, EDrawMode inDrawMode=EDrawMode::Solid)=0
ECastShadow
Enum that determines if a shadow should be cast or not.
Definition DebugRenderer.h:91
EDrawMode
Determines how triangles are drawn.
Definition DebugRenderer.h:98
virtual void DrawLine(RVec3Arg inFrom, RVec3Arg inTo, ColorArg inColor)=0
Draw line.
virtual void DrawTriangle(RVec3Arg inV1, RVec3Arg inV2, RVec3Arg inV3, ColorArg inColor, ECastShadow inCastShadow=ECastShadow::Off)=0
Draw a single back face culled triangle.
Implementation of DebugRenderer that records the API invocations to be played back later.
Definition DebugRendererRecorder.h:20
ECommand
Control commands written into the stream.
Definition DebugRendererRecorder.h:40
JPH_OVERRIDE_NEW_DELETE DebugRendererRecorder(StreamOut &inStream)
Constructor.
Definition DebugRendererRecorder.h:25
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
Pure virtual version of RefTarget.
Definition Reference.h:88
Simple binary output stream.
Definition StreamOut.h:13
A simple triangle and its material.
Definition Triangle.h:11
Definition UnorderedMap.h:30
All information for a single frame.
Definition DebugRendererRecorder.h:90
Array< LineBlob > mLines
Definition DebugRendererRecorder.h:91
Array< TextBlob > mTexts
Definition DebugRendererRecorder.h:93
Array< GeometryBlob > mGeometries
Definition DebugRendererRecorder.h:94
Array< TriangleBlob > mTriangles
Definition DebugRendererRecorder.h:92
Holds a single geometry draw call.
Definition DebugRendererRecorder.h:79
EDrawMode mDrawMode
Definition DebugRendererRecorder.h:85
uint32 mGeometryID
Definition DebugRendererRecorder.h:82
ECullMode mCullMode
Definition DebugRendererRecorder.h:83
ECastShadow mCastShadow
Definition DebugRendererRecorder.h:84
Color mModelColor
Definition DebugRendererRecorder.h:81
RMat44 mModelMatrix
Definition DebugRendererRecorder.h:80
Holds a single line segment.
Definition DebugRendererRecorder.h:49
RVec3 mTo
Definition DebugRendererRecorder.h:51
RVec3 mFrom
Definition DebugRendererRecorder.h:50
Color mColor
Definition DebugRendererRecorder.h:52
Holds a single text entry.
Definition DebugRendererRecorder.h:67
String mString
Definition DebugRendererRecorder.h:72
float mHeight
Definition DebugRendererRecorder.h:74
TextBlob(RVec3Arg inPosition, const string_view &inString, ColorArg inColor, float inHeight)
Definition DebugRendererRecorder.h:69
Color mColor
Definition DebugRendererRecorder.h:73
RVec3 mPosition
Definition DebugRendererRecorder.h:71
Holds a single triangle.
Definition DebugRendererRecorder.h:57
RVec3 mV1
Definition DebugRendererRecorder.h:58
Color mColor
Definition DebugRendererRecorder.h:61
RVec3 mV3
Definition DebugRendererRecorder.h:60
ECastShadow mCastShadow
Definition DebugRendererRecorder.h:62
RVec3 mV2
Definition DebugRendererRecorder.h:59