Ok, here is a snip from my main loop
`\\Mouselook
rotate object 1, object angle x(1)+(mousemovey()/2.75),object angle y(1)+(mousemovex()/2.75),0
rotate object 2, object angle x(1)+(mousemovey()/2.75),object angle y(1)+(mousemovex()/2.75),0
`\\move player with arrow keys (objects 1 & 2)
cx#=object angle x(1) : cy#=object angle y(1)
dx#=object angle x(2) : dy#=object angle y(2)
if upkey()=1
xrotate object 1,0 : move object 1,0.15 : xrotate object 1,cx#
xrotate object 2,0 : move object 2,0.15 : xrotate object 2,dx#
endif
if downkey()=1
xrotate object 1,0 : move object 1,-0.15 : xrotate object 1,cx#
xrotate object 2,0 : move object 2,-0.15 : xrotate object 2,dx#
endif
if leftkey()=1
yrotate object 1,cy#-90 : move object 1,0.15 : yrotate object 1,cy#
yrotate object 2,dy#-90 : move object 2,0.15 : yrotate object 2,dy#
endif
if rightkey()=1
yrotate object 1,cy#+90 : move object 1,0.15 : yrotate object 1,cy#
yrotate object 2,dy#+90 : move object 2,0.15 : yrotate object 2,dy#
endif
`\\camera follows dummy object 2
position camera 0,object position x(2),object position y(2),object position z(2)
rotate camera 0,object angle x(2),object angle y(2),object angle z(2)
rem Apply gravity to player / offset object 2 by 2.1 point
position object 1,object position x(1),object position y(1)-0.1,object position z(1)
position object 2,object position x(1),object position y(1)+2,object position z(1)
this works fine to control my character within a bsp world. Up moves forward, down moves back, left/right side-step, and mouse looks in all directions.
Since AUTOMATIC OBJECT COLLISION doesn't work with BSP collision (Confirmed BUG - see bug forum) I need to add some manual collision handling when the player encounters objects that are NOT bsp geometry, such as a 3ds object I create. I need to incorporate this extra code to "stop" the player if he hits an object, but without getting "stuck" to the object. Since a am new to this whole concept I was hoping someone could give me a start. The new snip is where I need the help...
`\\Mouselook
rotate object 1, object angle x(1)+(mousemovey()/2.75),object angle y(1)+(mousemovex()/2.75),0
rotate object 2, object angle x(1)+(mousemovey()/2.75),object angle y(1)+(mousemovex()/2.75),0
intCollided=object collision(2,0)
if upkey()=1 and intcollided > 0
`?
endif
if downkey()=1 and intcollided > 0
`?
endif
if leftkey()=1 and intcollided > 0
`?
endif
if rightkey()=1 and intcollided > 0
`?
endif
`\\move player with arrow keys (objects 1 & 2)
cx#=object angle x(1) : cy#=object angle y(1)
dx#=object angle x(2) : dy#=object angle y(2)
if upkey()=1
xrotate object 1,0 : move object 1,0.15 : xrotate object 1,cx#
xrotate object 2,0 : move object 2,0.15 : xrotate object 2,dx#
endif
if downkey()=1
xrotate object 1,0 : move object 1,-0.15 : xrotate object 1,cx#
xrotate object 2,0 : move object 2,-0.15 : xrotate object 2,dx#
endif
if leftkey()=1
yrotate object 1,cy#-90 : move object 1,0.15 : yrotate object 1,cy#
yrotate object 2,dy#-90 : move object 2,0.15 : yrotate object 2,dy#
endif
if rightkey()=1
yrotate object 1,cy#+90 : move object 1,0.15 : yrotate object 1,cy#
yrotate object 2,dy#+90 : move object 2,0.15 : yrotate object 2,dy#
endif
`\\camera follows dummy object 2
position camera 0,object position x(2),object position y(2),object position z(2)
rotate camera 0,object angle x(2),object angle y(2),object angle z(2)
rem Apply gravity to player / offset object 2 by 2.1 point
position object 1,object position x(1),object position y(1)-0.1,object position z(1)
position object 2,object position x(1),object position y(1)+2,object position z(1)
I don't fully follow the rotations/positions in 3d space as I am new to these concepts.
Thanks
-RUST-