[ODE] Trimesh collision (Terrain)
Jon Watte (ODE)
hplus-ode at mindcontrol.org
Tue Aug 23 20:04:41 MST 2005
ODE does not copy the data. You cannot delete/free the data you pass to
the ODE triangle mesh, as long as that mesh is alive.
If you're not freeing it, and it still goes bad, then set a data
breakpoint at something that goes bad, and the debugger will show you
who writes there.
Cheers,
/ h+
matt stephure wrote:
> Sorry for the spam...
>
> I've recoded my terrain generation loop to be about 5 lines. Much
> simpler. I've gone through the vertices and indices with pencil and
> paper and they all look right.
>
> The problem I'm having now, is that the vertices seem to get all
> messed up when I pass it into ODE.
>
> Just before the dGeomTriMeshBuildSimple they're just fine. The
> original data used to create the array remains fine, I'm printing it
> out at every time step. But the vertex data I'm getting from
> dGeomTriMeshGetTriangle is mostly wrong. Each value (x,y,z) is either
> 0, or 1265.15 -- instead of something in the rate {-2,2}. Seems to be
> that I'm having a pointer error. Could anything else be wrong?
>
> The format of the vertex data is
> for (build_vertices)
> {
> GLfloat * pos;
> pos = new GLfloat[3];
> pos[0] = value_x;
> pos[1] = value_y;
> pos[2] = value_z;
>
> terrainVertices[vertex_count] = pos;
> vertex_count++;
> }
>
> Appreciate the help! :) Sorry again for the spam.
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>
More information about the ODE
mailing list