hey walaber, ive been working with your system for the past few days and i think its pretty easy. if anyones having trouble getting started, i made these 2 simple funtions to make a box:
function makephybox(obno,sizex,sizey,sizez,xp,yp,zp,mass,inert)
col1 = NDB_NewtonCreatebox(sizex,sizey,sizez, 0)
make object box obno,sizex,sizey,sizez
position object obno,xp,yp,zp
Ball = NDB_NewtonCreateBody(col1)
NDB_BodySetDBProData ball,obno
NDB_NewtonBodySetDestructorCallback Ball
NDB_NewtonBodySetTransformCallback Ball
NDB_NewtonBodySetForceAndTorqueCallback Ball
NDB_NewtonBodySetMassMatrix Ball,mass,inert,inert,inert
NDB_SetMatrixIdentityMatrix
NDB_SetVector xp,yp,zp
NDB_SetMatrixPosRow
NDB_NewtonBodySetMatrix Ball
NDB_NewtonBodySetAutoFreeze Ball, 0
endfunction
and sphere:
function makephyball(obno,size,xp,yp,zp,mass,inert)
col1 = NDB_NewtonCreateSphere(size/2, 0)
make object sphere obno,size
position object obno,xp,yp,zp
Ball = NDB_NewtonCreateBody(col1)
NDB_BodySetDBProData ball,obno
NDB_NewtonBodySetDestructorCallback Ball
NDB_NewtonBodySetTransformCallback Ball
NDB_NewtonBodySetForceAndTorqueCallback Ball
NDB_NewtonBodySetMassMatrix Ball,mass,inert,inert,inert
NDB_SetMatrixIdentityMatrix
NDB_SetVector xp,yp,zp
NDB_SetMatrixPosRow
NDB_NewtonBodySetMatrix Ball
NDB_NewtonBodySetAutoFreeze Ball, 0
endfunction
just put them at the end of your program,put this at the beginning:
NDB_NewtonCreate
NDB_SetVector 0.0, -50.0, 0.0
NDB_SetStandardGravity
and put this somewhere in your main loop:
and thats all you need to use the engine. now walaber, this is what i need help with, i need code that makes an object unable to move and code that makes an object unable to rotate which i can incorperate into my functions.
oh and im working on a pretty cool game using the engine which i should be done with fairly soon.