Procházet zdrojové kódy

Fixed typo in comment and added fallback DrawTriangle

Jorrit Rouwe před 1 rokem
rodič
revize
bc9f6665c9
1 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 9 1
      Jolt/Renderer/DebugRendererSimple.h

+ 9 - 1
Jolt/Renderer/DebugRendererSimple.h

@@ -22,7 +22,7 @@ JPH_NAMESPACE_BEGIN
 ///				// Implement
 ///			}
 ///
-///			virtual void DrawTriangle(JPH::RVec3Arg inV1, JPH::RVec3Arg inV2, JPH::RVec3Arg inV3, JPH::ColorArg inColor, JPH::ECastShadow inCastShadow) override
+///			virtual void DrawTriangle(JPH::RVec3Arg inV1, JPH::RVec3Arg inV2, JPH::RVec3Arg inV3, JPH::ColorArg inColor, ECastShadow inCastShadow) override
 ///			{
 ///				// Implement
 ///			}
@@ -50,6 +50,14 @@ public:
 		mCameraPosSet = true;
 	}
 
+	/// Fallback implementation that uses DrawLine to draw a triangle (override this if you have a version that renders solid triangles)
+	virtual void				DrawTriangle(RVec3Arg inV1, RVec3Arg inV2, RVec3Arg inV3, ColorArg inColor, ECastShadow inCastShadow) override
+	{
+		DrawLine(inV1, inV2, inColor);
+		DrawLine(inV2, inV3, inColor);
+		DrawLine(inV3, inV1, inColor);
+	}
+
 protected:
 	/// Implementation of DebugRenderer interface
 	virtual Batch				CreateTriangleBatch(const Triangle *inTriangles, int inTriangleCount) override;