Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 652 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Physics Engine doesn't disengage?? [Re: Marco_Grubert] #19163
02/25/04 10:05
02/25/04 10:05
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
No, I just checked it and velocity is not carried over between phent_settype() calls.

Re: Physics Engine doesn't disengage?? [Re: Marco_Grubert] #19164
02/25/04 11:49
02/25/04 11:49
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline OP
Senior Expert
fastlane69  Offline OP
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Hmmmm....I'll double check my functions and see what I can come up with code-wise.

I'll post back in a few once I rememeber and replicate this behaiviour. Thanks Marco

Re: Physics Engine doesn't disengage?? [Re: fastlane69] #19165
02/25/04 12:16
02/25/04 12:16
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Maybe you have an older version with different behavior. To double-check just write something like
Code:

phent_settype(my, PH_RIGID, PH_SPHERE);
phent_addcentralforce(my,...);
wait(50);
phent_settype(my, 0,0);
wait(50);
phent_settype(my, PH_RIGID, PH_SPHERE);

And see if it still moves.

Re: Physics Engine doesn't disengage?? [Re: Marco_Grubert] #19166
02/25/04 16:58
02/25/04 16:58
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline OP
Senior Expert
fastlane69  Offline OP
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
That's what I had thought my original tests had been, but I'm not 100%.

Will do it exactly as you say and get back to you.

Re: Physics Engine doesn't disengage?? [Re: fastlane69] #19167
02/26/04 02:08
02/26/04 02:08
Joined: Nov 2003
Posts: 19
iprogramgames Offline
Newbie
iprogramgames  Offline
Newbie

Joined: Nov 2003
Posts: 19
Okay, what you wrote here was fine. I'm trying to do this:


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:

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);

I'd rather not have to totally unregister and reregister as the collison box causes me to crash if I'm touching the entity when it is registered again. Doing this through phent_enable does not cause a crash.

One last observation. If my collision is set to PH_POLY I don't crash as much with the "register/unregister" method.


Newbie... yeah, right.
Re: Physics Engine doesn't disengage?? [Re: iprogramgames] #19168
02/26/04 02:11
02/26/04 02:11
Joined: Nov 2003
Posts: 19
iprogramgames Offline
Newbie
iprogramgames  Offline
Newbie

Joined: Nov 2003
Posts: 19
Please read my above comments as well but I'm trying to make sure that you know the problem is with phent_enable NOT phent_settype.

phent_enable carries the values over. I just checked it.


Newbie... yeah, right.
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
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

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)

Re: Physics Engine doesn't disengage?? [Re: Marco_Grubert] #19170
02/27/04 13:41
02/27/04 13:41
Joined: Nov 2003
Posts: 19
iprogramgames Offline
Newbie
iprogramgames  Offline
Newbie

Joined: Nov 2003
Posts: 19
Yes, I'm sorry. It was a typo. Here is an explination of my exact situation. I have a space vehicle and a ball. The vehicle touches the ball and disables the physics on the ball using phent_enable because I move the ball around with the vehicle using ent_move. While the vehicle (in this case the player) is flying around with the ball the player may fire the ball. When the player fires the ball I re-enable the ball by using phent_enable and something like the following code to "fire" the ball in the proper direction in relation to the player:

var force[3];

force = 100000;

me = pPlayer;
you = pBall;

phent_enable(you,1);

temp.x = cos(my.pan) * force;
temp.y = sin(my.pan) * force;
temp.z = 0;

phent_addcentralforce(you,temp);

I have noticed that the lower the force variable is set, the less accurate the results. I'm looking for speed as firing can be instant and waiting allows the player to bump back into the ball never releasing it. I've tried your phent_setmaxspeed suggestion and it stops the entity but still doesn't solve the problem. I'd like to be able to manually set the velocities to zero as opposed to waiting until a limit is reached. This way when the player picks up the ball I could set the velocities to zero and change them accuratly during the firing function.


Newbie... yeah, right.
Re: Physics Engine doesn't disengage?? [Re: Marco_Grubert] #19171
02/27/04 14:03
02/27/04 14:03
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline OP
Senior Expert
fastlane69  Offline OP
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
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.




First off, YES!!!! Finally recognition that I"m NOT nuts!!!

Secondly, just to make sure, this is expected behaiviour and not a bug?

If its not a bug, then what I takeaway from this is:

1)phent_enable is a PE pause button; it's still "engaged" to the PE (as per your "doesn't change velocity..." statement) while I can use phent_settype calls to actually disengage the engine and thus reset my entity.

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..


Finally, this could mean something, Ipro i'm doing the EXACT SAME THING....I'm disengagin my PE so I can move my ball around and then reengaging only when the player Throws the ball!!!!

Re: Physics Engine doesn't disengage?? [Re: fastlane69] #19172
02/28/04 02:24
02/28/04 02:24
Joined: Nov 2003
Posts: 19
iprogramgames Offline
Newbie
iprogramgames  Offline
Newbie

Joined: Nov 2003
Posts: 19
I almost missed what Marco_Grubert said and it confirms the phent_enable behavior. Here's what he wrote above:

Quote:


A disabled entity is excluded from having its position or velocity change over time. It is not unregistered or reset by that call.





I believe a new function to change the velocity while an entity is disabled would be nice as phent_settype is slow and will crash if the collision sphere of my physics ball is turned on while it is touching the player ship.


Newbie... yeah, right.
Page 2 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1