"Physic"
Init:
# set physic processing precision
setIterations(10);
# set up environment
resetFixedObjects();
resetTags();
addFixedObject(0); # only World(0) for environment
createEnvPhysic(0);
# add props dynamics
for (n=0;n
Play:
# process rigid body simulation
calculateEnvPhysic(0,TIME_DT);
Free:
# free physic environment ressources
deleteEnvPhysic(0);
Misc:
Added colliding with environment:
if (testCollisionEnv(0)>0) playSound(0,0);
Added colliding with themselves:
if (testCollisionObjs(0)>0) playSound(1,0);
Or: Init:
# set physic processing precision
setIterations(10); # iterations (10 steps per frame)
setStaticMinValues(0.4,0.4); # staic thresold velocity and angular velocity
# set low response from ground and normal friction
setEnvParams(0.1,0.3);
# value static objects
setStatic(0); # static thresold
# obsolete
setApproximation(OFF);
setOrthoDimension2D(ON); # usefull when environment is flat
# set up environment
createEnvPhysicVoid(0);
# upload object with optimization of 10
setDepthEnv(10);
addObjToEnvPhysic(0,0);
# set object/object response
setObjParams(0.1,0.3);