[ODE] Help using ODE with DirectX
Kaya Memisoglu
k.memisoglu at majix.de
Thu Aug 26 15:59:41 MST 2004
> for (int i = 0; i<numVertices; i++) {
> dVector3 temp;
> temp[0] = verticesDX[i]._x; //crashes here
> temp[1] = verticesDX[i]._y;
> temp[2] = verticesDX[i]._z;
> temp[3] = 0.0f;
> verticesODE = &temp;
> verticesODE++;
> }
Here seems to be the problem. dVector3 only has 3 entries, not four,
plus
you assign an address to the content at verticesODE. It should be
for (int i = 0; i<numVertices; i++) {
dVector3 temp;
temp[0] = verticesDX[i]._x; //crashes here
temp[1] = verticesDX[i]._y;
temp[2] = verticesDX[i]._z;
*verticesODE = temp;
verticesODE++;
}
or even simpler
for (int i = 0; i<numVertices; i++) {
dVector3 temp;
verticesODE[i][0] = verticesDX[i]._x; //crashes here
verticesODE[i][1] = verticesDX[i]._y;
verticesODE[i][2] = verticesDX[i]._z;
}
Kaya
More information about the ODE
mailing list