|
fall down ,passing of the game land
#370156
05/11/11 11:05
05/11/11 11:05
|
Joined: Aug 2010
Posts: 131 Iran
Mafia_IR
OP
Member
|
OP
Member
Joined: Aug 2010
Posts: 131
Iran
|
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 ... What is problem ?
|
|
|
Re: fall down ,passing of the game land
[Re: chrisp1]
#370183
05/11/11 14:15
05/11/11 14:15
|
Joined: Aug 2010
Posts: 131 Iran
Mafia_IR
OP
Member
|
OP
Member
Joined: Aug 2010
Posts: 131
Iran
|
these is no difference when i used reset(OBJ name , ... ) . u can see my code here :
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);
}
}
|
|
|
Re: fall down ,passing of the game land
[Re: Mafia_IR]
#370186
05/11/11 14:34
05/11/11 14:34
|
Joined: Mar 2010
Posts: 75
YellowAfterlife
Junior Member
|
Junior Member
Joined: Mar 2010
Posts: 75
|
Try setting main plane type to (PH_STATIC, PH_POLY)
Unfortunately, I've not worked with 3dGS for a while now, but it was fun
|
|
|
Re: fall down ,passing of the game land
[Re: YellowAfterlife]
#370192
05/11/11 14:53
05/11/11 14:53
|
Joined: Aug 2010
Posts: 131 Iran
Mafia_IR
OP
Member
|
OP
Member
Joined: Aug 2010
Posts: 131
Iran
|
it worked! i was added this line of code . ball can't pass the plane but now i cant move the plane with mouse ...
pXent_settype(main_plane ,PH_STATIC , PH_POLY );
and this my main plane function :
function main_plane_function ()
{
while(1)
{
my.tilt -= mouse_force.y ;
my.pan += mouse_force.x ;
wait(1);
}
}
Last edited by Mafia_IR; 05/11/11 14:54.
|
|
|
Re: fall down ,passing of the game land
[Re: Mafia_IR]
#370193
05/11/11 14:59
05/11/11 14:59
|
Joined: Mar 2010
Posts: 75
YellowAfterlife
Junior Member
|
Junior Member
Joined: Mar 2010
Posts: 75
|
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.
Unfortunately, I've not worked with 3dGS for a while now, but it was fun
|
|
|
|