Revision: 672
http://hgengine.svn.sourceforge.net/hgengine/?rev=672&view=rev
Author: axlecrusher
Date: 2010-02-23 01:08:42 +0000 (Tue, 23 Feb 2010)
Log Message:
-----------
terrain vertices need to load 3 vertices from the file and w needs to be 0.
not load 4 (xyzw) from the file, this will read outside the array
Modified Paths:
--------------
Mercury2/modules/Terrain.cpp
Modified: Mercury2/modules/Terrain.cpp
===================================================================
--- Mercury2/modules/Terrain.cpp 2010-01-18 13:26:25 UTC (rev 671)
+++ Mercury2/modules/Terrain.cpp 2010-02-23 01:08:42 UTC (rev 672)
@@ -15,8 +15,8 @@
void Terrain::LoadedCallback()
{
+ BuildHash();
base::LoadedCallback();
- BuildHash();
}
void Terrain::BuildHash()
@@ -60,9 +60,9 @@
for(uint16_t i = 0; i < length; i+=3)
{
- MercuryVertex v1(vertice+(indice[i]*HGMDLMesh::STRIDE));
- MercuryVertex v2(vertice+(indice[i+1]*HGMDLMesh::STRIDE));
- MercuryVertex v3(vertice+(indice[i+2]*HGMDLMesh::STRIDE));
+ MercuryVertex v1(vertice+(indice[i]*HGMDLMesh::STRIDE), 0);
+ MercuryVertex v2(vertice+(indice[i+1]*HGMDLMesh::STRIDE), 0);
+ MercuryVertex v3(vertice+(indice[i+2]*HGMDLMesh::STRIDE), 0);
MTriangle t( v1, v2, v3 );
m_hash.Insert( v1.GetX(), v1.GetY(), v1.GetZ(), t );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|