2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: some a6 physics questions
#15413
04/26/03 21:40
04/26/03 21:40
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
Yo could try:
var earthgravity[3] = 0,0, -386; ////////////////////////////// // -386 is the downward pulling force along the z axis //////////////////////////////
action sphere {
my.shadow=on;
ph_setgravity( earthgravity );////////////////////////////// // and now you set the gravity ////////////////////////////// phent_settype(my, PH_RIGID, PH_SPHERE); phent_setmass(my, 5, PH_SPHERE); phent_setfriction(my, 70); phent_setelasticity(my, 70, 5); phent_setdamping(my, 20, 20 );
temp.x=cos(camera.pan)*cos(camera.tilt)*300000; temp.y=sin(camera.pan)*cos(camera.tilt)*300000; temp.z=sin(camera.tilt)*300000; phent_addforcelocal(my,temp,nullvector);
}
string mdl_sphere=<sphere_0.mdl>; function emit_sphere() { temp.x=camera.x+cos(camera.pan)*cos(camera.tilt)*100; temp.y=camera.y+sin(camera.pan)*cos(camera.tilt)*100; temp.z=camera.z+sin(camera.tilt)*100; ent_create(mdl_sphere,temp,sphere); } on_mouse_left=emit_sphere;
|
|
|
Re: some a6 physics questions
#15414
04/26/03 23:06
04/26/03 23:06
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
|
|
|
Re: some a6 physics questions
#15416
04/27/03 01:02
04/27/03 01:02
|
Joined: May 2002
Posts: 7,441
ventilator
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
code:
action sphere { my.shadow=on; phent_settype(my, PH_RIGID, PH_SPHERE); phent_setmass(my, 5, PH_SPHERE); phent_setfriction(my, 70); phent_setelasticity(my, 50, 10); phent_setdamping(my, 20, 20 ); temp.x=cos(camera.pan)*cos(camera.tilt)*300000; temp.y=sin(camera.pan)*cos(camera.tilt)*300000; temp.z=sin(camera.tilt)*300000; phent_addforcelocal(my,temp,nullvector);
sleep(5); ent_remove(my); }
this could work...
|
|
|
Re: some a6 physics questions
#15417
04/27/03 01:40
04/27/03 01:40
|
Joined: Jun 2002
Posts: 473
Juff
Senior Member
|
Senior Member
Joined: Jun 2002
Posts: 473
|
thanks alot but I need one more thing I want it so that if you press the left mouse button, you can't shoot another ball for 5 seconds, so I don't get that error thanks
|
|
|
Re: some a6 physics questions
#15418
04/27/03 01:44
04/27/03 01:44
|
Joined: May 2002
Posts: 7,441
ventilator
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
code:
action sphere { my.shadow=on; phent_settype(my, PH_RIGID, PH_SPHERE); phent_setmass(my, 5, PH_SPHERE); phent_setfriction(my, 70); phent_setelasticity(my, 50, 10); phent_setdamping(my, 20, 20 ); temp.x=cos(camera.pan)*cos(camera.tilt)*300000; temp.y=sin(camera.pan)*cos(camera.tilt)*300000; temp.z=sin(camera.tilt)*300000; phent_addforcelocal(my,temp,nullvector);
on_mouse_left=null; sleep(5); on_mouse_left=emit_sphere; ent_remove(my); }
...could work!
|
|
|
Re: some a6 physics questions
#15419
04/27/03 01:49
04/27/03 01:49
|
Joined: Mar 2003
Posts: 5,377 USofA
fastlane69
Senior Expert
|
Senior Expert
Joined: Mar 2003
Posts: 5,377
USofA
|
Hey, since we talking about wheels, let me ask this: Is rotational inertia ("I") implemented? It doesn't seem to be. There is a setMass, but no setRotInertia or the like. In the absense of "I", it would be more accurate to say that we can impart entities with a set angular acceleration and that __torque has nothing to do with it__. The help files even say this: "The torque vector can be visualized as the axis of desired rotation and the magnitude of this vector determines the desired acceleration" By this definition, I'm guessing you use a unit "I" for all rotations so that Torque = Angular Accelration x 1 However, the definition of mass states that "...Thus by increasing an object’s mass you will have to use a stronger force (or torque) to make them move..." by which I believe that Torque = Angular Acceleration x Mass If I'm mistaken or if "I" will be implemented later, I would like to know so I don't have to implement it myself. Otherwise a verification of which equation is actually used would be most helpful!
|
|
|
Re: some a6 physics questions
#15420
04/27/03 02:00
04/27/03 02:00
|
Joined: May 2002
Posts: 7,441
ventilator
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
quote: An object's hulltype determines its resistance to torque and thus the way it rotates. You can use one of the predefined constants to use an approximation of the object's shape or use PH_POLY to deduce the actual shape.
maybe this is what you are looking for?
|
|
|
|