[ODE] Re: Trimesh again...
jmiles at pop.net
Wed Aug 4 16:05:41 MST 2004
Are you keeping the vertex data around after you submit it to
dGeomTriMeshDataBuildSimple()? The most common error here is to pass it the
address of data on the stack, or data that you free() after submitting it.
> 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] = g_Level.m_pVerts[p].vPosition.x;
> Vertices[p] = g_Level.m_pVerts[p].vPosition.y;
> Vertices[p] = g_Level.m_pVerts[p].vPosition.z;
> //Here Vertices[p] 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 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
> Enormous thanks in advance,
> Protect your PC - get McAfee.com VirusScan Online
> ODE mailing list
> ODE at q12.org
More information about the ODE