[ODE] Re: Trimesh again...

srednA XnejX styggsomfan at hotmail.com
Wed Aug 4 14:19:53 MST 2004


Hi again.

I have continued to search for the answer why my objects only collide
with the ground in my bsp level. after much debugging i have found out
that the dGeomTriMeshDataBuildSimple() function alters the values i give it. 
For some reason it sets all the y-values that i give it to 264, which is the 
first vertex's y-value.

Now, I am 100% positively sure that not all y-values are 264 from the start 
( that level would look quite wierd if it was so) when they are given to 
that function. So, what could this be?
I suspect the error lies in how i send the params, but how? The code is 
basically the test_trimesh.cpp but adapted for quake 3 levels.

Here is the code section:

for(int p=0;p<g_Level.m_numOfVerts;p++)
{
  Vertices[p][0] = g_Level.m_pVerts[p].vPosition.x;
  Vertices[p][1] = g_Level.m_pVerts[p].vPosition.y;
  Vertices[p][2] = g_Level.m_pVerts[p].vPosition.z;
  //Here Vertices[p][1] has the correct values!
}

Indices = new int[g_Level.m_iNumIndex];
for(int n=0;n<g_Level.m_iNumIndex;n++)
{
  Indices[n] = g_Level.m_piIndexArray[n];
}

dGeomTriMeshDataBuildSimple(Data, (dReal*)Vertices, g_Level.m_numOfVerts, 
Indices, g_Level.m_iNumIndex);
TriMesh = dCreateTriMesh(space, Data, 0, 0, 0);
// Here, every Vertices[][1] are 264 !!

Note that the x and z values are still correct, it just changes every 
y-value to 264. Has anyone else experienced this, or has any ideas why it 
happens?

Enormous thanks in advance,
Anders

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



More information about the ODE mailing list