Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
5 registered members (TipmyPip, clint000, Grant, chsmac85, Martin_HH), 5,858 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
displacement and velocity in physics engine #84679
08/05/06 20:32
08/05/06 20:32
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Hello,
I have a code that do the calculation of the velocity needed for an object to travel a given distance (go from point A and stops exactly in point B):

Code:

distance = vec_dist(pointA.x, pointB.x);
velocity.x = distance * time_step;
accel.x = velocity.x / time_step;
displacement.x = velocity.x * time_step;
c_move(me,displacement.x,nullvector,ignore_you+glide);



However im trying to adapt this system with the physics engine and i´ve made several tests using phent_addvelcentral but i can´t make it work. I just ask for some guidelines because i´m stuck in this. Thanks in advance.
Cheers.

Re: displacement and velocity in physics engine [Re: demiGod] #84680
08/06/06 12:34
08/06/06 12:34
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline
Expert
A.Russell  Offline
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
I am sort of surprised that that works at all.

Anyway, to do it with the physics engine is more complicated, because you need to take into account things like friction, force and mass -not only velocity. The physics engine uses an ODE solver which will give quite different results from simple Euler equations (EDIT> in this case that wouldn't matter because you only want to find the force required to push the object to the target location)

You'll need to more information, like if the object is rolling or sliding, the friction co-efficient of the surface, the slope of the surface, the mass of the object. Once you have all that, ask an expert, because it would give me a head-ache. Fastlane69 is probably your best bet, if you can get hold of him.

Last edited by A.Russell; 08/06/06 17:04.
Re: displacement and velocity in physics engine [Re: A.Russell] #84681
08/06/06 13:44
08/06/06 13:44
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Thanks for your reply.
Well, i am surprised too, i thought the physics engine was meant to simplify those complicated equations... Thanks anyway.
Cheers.


Moderated by  HeelX, Spirit 

Gamestudio download | 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