when I run the following program my object and camera just fall right through the floor. How do I keep my 'player' inside the map and not fall through the floor?
Rem Project: colltest
Rem Created: Friday, November 04, 2011
Rem ***** Main Source File *****
` set up initial settings
PHY START
HIDE MOUSE
AUTOCAM OFF
MAKE CAMERA 1
`set main constants
#CONSTANT playerobj = 1
#CONSTANT worldobj = 2
`set up the scene
POSITION CAMERA 1,-230,60,-239
LOAD OBJECT "simpletest.x",worldobj
POSITION OBJECT worldobj,0,0,0
`make a player object
MAKE OBJECT BOX playerobj,10,35,10
POSITION OBJECT playerobj,CAMERA POSITION X(1),CAMERA POSITION Y(1)-25,CAMERA POSITION Z(1)
`get camera angles for reference later
camx# = CAMERA ANGLE X(1)
camz# = CAMERA ANGLE Y(1)
`this should set both objects up for collision using darkPHYSICS ( or this could be where the problem is )
`set world as terrain
PHY MAKE RIGID BODY STATIC TERRAIN worldobj
`sey character controller
PHY MAKE BOX CHARACTER CONTROLLER playerobj,CAMERA POSITION X(1),CAMERA POSITION Y(1),CAMERA POSITION Z(1),10,35,10,1,1.0,1.0
`set variables for collision check
lastOBJECTA = 0
lastOBJECTB = 0
`main loop
Do
`used for player to look around
camy# = WRAPVALUE(MOUSEMOVEX() + camy#)
camx# = MOUSEMOVEY() + camx#
IF camx# > 90 THEN camx# = 90
IF camx# < -90 THEN camx# = -90
Rotate CAMERA 1, camx#,camy#,CAMERA ANGLE Z(1)
ROTATE OBJECT playerobj,camx#,camy#,OBJECT ANGLE Z(playerobj)
`used to determine if user wants to move or not
SELECT MOUSECLICK()
CASE 1: `move forward
PHY MOVE CHARACTER CONTROLLER playerobj, 0.1
MOVE OBJECT playerobj,0.1
ENDCASE
CASE 2: `move backward
PHY MOVE CHARACTER CONTROLLER playerobj, -0.1
MOVE OBJECT playerobj,-0.1
ENDCASE
CASE DEFAULT: `don't move at all
PHY MOVE CHARACTER CONTROLLER playerobj, 0.0
MOVE OBJECT playerobj,0.0
ENDCASE
ENDSELECT
`used to get collision information
WHILE PHY GET COLLISION DATA ( )
lastOBJECTA = PHY GET COLLISION OBJECT A ( )
lastOBJECTB = PHY GET COLLISION OBJECT B ( )
ENDWHILE
`re-position camera
POSITION CAMERA 1, OBJECT POSITION X(playerobj),OBJECT POSITION Y(playerobj),OBJECT POSITION Z(playerobj)
`update darkPHYSYICS
PHY UPDATE
LOOP
END
below is the required media... any insight would be helpful
LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003