Some defines

This commit is contained in:
JackCarterSmith 2024-12-01 11:49:36 +01:00
parent debc5b219b
commit ecaccfd0e0
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24

View File

@ -3,7 +3,8 @@
#include "../World/DbgCube.hpp"
#include "../World/Tank.hpp"
//#define DISABLE_INVISIBLE_VERTICES
//#define DISABLE_AABB_CLIPPING
//#define DISABLE_TRIANGLE_CLIPPING
// Rendering pipeline:
@ -113,7 +114,7 @@ void Graphic3DRenderer::Draw(sf::RenderTexture& context) {
// Object outside frustrum clipping
projAABB.Transform(projAABB, oTMat);
M3D_ContainmentType objInFrustrum = camFrustrum.Contains(projAABB);
#ifndef DISABLE_INVISIBLE_VERTICES
#ifndef DISABLE_AABB_CLIPPING
if (objInFrustrum != DISJOINT)
#endif
{
@ -140,10 +141,12 @@ void Graphic3DRenderer::Draw(sf::RenderTexture& context) {
break;
// Triangle clipping
//TODO: scissor/clipping depending of how many vertices are outside/inside the clipspace, implement complete Cohen-Sutherland algo or similar
#ifndef DISABLE_TRIANGLE_CLIPPING
//TODO: scissor/clipping depending of how many vertices are outside/inside the clipspace, implement complete Cohen-Sutherland algo or CyrusBeck one
if (VertexClipTest(projVertices[indicePtr[i]], mRTSize, 2.5f) &&
VertexClipTest(projVertices[indicePtr[i+1]], mRTSize, 2.5f) &&
VertexClipTest(projVertices[indicePtr[i+2]], mRTSize, 2.5f))
#endif
{
M3D_VECTOR V1 = M3D_V4LoadF4(&projVertices[indicePtr[i]]);