PHY START
SYNC ON
SYNC RATE 60
make object plain 1,1000,1000
rotate object 1,90,0,0
position object 1,0,0,0
phy make rigid body static mesh 1
position camera 10,50,10
do
something=PHY RAY CAST ALL SHAPEs(camera position x(), camera position y(), camera position z(), 0, -1.5, 0) // THIS DOENST WORK
//something=PHY RAY CAST ALL SHAPEs(camera position x(), camera position y(), camera position z(), 0, -1.0, 0) THIS WORKS
if phy get ray cast hit( )= 1
dx# = phy get ray cast hit point x()
dy# = phy get ray cast hit point y()
dz# = phy get ray cast hit point z()
endif
control camera using arrowkeys 0,1.0, 1.0
CamX# = CamX# + mousemovey() / 2.0
CamY# = CamY# + mousemovex() / 2.0
rotate camera CamX#, CamY#, 0.0
TEXT 1,1, str$(dx#) + " " + str$(dy#) + " " + str$(dz#)
PHY UPDATE
sync
loop
Try it, you will see.
something=PHY RAY CAST ALL SHAPEs(camera position x(), camera position y(), camera position z(), 0, -1.5, 0) // THIS DOESNT WORK
//something=PHY RAY CAST ALL SHAPEs(camera position x(), camera position y(), camera position z(), 0, -1.0, 0) THIS WORKS
Direction vector can consist from -1,0,1 numbers. Why ? lol
PS: Real programmers aren't afraid of math!.
AMD 64x 3500+, 6GB RAM, GeForce 8800 GTS 320MB, HD 500GB, X-fi xtreme audio