2 registered members (AndrewAMD, TipmyPip),
13,353
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: A7 ( demo) Physics templates?
[Re: Mondivirtuali]
#141275
07/16/07 02:25
07/16/07 02:25
|
Joined: Mar 2007
Posts: 677 0x00000USA
MrCode
User
|
User
Joined: Mar 2007
Posts: 677
0x00000USA
|
no, what you have is fine. As for the complete Code:
var video_mode= 8; var video_screen= 1; var video_depth= 32;
var count_of_ents;
ENTITY* _ball;
action ball { _ball= me; ph_setgravity (nullvector); ph_fps_max_lock= 75; phent_settype (my,PH_RIGID,ph_sphere); phent_setmass (my,3,ph_sphere); phent_setfriction (my,30); phent_setelasticity (my,50,10); wait(-30); ent_remove(me); count_of_ents-= 1; }
ENTITY* cam;
action dummy_cam { cam= me; phent_settype (my,PH_RIGID,ph_box); phent_setmass (my,10,ph_box); phent_setfriction (my,10); phent_setelasticity (my,20,10); phent_setdamping(my,90,90); while(1) { phent_addtorquelocal (my,vector(0,20 * (mouse_force.y * time_step * -1),0)); phent_addtorquelocal (my,vector(0,0,20 * (mouse_force.x * time_step * -1))); phent_addvellocal (my,vector(25 * (mouse_left - mouse_right) * time_step,0,0),nullvector); if(mouse_middle== on) { phent_addtorquelocal (my,vector(25 * (mouse_force.x * time_step),0,0)); } camera.pan= my.pan; camera.tilt= my.tilt; camera.roll= my.roll; camera.x= my.x; camera.y= my.y; camera.z= my.z; wait(1); } }
function spawn_ball() { count_of_ents+= 1; ent_create ("earth.mdl",vector(random(200),random(-200),random(200)),ball); phent_addvellocal (_ball,vector(random(50),random(-50),random(-50)),vector(random(-20),random(15),random(-10))); while(1) { vec_set(temp,vector(_ball.x,_ball.y,_ball.z)); vec_to_screen(temp,camera); draw_line(temp,vector(255,255,255),100); draw_line(vector(512,384,0),vector(255,255,255),100); wait(1); } }
function main() { level_load ("0g_experience.wmb"); on_space= spawn_ball; }
panel _diag { digits(0,0,"Number of ents= %1.0f",_a4font,1,count_of_ents); flags= visible; }
This is a script I wrote to test the A7 unlimited physics.
void main()
{
cout << "I am MrCode,";
cout << "hear me roar!";
system("PAUSE");
}
|
|
|
Re: A7 ( demo) Physics templates?
[Re: Mondivirtuali]
#141278
07/16/07 19:50
07/16/07 19:50
|
Joined: Oct 2005
Posts: 528 Italy
Mondivirtuali
OP
User
|
OP
User
Joined: Oct 2005
Posts: 528
Italy
|
I am working on A6 6.60 comm I try to add another P. object , with this code Code:
action phys_obj1 {var earthgravity[3] = 0,0, -386;
ph_setgravity(earthgravity); phent_settype(my,PH_RIGID,PH_BOX ); phent_setmass(my,5,PH_BOX ); phent_setfriction(my,30); phent_setelasticity(my,50,10); phent_setdamping(my,90,90); }; }
but at the startup it said me that is not a p. object. This one is distant by the ball with the ball (working ) action. Code:
Last edited by Mondivirtuali; 07/16/07 19:54.
|
|
|
Re: A7 ( demo) Physics templates?
[Re: Mondivirtuali]
#141279
07/16/07 20:18
07/16/07 20:18
|
Joined: Oct 2005
Posts: 528 Italy
Mondivirtuali
OP
User
|
OP
User
Joined: Oct 2005
Posts: 528
Italy
|
Okay, I made a similar test level in A7 , giving this action to 3 different models 2 sphere and a woman model. Code:
action phys_obj {var earthgravity[3] = 1,1, -386;
ph_setgravity(earthgravity); phent_settype(my,PH_RIGID,ph_sphere); phent_setmass(my,3,ph_sphere); phent_setfriction(my,30); phent_setelasticity(my,50,10); phent_setdamping(my,90,90); }; }
the spheroids mdl remain immoble, both. The woman mannequin roll over then stops.
Last edited by Mondivirtuali; 07/16/07 20:18.
|
|
|
Re: A7 ( demo) Physics templates?
[Re: MrCode]
#141280
07/17/07 12:55
07/17/07 12:55
|
Joined: Oct 2005
Posts: 528 Italy
Mondivirtuali
OP
User
|
OP
User
Joined: Oct 2005
Posts: 528
Italy
|
Quote:
no, what you have is fine.
As for the complete Code:
var video_mode= 8; var video_screen= 1; var video_depth= 32;
var count_of_ents;
ENTITY* _ball;
action ball { _ball= me; ph_setgravity (nullvector); ph_fps_max_lock= 75; phent_settype (my,PH_RIGID,ph_sphere); phent_setmass (my,3,ph_sphere); phent_setfriction (my,30); phent_setelasticity (my,50,10); wait(-30); ent_remove(me); count_of_ents-= 1; }
ENTITY* cam;
action dummy_cam { cam= me; phent_settype (my,PH_RIGID,ph_box); phent_setmass (my,10,ph_box); phent_setfriction (my,10); phent_setelasticity (my,20,10); phent_setdamping(my,90,90); while(1) { phent_addtorquelocal (my,vector(0,20 * (mouse_force.y * time_step * -1),0)); phent_addtorquelocal (my,vector(0,0,20 * (mouse_force.x * time_step * -1))); phent_addvellocal (my,vector(25 * (mouse_left - mouse_right) * time_step,0,0),nullvector); if(mouse_middle== on) { phent_addtorquelocal (my,vector(25 * (mouse_force.x * time_step),0,0)); } camera.pan= my.pan; camera.tilt= my.tilt; camera.roll= my.roll; camera.x= my.x; camera.y= my.y; camera.z= my.z; wait(1); } }
function spawn_ball() { count_of_ents+= 1; ent_create ("earth.mdl",vector(random(200),random(-200),random(200)),ball); phent_addvellocal (_ball,vector(random(50),random(-50),random(-50)),vector(random(-20),random(15),random(-10))); while(1) { vec_set(temp,vector(_ball.x,_ball.y,_ball.z)); vec_to_screen(temp,camera); draw_line(temp,vector(255,255,255),100); draw_line(vector(512,384,0),vector(255,255,255),100); wait(1); } }
function main() { level_load ("0g_experience.wmb"); on_space= spawn_ball; }
panel _diag { digits(0,0,"Number of ents= %1.0f",_a4font,1,count_of_ents); flags= visible; }
This is a script I wrote to test the A7 unlimited physics.
I tryed this in A7 and it does not working; the balls are inamovible. 
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|