diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-04 13:34:02 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-04 13:34:02 +0400 |
commit | f03fa79d28a112c39fcbab5d71b952333dc66fac (patch) | |
tree | 349af2572f240d3b78312cf7f28d0d949e10f8a5 /source/gameengine/Rasterizer/RAS_MeshObject.h | |
parent | 79f3e880217215d5af09a9083f868ce7b80baaa5 (diff) |
Fix for bug #945 getVertexArrayLength(x) returns different values on different runs of the game engine.
http://projects.blender.org/tracker/index.php?func=detail&aid=945&group_id=9&atid=125
The material buckets were being sorted by pointer (ie their location in memory.)
Also fixed find shared verticies.
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_MeshObject.h')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_MeshObject.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index 87a5e6be77c..78e142fda8a 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -41,10 +41,14 @@ #include <set> #include "RAS_Polygon.h" +#include "RAS_MaterialBucket.h" #include "MT_Transform.h" #include "GEN_HashedPtr.h" +/** + * This class holds an array of vertices and indicies. + */ class KX_ArrayOptimizer { public: @@ -63,6 +67,9 @@ public: int m_index1; }; +/** + * This struct holds a triangle. + */ struct RAS_TriangleIndex { public: @@ -72,6 +79,11 @@ public: bool m_collider; }; +/** + * This class looks horribly broken. Only m_matid is used, and + * m_matid is a (int) RAS_IPolyMaterial*. + * --> m_matid == lhs.m_matid should be *m_matid == *lhs.m_matid + */ class RAS_MatArrayIndex { public: @@ -124,9 +136,8 @@ class RAS_MeshObject protected: GEN_Map<class RAS_IPolyMaterial,KX_ArrayOptimizer*> m_matVertexArrayS; - typedef set<class RAS_MaterialBucket*> BucketMaterialSet; - BucketMaterialSet m_materials; + RAS_MaterialBucket::Set m_materials; public: // for now, meshes need to be in a certain layer (to avoid sorting on lights in realtime) RAS_MeshObject(int lightlayer); @@ -178,8 +189,8 @@ public: void ClearArrayData(); - BucketMaterialSet::iterator GetFirstMaterial(); - BucketMaterialSet::iterator GetLastMaterial(); + RAS_MaterialBucket::Set::iterator GetFirstMaterial(); + RAS_MaterialBucket::Set::iterator GetLastMaterial(); virtual RAS_TexVert* GetVertex( short array, |