BGE Fix [#18804] Shadow type faces cast onto invisible faces (non-GLSL)

Changing the RayHit method to ignore invisible faces
This commit is contained in:
Daniel Stokes 2013-07-25 23:42:20 +00:00
parent 09a9aa5720
commit 4f8fd8c68b
2 changed files with 12 additions and 0 deletions

@ -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"
@ -157,6 +158,11 @@ void KX_BlenderRenderTools::SetClientObject(RAS_IRasterizer *rasty, void* obj)
bool KX_BlenderRenderTools::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]);

@ -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]);