I modified one of the examples to test how fast an object falls.
The implication of this is we need to either model at the ratio of 1 darkbasic unit = 1 meter or scale to get this ratio.
If i wish to use other units mm or inches you can simply change the gravity constant.
My question is do I have to change any other constants to make the models react correctly?
Rem Project: distance
Rem Created: 8/5/2006 3:00:41 PM
Rem ***** Main Source File *****
` call this command to be able to use physics in our program
phy start
` turn sync rate on
sync on
sync rate 60
` make a box that will be our ground
make object box 1, 50, 1, 50
` create a static rigid body box to represent the ground
phy make rigid body static box 1
` create a cube and place it just above the edge of the ground
make object sphere 2, 2
position object 2, 0, 80+(object size(2)/2), -25
phy make rigid body dynamic sphere 2
make object sphere 3, 10
position object 3, 10, 80+(object size(3)/2), -25
phy make rigid body dynamic sphere 3
` position the camera so we can see the cube and box
position camera 0, 60, -120
startTime = Timer()
` and here's our main loop
onetime = 0
do
phy update
sync
Hit = phy get collision data ( )
if (phy get collision object a ( )) > 0 and onetime = 0
onetime = 1
Droptime = Timer()-startTime
Text 10,10, Str$(Droptime)
endif
Text 10,10, Str$(Droptime)
loop
System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem