diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2011-01-23 20:17:21 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2011-01-23 20:17:21 +0300 |
commit | fc66b3f2efcb5b7579f06c1966900b2ecf3c1310 (patch) | |
tree | 029fa673af575ff1f3fce63e49c29fa2359be360 /source/gameengine/Ketsji | |
parent | fa38da021cd08409f1bda4722a6cf8a607f86838 (diff) |
BGE: support modifiers without mapping to original mesh both graphically and physically, fixes bug #24942 and #25286.
Support for physics is done by skiping the modifiers that
don't support mapping to original mesh. This mapping is
required to report the hit polygon to the application
by the rayCast() function.
Support for graphics is done by using the same render
function that blender uses for the 3D view. This guantees
equal result.
Limitation: there is still a known bug if all these conditions are met:
- Display list enabled
- Old tex face with a several textures mapped to the same material
- no armature or shape keys
- active modifiers
In this case, only a part of the mesh will be rendered
with the wrong texture. To avoid this bug, use the GLSL
materials or make sure to have 1 material=1 texture in
your old tex face objects.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 5 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PolygonMaterial.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 57e11e02d5a..1f4a3491695 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -108,6 +108,11 @@ KX_PolygonMaterial::~KX_PolygonMaterial() #endif // WITH_PYTHON } +Image *KX_PolygonMaterial::GetBlenderImage() const +{ + return (m_tface) ? m_tface->tpage : NULL; +} + bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const { bool dopass = false; diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 17adbac79c0..d71a34989a0 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -42,6 +42,7 @@ struct MTFace; struct Material; struct MTex; +struct Image; /** * Material class. @@ -107,6 +108,8 @@ public: return m_material; } + Image *GetBlenderImage() const; + /** * Returns the Blender texture face structure that is used for this material. * @return The material's texture face. |