From b7ab11200abd60d098a7561767d687ae8960ea94 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 9 Jul 2012 18:19:15 +0000 Subject: [PATCH] test: fix physics cube backface culling. --- test/BtPhysTest.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/BtPhysTest.cpp b/test/BtPhysTest.cpp index ff31da0c..e85e4fe5 100644 --- a/test/BtPhysTest.cpp +++ b/test/BtPhysTest.cpp @@ -32,9 +32,6 @@ # include #endif -#include -#include - #include "core.h" #include "loldebug.h" @@ -293,10 +290,9 @@ void BtPhysTest::TickGame(float seconds) mat4 GroundMat = PhysObj->GetTransform(); vec3 CenterToGround = GroundMat.v3.xyz - GroundBarycenter; vec3 CenterToCam = m_camera->m_position - GroundBarycenter; - vec3 CamDir = m_camera->m_position - m_camera->GetTarget(); - if (dot(normalize(CenterToGround), normalize(CenterToCam)) > .0f && - dot(normalize(CenterToGround), normalize(CamDir)) > .0f) + if (dot(normalize(CenterToCam - CenterToGround), + normalize(CenterToGround)) > 0.f) PhysObj->SetRender(false); else PhysObj->SetRender(true);