OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
code:
var FR_wheel_ID; var FL_wheel_ID; var RL_wheel_ID; var RR_wheel_ID;
action FR_tyre { my.shadow=on; phent_settype(my, PH_RIGID, PH_SPHERE); phent_setgroup(my,2); phent_setmass(my, 5, PH_SPHERE); phent_setfriction(my, 70); phent_setelasticity(my, 50, 10); phent_setdamping(my, 20, 20 ); FR_wheel_ID=phcon_add(PH_WHEEL,my,p_player); phcon_setparams1(FR_wheel_ID, my.x, vector(0,0,1),vector(0,1,0)); phcon_setparams2(FR_wheel_ID, vector(35,-35,0),vector(-360,360,0),vector(0.9,0.001,0)); }
action FL_tyre { my.shadow=on; my.pan=180;
phent_settype(my, PH_RIGID, PH_SPHERE); phent_setgroup(my,2); phent_setmass(my, 5, PH_SPHERE); phent_setfriction(my, 70); phent_setelasticity(my, 50, 10); phent_setdamping(my, 20, 20 ); FL_wheel_ID=phcon_add(PH_WHEEL,my,p_player); phcon_setparams1(FL_wheel_ID, my.x, vector(0,0,1),vector(0,1,0)); phcon_setparams2(FL_wheel_ID, vector(35,-35,0),vector(-360,360,0),vector(0.9,0.001,0)); }
action RL_tyre { my.shadow=on; my.pan=180; phent_settype(my, PH_RIGID, PH_SPHERE); phent_setgroup(my,2); phent_setmass(my, 5, PH_SPHERE); phent_setfriction(my, 70); phent_setelasticity(my, 50, 10); phent_setdamping(my, 20, 20 ); RL_wheel_ID=phcon_add(PH_WHEEL,my,p_player); phcon_setparams1(RL_wheel_ID, my.x, vector(0,0,1),vector(0,1,0)); phcon_setparams2(RL_wheel_ID, vector(0,0,0),vector(-360,360,0),vector(0.9,0.001,0)); }
action RR_tyre { my.shadow=on; phent_settype(my, PH_RIGID, PH_SPHERE); phent_setgroup(my,2); phent_setmass(my, 5, PH_SPHERE); phent_setfriction(my, 70); phent_setelasticity(my, 50, 10); phent_setdamping(my, 20, 20 ); RR_wheel_ID=phcon_add(PH_WHEEL,my,p_player); phcon_setparams1(RR_wheel_ID, my.x, vector(0,0,1),vector(0,1,0)); phcon_setparams2(RR_wheel_ID, vector(0,0,0),vector(-360,360,0),vector(0.9,0.001,0)); }
action car { p_player=my; wait(1); my.shadow=on; my.material=mat_metal; phent_settype(my,PH_RIGID,PH_BOX); phent_setgroup(my,2); phent_setmass(my,40,PH_BOX); phent_setfriction(my,50); phent_setelasticity(my,50,10); phent_setdamping(my,20,20); vec_for_vertex(temp,my,306); ent_create(mdl_tyre,temp,FR_tyre); vec_for_vertex(temp,my,36); ent_create(mdl_tyre,temp,FL_tyre); vec_for_vertex(temp,my,5); ent_create(mdl_tyre,temp,RL_tyre); vec_for_vertex(temp,my,304); ent_create(mdl_tyre,temp,RR_tyre); }
why does my car explode when this code runs? first i create the car and the car creates it's tyres then. after reading the manual i came to the conclusion that this would be the way to do it...
and what do the spring damper constants exactly do?
|