Moderator: Alain
Delfi wrote:You are doing it wrong, do it in this order:
1. NewtonCreateTreeCollision
2. NewtonTreeCollisionBeginBuild
3. NewtonTreeCollisionAddFace (for each face)
4. NewtonTreeCollisionEndBuild (finalize and optimize the mesh shape)
there is an error in the session parameters same for NewtonTreeCollisionEndBuild and NewtonTreeCollisionAddFace ...
coimbra79 wrote:Delfi wrote:You are doing it wrong, do it in this order:
I certainly something wrong, I need your help, because the tests I've run do not work
I also read your other discussions on the subject, but I still have some questions eg:
void NewtonTreeCollisionAddFace (treeCollision, vertexCount, vertexPtr , strideInBytes, faceAttribute);
for vertPointer is good a structure like this?
VertArray(totVertexzInCurrentFace).Vertex(3) ... where ...
VertArray(0).Vertex(0) = 1st vertex x coo in current Face
VertArray(0).Vertex(1) = 1st vertex y coo in current Face
VertArray(0).Vertex(2) = 1st vertex z coo in current Face
- - -
VertArray(1).Vertex(0) = 2nd vertex x coo in current Face
VertArray(1).Vertex(1) = 2nd vertex y coo in current Face
VertArray(1).Vertex(2) = 2nd vertex z coo in current Face
- - - etc...
very tnks!
____________________________________________________________
'loadedMap is an object whit an array of face containing pointers to vertex array into object (coiAxis*)
map = NewtonCreateTreeCollision(NW, 0)
NewtonTreeCollisionBeginBuild map
For tFaces = 0 To loadedMap.Totfaces - 1 'for each face into mesh i loaded
For TVertx = 0 To 3 'fixed in this case only
'i use mid to be sure to take 5 bytes for each vertex coordinates : -1.123456 ll'become -1.12
VertPntr(ind) = Mid(loadedMap.ArrayVert(loadedMap.ArrayFace(tFaces).IndVert(TVertx)).x, 1, 5): ind = ind + 1
VertPntr(ind) = Mid(loadedMap.ArrayVert(loadedMap.ArrayFace(tFaces).IndVert(TVertx)).y, 1, 5): ind = ind + 1
VertPntr(ind) = Mid(loadedMap.ArrayVert(loadedMap.ArrayFace(tFaces).IndVert(TVertx)).z, 1, 5): ind = ind + 1
Next
NewtonTreeCollisionAddFace map, 4, VertPntr(0), 15, totGlobFaces
ind = 0 ' reset vertex array pointer for next face cicle
totGlobFaces = totGlobFaces + 1
Next
NewtonTreeCollisionEndBuild InscrMappa, 1
ReDim Preserve NewtonObjs(totNewtoObjs)
NewtonObjs(totNewtoObjs).NewtonBody = NewtonCreateBody(newtonWorld, InscrMappa)
NewtonReleaseCollision newtonWorld, InscrMappa
NewtonBodySetMassMatrix NewtonObjs(totNewtoObjs).NewtonBody, 0, 0, 0, 0 'its a static floor
__________________________________________________________
Users browsing this forum: No registered users and 4 guests