It my again
I solved the problem with the primitive (Box, Cone, Sphere and Cylinder).
But not with TreeCollision
The winding order in Jet3D is clock wise :
It is optimized for triangle fans. Clockwise from the top.
1-----4
|\ |
| \ |
| \ |
2-----3
Newton is counter clock wise. Right?.
I try to pass the geometry to Newton in inverse order. This work well !!.
But if I try to pass the geometry to Newton in the SAME ORDER , ALSO work well !!!.
Then I try to use the function :
NEWTON_API int NewtonTreeCollisionGetVertexListIndexListInAABB (const NewtonCollision* treeCollision, const dFloat* p0, const dFloat* p1, const dFloat** vertexArray, int* vertexCount, int* vertexStrideInBytes, const int* indexList, int maxIndexCount, const int* faceAttribute);
and I obtain the SAME VERTEXES !!.
This are the JET3D faces:
NewVec[ 726.999816894531 -90.0 -612.999877929688 ]
NewVec[ 726.999816894531 -90.0 628.000122070313 ]
NewVec[ 726.999816894531 82.0 628.000122070313 ]
NewVec[ 726.999816894531 82.0 -612.999877929688 ])
(NewVec[ -688.999938964844 82.0 628.000122070313 ]
NewVec[ -688.999938964844 -90.0 628.000122070313 ]
NewVec[ -688.999938964844 -90.0 -612.999877929688 ]
NewVec[ -688.999938964844 82.0 -612.999877929688 ])
(NewVec[ -688.999938964844 -90.0 -612.999877929688 ]
NewVec[ 726.999816894531 -90.0 -612.999877929688 ]
NewVec[ 726.999816894531 82.0 -612.999877929688 ]
NewVec[ -688.999938964844 82.0 -612.999877929688 ])
(NewVec[ 726.999816894531 82.0 628.000122070313 ]
NewVec[ 726.999816894531 -90.0 628.000122070313 ]
NewVec[ -688.999938964844 -90.0 628.000122070313 ]
NewVec[ -688.999938964844 82.0 628.000122070313 ])
NewVec[ -688.999938964844 -90.0 628.000122070313 ]
NewVec[ 726.999816894531 -90.0 628.000122070313 ]
NewVec[ 726.999816894531 -90.0 -612.999877929688 ]
NewVec[ -688.999938964844 -90.0 -612.999877929688 ])
(NewVec[ 726.999816894531 82.0 -612.999877929688 ]
NewVec[ 726.999816894531 82.0 628.000122070313 ]
NewVec[ -688.999938964844 82.0 628.000122070313 ]
NewVec[ -688.999938964844 82.0 -612.999877929688 ])
This the result faces in Newton:
////////////Newton Face Order with optimization///////////////////
(NewVec[ -688.999938964844 -90.0 628.000122070313 ]
NewVec[ -688.999938964844 82.0 628.000122070313 ]
NewVec[ -688.999938964844 -90.0 -612.999877929688 ]
NewVec[ -688.999938964844 82.0 -612.999877929688 ]
NewVec[ 726.999816894531 -90.0 628.000122070313 ]
NewVec[ 726.999816894531 82.0 -612.999877929688 ]
NewVec[ 726.999816894531 -90.0 -612.999877929688 ]
NewVec[ 726.999816894531 82.0 628.000122070313 ]
NewVec[ 0.0 -1.0 0.0 ]
NewVec[ 1.0 0.0 0.0 ]
NewVec[ 0.0 0.0 1.0 ]
NewVec[ 0.0 0.0 -1.0 ]
NewVec[ -1.0 0.0 0.0 ]
NewVec[ 0.0 1.0 0.0 ]
NewVec[ -689.099914550781 -90.0999984741211 -613.099853515625 ]
NewVec[ -688.999938964844 -90.0 -612.999877929688 ]
NewVec[ -688.999938964844 -90.0 628.000122070313 ]
NewVec[ -688.999938964844 82.0 628.000122070313 ]
NewVec[ -688.999938964844 82.0 -612.999877929688 ]
NewVec[ 726.999816894531 82.0 628.000122070313 ]
NewVec[ 726.999816894531 -90.0 -612.999877929688 ]
NewVec[ 726.999816894531 -90.0 628.000122070313 ]
NewVec[ 726.999816894531 82.0 -612.999877929688 ]
NewVec[ 727.099792480469 82.0999984741211 628.10009765625 ])
//////////////Newton Order wihtout optimization/////////////////
(NewVec[ -688.999938964844 82.0 -612.999877929688 ]
NewVec[ -688.999938964844 82.0 628.000122070313 ]
NewVec[ -688.999938964844 -90.0 -612.999877929688 ]
NewVec[ -688.999938964844 -90.0 628.000122070313 ]
NewVec[ 726.999816894531 -90.0 -612.999877929688 ]
NewVec[ 726.999816894531 -90.0 628.000122070313 ]
NewVec[ 726.999816894531 82.0 628.000122070313 ]
NewVec[ 726.999816894531 82.0 -612.999877929688 ]
NewVec[ 0.0 -1.0 0.0 ]
NewVec[ -1.0 0.0 0.0 ]
NewVec[ 1.0 0.0 0.0 ]
NewVec[ 0.0 0.0 1.0 ]
NewVec[ 0.0 0.0 -1.0 ]
NewVec[ 0.0 1.0 0.0 ]
NewVec[ -689.099914550781 -90.0999984741211 -613.099853515625 ]
NewVec[ -688.999938964844 82.0 -612.999877929688 ]
NewVec[ -688.999938964844 -90.0 -612.999877929688 ]
NewVec[ -688.999938964844 -90.0 628.000122070313 ]
NewVec[ -688.999938964844 82.0 628.000122070313 ]
NewVec[ 726.999816894531 82.0 -612.999877929688 ]
NewVec[ 726.999816894531 82.0 628.000122070313 ]
NewVec[ 726.999816894531 -90.0 628.000122070313 ]
NewVec[ 726.999816894531 -90.0 -612.999877929688 ]
NewVec[ 727.099792480469 82.0999984741211 628.10009765625 ])
Question:
If I change the winding order. Newton would not have to detect the collision of the other side of the faces ??.
TreeCollision:
________________
| detect collision |
| in side |
| ------> |
|_______________|
TreeCollision inverser order:
________________
| | detect collision out side
| | <------------
|______________ _|
Does somebody understand the question?
advanced thanks
kiko