diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-11-22 14:49:35 +0300 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-11-22 14:49:35 +0300 |
commit | 1092b98337621a58c679de2a6657fd929dc8cb53 (patch) | |
tree | eb9ffff2413d9384be089c9a77cdeb4832cc2e76 /source/gameengine/Rasterizer | |
parent | 39022ffb88ea97667d1f0f23d7730ee62f427b31 (diff) |
Fix for bug 1600: alpha sort doesn't work on linked (alt-d) objects
Diffstat (limited to 'source/gameengine/Rasterizer')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_MaterialBucket.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/RAS_MeshObject.cpp | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index efd3a491784..f2dc7535010 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -201,8 +201,14 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa /* __NLA Do the deformation */ if (ms.m_pDeformer) + { ms.m_pDeformer->Apply(m_material); + // KX_ReInstanceShapeFromMesh(ms.m_mesh); // Recompute the physics mesh. (Can't call KX_* from RAS_) + } /* End __NLA */ + + if (rasty->GetDrawingMode() >= RAS_IRasterizer::KX_SOLID) + ms.m_mesh->SortPolygons(cameratrans*MT_Transform(ms.m_OpenGLMatrix)); rendertools->PushMatrix(); rendertools->applyTransform(rasty,ms.m_OpenGLMatrix,m_material->GetDrawingMode()); diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index bfc4c3012c3..a28cbac2580 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -596,6 +596,9 @@ struct RAS_MeshObject::fronttoback void RAS_MeshObject::SortPolygons(const MT_Transform &transform) { + if (!m_zsort) + return; + // Extract camera Z plane... const MT_Vector3 pnorm(transform.getBasis()[2]); const MT_Scalar pval = transform.getOrigin()[2]; @@ -665,6 +668,7 @@ void RAS_MeshObject::SchedulePolygons(const MT_Transform &transform, int drawing ,poly->GetMaterial()->GetPolyMaterial()); } + m_zsort = false; } else { @@ -683,9 +687,4 @@ void RAS_MeshObject::SchedulePolygons(const MT_Transform &transform, int drawing m_bModified = false; } - - if (m_zsort && drawingmode >= RAS_IRasterizer::KX_SOLID) - { - SortPolygons(transform); - } } |