updated drawmodes and rendering

DebugDraw for recast now caches the results
We now have a drawmode dropdown selector
drawmode changes come from the gui itself no longer from console values
all recast drawmodes are supported with the exception of drawmodes that add abilities like navqueries until the nav tester tool is imlpemented.
This commit is contained in:
marauder2k7 2025-07-24 14:25:02 +01:00
parent 30b9502e90
commit d1771756c2
12 changed files with 548 additions and 53 deletions

View file

@ -40,6 +40,10 @@
#include "gfx/gfxVertexBuffer.h"
#endif
#ifndef _SCENERENDERSTATE_H_
#include "scene/sceneRenderState.h"
#endif
/**
* @class duDebugDrawTorque
* @brief Implements the duDebugDraw interface in Torque.
@ -99,17 +103,29 @@ public:
/// End drawing primitives.
void end() override;
void clearCache();
void render(SceneRenderState* state);
private:
struct CachedDraw {
GFXPrimitiveType primType;
GFXVertexBufferHandle<GFXVertexPCT> buffer;
GFXPrimitiveBufferHandle primitiveBuffer;
U32 vertexCount;
U32 primitiveCount;
GFXStateBlockDesc state;
Box3F bounds;
};
Vector<CachedDraw> mDrawCache;
GFXStateBlockDesc mDesc;
Vector<GFXVertexPCT> mVertList; // Our vertex list for setting up vertexBuffer in the End function.
GFXVertexBufferHandle<GFXVertexPCT> mVertexBuffer; // our vertex buffer for drawing.
U32 mPrimType;
bool mQuadsMode;
U32 mVertCount;
F32 mStore[3][3];
void _vertex(const float x, const float y, const float z, unsigned int color);
};