Ignore:
Timestamp:
Jul 9, 2012, 8:19:15 PM (8 years ago)
Author:
sam
Message:

test: fix physics cube backface culling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/BtPhysTest.cpp

    r1613 r1616  
    3333#endif
    3434
    35 #include <bullet/btBulletDynamicsCommon.h>
    36 #include <bullet/btBulletCollisionCommon.h>
    37 
    3835#include "core.h"
    3936#include "loldebug.h"
     
    294291                vec3 CenterToGround = GroundMat.v3.xyz - GroundBarycenter;
    295292                vec3 CenterToCam = m_camera->m_position - GroundBarycenter;
    296                 vec3 CamDir = m_camera->m_position - m_camera->GetTarget();
    297 
    298                 if (dot(normalize(CenterToGround), normalize(CenterToCam)) > .0f &&
    299                         dot(normalize(CenterToGround), normalize(CamDir)) > .0f)
     293
     294                if (dot(normalize(CenterToCam - CenterToGround),
     295                normalize(CenterToGround)) > 0.f)
    300296                        PhysObj->SetRender(false);
    301297                else
Note: See TracChangeset for help on using the changeset viewer.