|
|
Re: Physics Engine doesn't disengage??
[Re: iprogramgames]
#19169
02/27/04 11:48
02/27/04 11:48
|
Joined: Sep 2003
Posts: 3,236 San Diego, CA
Marco_Grubert
Expert
|
Expert
Joined: Sep 2003
Posts: 3,236
San Diego, CA
|
Quote:
phent_enable(me,0); temp.x = cos(my.pan) * force; temp.y = sin(my.pan) * force; temp.z = 0; phent_enable(me,1); phent_addcentralforce(you,temp); Now, it seems to work SOMETIMES. But other times it simply won't unless written like this:
The above code retains the object's velocity past the phent_enable() calls. A disabled entity is excluded from having its position or velocity change over time. It is not unregistered or reset by that call.
Quote:
wait(1); phent_settype(me, 0, 0); temp.x = cos(my.pan) * force; temp.y = sin(my.pan) * force; temp.z = 0; phent_settype(me, PH_RIGID, PH_SPHERE); phent_addcentralforce(you,temp);
In this example you can think of the first me and the second me (or you due to the typo) as being 2 separate objects that have nothing to do with each other. What do you want to achieve? If it's just setting the velocity to 0 you could call phent_setmaxspeed(me,0,0) and wait one time unit (== 1.0/PH_FPS_MAX_LOCK)
|
|
|
|
|
|