fall down ,passing of the game land

Posted By: Mafia_IR

fall down ,passing of the game land - 05/11/11 11:05

hi guys ,

i made two entities with model editor and i imported them in WED ...

first is a small ball with physics and second is a land that player can move ball on it .

but when i test the game,i saw the ball can pass the land and fall down into the blue unlimited world in 3DGS ... grin

What is problem ?
Posted By: chrisp1

Re: fall down ,passing of the game land - 05/11/11 11:32

maybe you have set the PASSABLE flag
Try: reset(yourentityname,PASSABLE);
Posted By: Mafia_IR

Re: fall down ,passing of the game land - 05/11/11 14:15

these is no difference when i used reset(OBJ name , ... ) . u can see my code here :

Code:
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);
    }
    
}


Posted By: YellowAfterlife

Re: fall down ,passing of the game land - 05/11/11 14:34

Try setting main plane type to (PH_STATIC, PH_POLY)
Posted By: Mafia_IR

Re: fall down ,passing of the game land - 05/11/11 14:53

it worked! grin

i was added this line of code . ball can't pass the plane but now i cant move the plane with mouse ...
Code:
pXent_settype(main_plane ,PH_STATIC  , PH_POLY  );


and this my main plane function :
Code:
function main_plane_function ()
{
	while(1)
	{
		my.tilt -= mouse_force.y ;
		my.pan  += mouse_force.x ;
		
		wait(1);
	}
}


Posted By: YellowAfterlife

Re: fall down ,passing of the game land - 05/11/11 14:59

If you want to rotate plane with mouse, set type to (PH_RIGID, PH_CONVEX). And check the manual on pXent_type - there will be some more things about it.
Posted By: Mafia_IR

Re: fall down ,passing of the game land - 05/11/11 17:13

it's not depending on pXent_settype , i tested all parameter of this keyword but nothing happened . can anyone help me ?
Posted By: JHA

Re: fall down ,passing of the game land - 07/16/11 11:00


Have you played around with the parameters:

pX_setsteprate(60,8,NX_TIMESTEP_FIXED);
pX_setunit(1/40);
ph_fps_max_lock=100;
ph_check_distance=2;
pX_setccd(1);

and have you used pXent_setccdskeleton(ent,vector(0,0,0),1);
© 2024 lite-C Forums