|
Re: Physics Engine doesn't disengage??
[Re: fastlane69]
#19173
02/28/04 06:57
02/28/04 06:57
|
Joined: Sep 2003
Posts: 3,236 San Diego, CA
Marco_Grubert
Expert
|
Expert
Joined: Sep 2003
Posts: 3,236
San Diego, CA
|
Quote:
First off, YES!!!! Finally recognition that I"m NOT nuts!!! Secondly, just to make sure, this is expected behaiviour and not a bug?
Yes it is expected behavior. phent_enable() is basically just setting a flag putting the object into pause mode- thus it's extremely fast to execute.
I thought you were referring to phent_settype() earlier (which does perform a reset but is slow).
Quote:
2)Even within phent_enable, I can use the velocity govenor (phent_setmaxspeed()) as a way to trick my PE into setting my velocity to 0. This is sneaky...hadn't thought of it..
It is sneaky and not as straight-forward as something like a setvelocity() call would be. I am very concerned that setting velocity directly might screw things up easily. But adding a clearvelocity() function could be a useful additions..or not?
|
|
|
Re: Physics Engine doesn't disengage??
[Re: Marco_Grubert]
#19174
02/28/04 11:27
02/28/04 11:27
|
Joined: Nov 2003
Posts: 19
iprogramgames
Newbie
|
Newbie
Joined: Nov 2003
Posts: 19
|
A clearvelocity() function sounds great!!! Then I could do something like: var force[3]; force = 100000; me = pPlayer; you = pBall; clearvelocity(you); //new clear velocity function phent_enable(you,1); temp.x = cos(my.pan) * force; temp.y = sin(my.pan) * force; temp.z = 0; phent_addcentralforce(you,temp);
Newbie... yeah, right.
|
|
|
Re: Physics Engine doesn't disengage??
[Re: iprogramgames]
#19175
02/28/04 11:56
02/28/04 11:56
|
Joined: Mar 2003
Posts: 5,377 USofA
fastlane69
OP
Senior Expert
|
OP
Senior Expert
Joined: Mar 2003
Posts: 5,377
USofA
|
I think that would be GREAT Marco, though if it's going to do nothing diffrent than the velocity governor can do, then I'd stick to an addendum in the manual under phent_setmaxvelocity and perhaps optimize phent_setmaxvel so that on a 0,0,0 parameter pass, it acts like the clear velocity. What advantages, if any, would there be to a separate call to clear velocity? Maybe a complete kinematic wipe on an entity would be better, with velocity and force set to zero? That could be handy and if you only want vel zeroed, you'd use the governor or if you just want the force zeroed, you'd use a phent_addforce(null) call. On another note, you said: Quote:
which does perform a reset but is slow
Slow, huh? In order to completely reset a entities PE record (velocity and force and what else?), how many server frames should I give it? Right now I just have it under a wait(1) command.
|
|
|
Re: Physics Engine doesn't disengage??
[Re: fastlane69]
#19176
02/29/04 03:22
02/29/04 03:22
|
Joined: Nov 2003
Posts: 19
iprogramgames
Newbie
|
Newbie
Joined: Nov 2003
Posts: 19
|
I don't know what code is under the hood but I think altering phent_setmaxvel may cause problems as it's used to stop the entity after it's reached a certain velocity. Altering it the way you suggest would change it's behavior for paramaters of 0,0,0 only and I'm not sure that's such a good idea. It would probably be easier and cleaner to add different behaviors via new functions as opposed to altering existing ones.
Regardless of what code is "under the hood" I think we are both interested in a quick function that simply resets the variables to zero WITHOUT unregistering the entity. This way when we apply forces via phent_addvelocity we will know there are no existing forces already there. Is my assumption correct, because clearvelocity() definatly sounds like what I need.
Newbie... yeah, right.
|
|
|
Re: Physics Engine doesn't disengage??
[Re: fastlane69]
#19181
09/09/04 01:27
09/09/04 01:27
|
Joined: Sep 2004
Posts: 40
iprogramgames2
Newbie
|
Newbie
Joined: Sep 2004
Posts: 40
|
1. Has our "phent_clearvelocity()" function been added yet. I've been waiting a long time 2. Marco. I need my original forum account's email address reset so I can get my lost password. I've sent several emails that were supposed to be forworded to you. Have they made it? Al Tucker
|
|
|
|