|
Post by Extinction on Aug 2, 2007 11:53:49 GMT 1
Hi! I'm having problems getting a mass on Tree collision objects. I have the mass, gravity and so on working for object primitives, but I can't figure out why this isn't working... The object is loading correctly and the wireframes fit to DBP. Also Collision works, but no mass, it stays as a solid object. After calling this function, I tried to shoot at it. Body's with a mass shouldn't get a bullethole (like in fps example), but the objects always get those. Tree collision function: function loadstatic(objfile$,n,x#,y#,z#,sx#,sy#,sz#,rx#,ry#,rz#,mass#) load object "models/"+objfile$,n `texture object n,n col = NDB_NewtonCreateTreeCollisionUnoptimized( n ) body = NDB_NewtonCreateBody( col ) NDB_BuildMatrix rx#,ry#,rz#, x#,y#,z# NDB_NewtonBodySetMatrix body NDB_CalculateMIBoxSolid mass#, sx#, sy#, sz#
NDB_NewtonBodySetMassMatrix body, mass# NDB_NewtonReleaseCollision col set object ambience n, 50 position object n,x#,y#,z# rotate object n,rx#,ry#,rz# NDB_BodySetDBProData body, n NDB_NewtonBodySetDestructorCallback body NDB_BodySetGravity body, 1 endfunction body
|
|
|
Post by Extinction on Aug 2, 2007 14:01:26 GMT 1
Nevermind, I found this:
But how to get 3D models dynamic in Newton? Or do I have to build them out of primitives?
|
|