diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-05-25 18:37:39 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-05-25 18:37:39 +0400 |
commit | da1f38f99d3b8a07ed4ddd905f8e7d7c6e25f945 (patch) | |
tree | 71add2281425519cfd2c06e8d3d6e67cae2b83a7 /source/gameengine/GamePlayer/common | |
parent | f680b56ebfc1415334598e619ec9310ccce472c2 (diff) |
Apply BGE patch 11137: Render objects with negative scaling correctly (as in Blender)
Diffstat (limited to 'source/gameengine/GamePlayer/common')
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 16 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index edda7657ef9..885981a2898 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -462,6 +462,22 @@ int GPC_RenderTools::applyLights(int objectlayer) } +void GPC_RenderTools::SetClientObject(void* obj) +{ + if (m_clientobject != obj) + { + if (obj == NULL || !((KX_GameObject*)obj)->IsNegativeScaling()) + { + glFrontFace(GL_CCW); + } else + { + glFrontFace(GL_CW); + } + m_clientobject = obj; + m_modified = true; + } +} + bool GPC_RenderTools::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data) { double* const oglmatrix = (double* const) data; diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.h b/source/gameengine/GamePlayer/common/GPC_RenderTools.h index 9b86869af73..ee0212da643 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.h +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.h @@ -153,6 +153,8 @@ public: virtual void Render2DFilters(RAS_ICanvas* canvas); + virtual void SetClientObject(void* obj); + protected: /** * Copied from KX_BlenderGL.cpp in KX_blenderhook |