diff options
author | Daniel Stokes <kupomail@gmail.com> | 2013-07-26 03:42:20 +0400 |
---|---|---|
committer | Daniel Stokes <kupomail@gmail.com> | 2013-07-26 03:42:20 +0400 |
commit | 4f8fd8c68bc4d833f48e8e67ca583b496d0c125b (patch) | |
tree | 960ce51a6916b6195a927aee9ba6a75bdc08fbe5 /source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | |
parent | 09a9aa5720d71fdc6118bf0bcdce53def3f027d0 (diff) |
BGE Fix [#18804] Shadow type faces cast onto invisible faces (non-GLSL)
Changing the RayHit method to ignore invisible faces
Diffstat (limited to 'source/gameengine/GamePlayer/common/GPC_RenderTools.cpp')
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 70a05f7425b..e8c29d5aa4f 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -37,6 +37,7 @@ #include "RAS_LightObject.h" #include "RAS_ICanvas.h" #include "RAS_GLExtensionManager.h" +#include "RAS_MeshObject.h" #include "KX_GameObject.h" #include "KX_PolygonMaterial.h" @@ -166,6 +167,11 @@ void GPC_RenderTools::SetClientObject(RAS_IRasterizer *rasty, void* obj) bool GPC_RenderTools::RayHit(KX_ClientObjectInfo *client, KX_RayCast *result, void * const data) { double* const oglmatrix = (double* const) data; + + RAS_Polygon* poly = result->m_hitMesh->GetPolygon(result->m_hitPolygon); + if (!poly->IsVisible()) + return false; + MT_Point3 resultpoint(result->m_hitPoint); MT_Vector3 resultnormal(result->m_hitNormal); MT_Vector3 left(oglmatrix[0],oglmatrix[1],oglmatrix[2]); |