2 registered members (TipmyPip, 1 invisible),
18,731
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: scale not affecting physics box
[Re: croman]
#220473
08/07/08 11:27
08/07/08 11:27
|
Joined: Aug 2008
Posts: 55 United Kingdom
CdeathJD
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2008
Posts: 55
United Kingdom
|
Sure: (Top to bottom now)
=================================================================================
/////////////////////////////////////////////////////////////// #include <acknex.h> #include <default.c>
///////////////////////////////////////////////////////////////
VECTOR ball_speed; VECTOR Temp; ENTITY* ball; ENTITY* Slab;
function main() { fps_max = 200; level_load("roller.wmb"); // load the level wait (2); // wait until the level is loaded ball = ent_create ("ball.mdl", vector(-400, 0, 100), NULL); // create the ball ph_setgravity (vector(0, 0, -426)); // set the gravity phent_settype (ball, PH_RIGID, PH_SPHERE); // set the physics entity type phent_setmass (ball, 3, PH_SPHERE); // and its mass phent_setfriction (ball, 199); // set the friction phent_setdamping (ball, 20, 20); // set the damping phent_setelasticity (ball, 20, 5); // set the elasticity Slab = ent_create ("Slab.mdl", vector(-400, 0, 100), NULL); // create the ball phent_settype (Slab, PH_RIGID, PH_BOX); // set the physics entity type phent_setmass (Slab, 1, PH_BOX); // and its mass phent_setfriction (Slab, 199); // set the friction phent_setdamping (Slab, 20, 20); // set the damping phent_setelasticity (Slab, 90, 5); // set the elasticity phent_settype (Slab, 0 , 0); // set the physics entity type Slab.scale_x = 5; Slab.scale_y = 5; Slab.scale_z = 5; wait (1); c_setminmax(Slab); phent_settype (Slab, PH_RIGID, PH_BOX); // set the physics entity type
while (1) { ball_speed.x = 35 * (key_cur - key_cul); // move the ball using the cursor keys ball_speed.y = 35 * (key_cuu - key_cud); // 25 sets the x / y movement speeds ball_speed.z = 0; // no need to move on the vertical axis phent_addtorqueglobal (ball, ball_speed); // add a torque (an angular force) to the ball //camera.x = ball.x - 400; // keep the camera 300 quants behind the ball //camera.y = ball.y; // using the same y with the ball //camera.z = ball.z + 100; // and place it at z = 1000 quants //camera.tilt = -5; // make it look downwards camera.x = 500; camera.y = 500; camera.z = 500; vec_set(Temp,ball); vec_sub(Temp,camera); vec_to_angle( camera.pan ,Temp); // now MY looks at YOU wait (1); } } =================================================================================
I am a noob to this... Blitz3D is where i am best at!
|
|
|
Re: scale not affecting physics box
[Re: CdeathJD]
#220474
08/07/08 11:30
08/07/08 11:30
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
maybe you didnt disable physics or you didnt make it good.
Ubi bene, ibi Patria.
|
|
|
Re: scale not affecting physics box
[Re: croman]
#220478
08/07/08 11:34
08/07/08 11:34
|
Joined: Aug 2008
Posts: 55 United Kingdom
CdeathJD
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2008
Posts: 55
United Kingdom
|
What has disabling physics got to do with pointing one object at another? I dont understand what you are saying. Also... i dont find "didn't make it good" a very helpful comment really!
Though to be honest i didnt make most of it i just changed it and fiddled with it!
I am a noob to this... Blitz3D is where i am best at!
|
|
|
Re: scale not affecting physics box
[Re: CdeathJD]
#220479
08/07/08 11:38
08/07/08 11:38
|
Joined: Sep 2007
Posts: 761 Hrvatska (Croatia ), Slavonski...
cro_games
User
|
User
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
|
Replace this: vec_set(Temp,ball); vec_sub(Temp,camera); vec_to_angle( camera.pan ,Temp);
with this: Add new var "camera_rot"
vec_set(camera_rot,ball.x); vec_sub(camera_rot,camera.x); vec_to_angle( camera.pan ,camera_rot);
Last edited by cro_games; 08/07/08 11:40.
|
|
|
Re: scale not affecting physics box
[Re: CdeathJD]
#220480
08/07/08 11:38
08/07/08 11:38
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
edit:::damn it, i'm so stupid. lol i didnt see it right. i'm tired that's why i told you that lol
Last edited by cerberi_croman; 08/07/08 11:42. Reason: i'm tired so i made a mistake hehe
Ubi bene, ibi Patria.
|
|
|
Re: scale not affecting physics box
[Re: croman]
#220483
08/07/08 11:42
08/07/08 11:42
|
Joined: Aug 2008
Posts: 55 United Kingdom
CdeathJD
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2008
Posts: 55
United Kingdom
|
Yes but im not trying to "point" the ball. I'm trying to point the "camera" at the ball. Would i still need to disable physics on any object i wished to point another object at?
I am a noob to this... Blitz3D is where i am best at!
|
|
|
Re: scale not affecting physics box
[Re: CdeathJD]
#220484
08/07/08 11:45
08/07/08 11:45
|
Joined: Sep 2007
Posts: 761 Hrvatska (Croatia ), Slavonski...
cro_games
User
|
User
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
|
no! Replace this: vec_set(Temp,ball); vec_sub(Temp,camera); vec_to_angle( camera.pan ,Temp);
with this: Add new var "camera_rot"
vec_set(camera_rot,ball.x); vec_sub(camera_rot,camera.x); vec_to_angle( camera.pan ,camera_rot);
Last edited by cro_games; 08/07/08 11:45.
|
|
|
Re: scale not affecting physics box
[Re: croman]
#220485
08/07/08 11:45
08/07/08 11:45
|
Joined: Aug 2008
Posts: 55 United Kingdom
CdeathJD
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2008
Posts: 55
United Kingdom
|
edit:::damn it, i'm so stupid. lol i didnt see it right. i'm tired that's why i told you that lol Go to bed then... the world wont end because i failed to learn this skill today!
I am a noob to this... Blitz3D is where i am best at!
|
|
|
Re: scale not affecting physics box
[Re: cro_games]
#220497
08/07/08 12:11
08/07/08 12:11
|
Joined: Aug 2008
Posts: 55 United Kingdom
CdeathJD
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2008
Posts: 55
United Kingdom
|
no! Replace this: vec_set(Temp,ball); vec_sub(Temp,camera); vec_to_angle( camera.pan ,Temp);
with this: Add new var "camera_rot"
vec_set(camera_rot,ball.x); vec_sub(camera_rot,camera.x); vec_to_angle( camera.pan ,camera_rot); That worked thanks!!! Why on earth is the ".x" necessary though... its not just taking the X vector into account but all of them :S!
I am a noob to this... Blitz3D is where i am best at!
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|