function main()
{
video_mode = 8 ;
video_screen = 1 ;
fps_max = 240 ;
physX_open();
shadow_stencil = 3;
level_load("Ball_physx.wmb");
main_plane = ent_create("Plane.mdl",vector(0,0,0),main_plane_function) ;
ball_physx = ent_create("ball.mdl",vector(0,0,30),ball_function) ;
pXent_settype(ball_physx ,PH_RIGID , PH_SPHERE );
pXent_setfriction(ball_physx,50);
pXent_setdamping (ball_physx,10,10);
pXent_setelasticity (ball_physx,5);
reset(ball_physx,PASSABLE);
while(1)
{
pXent_addtorqueglobal (ball_physx, ball_force); //!
camera.z = ball_physx.z + 400 ;
wait(1);
}
}