yes, that was also my result with Newton. But the Newtonspheres, cubes. are independent from the miniB3D geometry as long as you don't build complex hulls in Newton. Also I hope that cones and cylinders will work much better with Newton in the new Version. Currently they seemed to be flipped in the Z axis by 90 degrees and result in unwanted effects at simulation time.
If someone want to try to implement Newton themselves (not with my physic extension) here is the correct matrix translation for miniB3D --> Newton and back:
Method Update()
newtonBodyGetMatrix(Node , Mat)
NewtonBodyGetVelocity(Node,Velocity)
NewtonBodyGetOmega(Node,Omega)
Max3DSetMatrix(Self,Mat)
Local mmp:Float Ptr=Mesh.Mat.grid
mmp[0]=mat[0]
mmp[1]=mat[1]
mmp[2]=-mat[2]
mmp[4]=mat[4]
mmp[5]=mat[5]
mmp[6]=-mat[6]
mmp[8]=mat[8]
mmp[9]=mat[9]
mmp[10]=-mat[10]
mmp[12]=mat[12]'posx
mmp[13]=mat[13]'posy
mmp[14] = - mat[14]'-posz
posx = mat[12]
posy = mat[13]
posz = - mat[14]
Mesh.Mat.Scale(-mesh.sx,-mesh.sy,-mesh.sz)
End Method
A bit offtopic but maybe this is helping some people. Because this was the hardest thing to figure out as I hadn't understand matrices at this time.
|