Speed boost
#9

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
I don't understand what you mean with the dynamic coordinates.
pawn Код:
(1/sqrt(2) + 1/sqrt(2), 1/sqrt(2) + 1/sqrt(2), 0) = (dX, dY, dZ)
Like this, i don't understand what you mean by that?
By "dynamic Coordinates" I mean a second coordinate system.
So not only the static X Y Z that you have by default. Imagine a new center of coordinates at the vehicle, pointing into the vehicle direction, let's say: dX to the side of the vehicle, dY to the front of the vehicle, dZ to the roof of the vehicle.
This coordinate system is always moving with the vehicle. dY is always pointing into the direction that your vehicle is heading, dX (if your vehicle is not drifting) is pointing to the side (doors) and dZ upwards.
Basicly the same as the x/y/z offset for attached objects to the vehicle.


(I've added a small image for that as attachment)
Then you could use trigonometry (not sure how it's called in english) with sin, cos, and tan
dY would then be: sin(angle) = Y/dY
dX: sin(angle) = X/dX
if I'm not wrong now...

You can then easily calculate
dXspeed = Xspeed/sin(angle) + Yspeed/cos(angle)
dYspeed = Yspeed/sin(angle) + Xspeed/cos(angle)

As you are most often moving into 2 direction (x and y) you need to add both proportions to get the complete speed for the vehicle based coordinates.

dXspeed would then show the total speed pointing sideways to the car direction and dYspeed would be the complete speed into the direction the vehicle is moving in.
You then could just set "dXspeed" and "dYspeed" for the x and y parameter in theSetVehicleVelocity... at least this is working in my head, there might be some "small" mathematic mistake in it though




Edit: mind the edit
Reply


Messages In This Thread
Speed boost - by CalvinC - 31.03.2015, 15:01
Re: Speed boost - by Sascha - 31.03.2015, 18:14
Re: Speed boost - by CalvinC - 31.03.2015, 18:32
Re: Speed boost - by Sascha - 31.03.2015, 19:04
Re: Speed boost - by CalvinC - 31.03.2015, 20:18
Re: Speed boost - by Gammix - 01.04.2015, 06:42
Re: Speed boost - by CalvinC - 01.04.2015, 09:33
Re: Speed boost - by BroZeus - 01.04.2015, 09:59
Re: Speed boost - by Sascha - 01.04.2015, 23:50

Forum Jump:


Users browsing this thread: 1 Guest(s)