so i changed your newton_addstaticcollisiongeometry() to

Code:
 
void newton_addstaticcollisiongeometry()
{
NewtonCollision* treecollision = NewtonCreateTreeCollision(nworld, 0);
NewtonTreeCollisionBeginBuild(treecollision);

you = ent_next(0);
while(you != 0)
{
if(you.flags & FLAG8)
{
newton_treecollisionaddentity(treecollision, you);
}
you = ent_next(you);
}

int i = 0;
LPD3DXMESH pmesh = (LPD3DXMESH)ent_getmesh(NULL, i, 0);
while(pmesh)
{
// add the triangles of the mesh to newton here
int numvertices = pmesh->GetNumVertices();
int numfaces = pmesh->GetNumFaces();

_VERTEX_ *pvertices; pmesh->LockVertexBuffer(0, (void**)&pvertices);
short *pindices; pmesh->LockIndexBuffer(0, (void**)&pindices);
int *pattributes; pmesh->LockAttributeBuffer(0, &pattributes);

D3DXVECTOR4 *ptransformedvertices = (D3DXVECTOR4*)malloc(sizeof(D3DXVECTOR4) * numvertices);
D3DXMATRIX m; ent_getmatrix(pmesh, &m);
D3DXVECTOR3 tempvector;
int i;
for(i = 0; i < numvertices; i++)
{
tempvector.x = pvertices[i].x;
tempvector.y = pvertices[i].z;
tempvector.z = pvertices[i].y;
D3DXVec3Transform(&ptransformedvertices[i], &tempvector, &m);
}

for(i = 0; i < numfaces; i++)
{
float v[9];
v[0] = ptransformedvertices[pindices[(i*3)+2]].x * QUANTTOMETER;
v[1] = ptransformedvertices[pindices[(i*3)+2]].y * QUANTTOMETER;
v[2] = ptransformedvertices[pindices[(i*3)+2]].z * QUANTTOMETER;
v[3] = ptransformedvertices[pindices[(i*3)+1]].x * QUANTTOMETER;
v[4] = ptransformedvertices[pindices[(i*3)+1]].y * QUANTTOMETER;
v[5] = ptransformedvertices[pindices[(i*3)+1]].z * QUANTTOMETER;
v[6] = ptransformedvertices[pindices[(i*3)+0]].x * QUANTTOMETER;
v[7] = ptransformedvertices[pindices[(i*3)+0]].y * QUANTTOMETER;
v[8] = ptransformedvertices[pindices[(i*3)+0]].z * QUANTTOMETER;
NewtonTreeCollisionAddFace(treecollision, 3, v, 12, pattributes[i]);
}


free(ptransformedvertices);

pmesh->UnlockVertexBuffer();
pmesh->UnlockIndexBuffer();
pmesh->UnlockAttributeBuffer();

i++;
pmesh = (LPD3DXMESH)ent_getmesh(NULL, i, 0);
}


NewtonTreeCollisionEndBuild(treecollision, 0);
NewtonBody* level = NewtonCreateBody(nworld, treecollision);
NewtonReleaseCollision(nworld, treecollision);

NewtonSetWorldSize(nworld, vectorf(-1000, -1000, -1000), vectorf(1000, 1000, 1000)); // todo: make size dependent on tree collision bounding box
}



but blocks are still ignored... maybe i forget something?...


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro