the NewtonTreeCollisionEndBuild() crashes in 2.24 (it was okay in 2.09)
test code:
- Code: Select all
NewtonWorld *nWorld = NewtonCreate(/*NULL, NULL*/);
NewtonSetThreadsCount(nWorld, 2);
{
NewtonWorldCriticalSectionLock(nWorld);
NewtonCollision* collision = NewtonCreateTreeCollision(nWorld, roadID/*, NULL*/);
FILE* f = fopen("last_road_points", "r");
NewtonTreeCollisionBeginBuild(collision);
bool canRead = true;
float vArray[9];
printf("read points\n");
while (canRead)
{
for (int wi = 0; wi < 9 && canRead; wi++)
{
int ret = fscanf(f, "%f\n", &vArray[wi]);
if (ret < 1) canRead = false;
}
if (canRead)
{
NewtonTreeCollisionAddFace(collision, 3, (float*)vArray, 3 * sizeof(float), 1);
}
}
fclose(f);
printf("collisionendbuild\n");
NewtonTreeCollisionEndBuild(collision, 0);
printf("collisionendbuild done\n");
}
for the test the following file contains the test points:
http://bmw.homelinux.org/newton/last_road_points
Am i doing something wrong?