Our Servers > Expression 2 (E2) Code

E2 - orbiting ship

(1/2) > >>

kevinminion:
I'd like to have a chip that will allow my ship to orbit a planet.  Possibly using the aimVector and a low MaxKPH on my gyro pod.   Open to other solutions as well, I may be thinking about this all wrong, thus making it overly complex.

Assuming I know the planet center location and the radius:
  Maintain a Z value of planet center + 1/2 radius
  Maintain an orbit the same radius as the planet
  I would think calculating the correct yaw angle and then going "Forward" would be easiest, but I'm not sure how to make that into the AimVec for the gyropod input.
 
Thanks for any help in anvance...

bloxgate:
X_1 = X_0 + Z\cos(\theta + \Delta \theta)$(".jslatex1").latex();Y_1 = Y_0 + Z\sin(\theta + \Delta \theta)$(".jslatex2").latex();\Delta\theta = \frac{2\pi Z}{t}$(".jslatex3").latex();
See: https://gamedev.stackexchange.com/questions/9607/moving-an-object-in-a-circular-path

kevinminion:
Moving a holo entity around using setPos using equations like this is a bit easier...


I'm trying to figure out how to control a gyropod to orbit the planet in a similar fashion.

RendStung:
It's simple, make it go up and set AimPos to the center of the planet.

kevinminion:
To circle/orbit a target I would set the AimVec to the target's position and MoveLeft/Right or MoveUp/Down.  That is a pretty standard practice, even from the years of NightHawk. 
However, I would like my ship's facing direction to maybe be 90° offset (normal) of the vector of the orbit center and the ship.

Navigation

[0] Message Index

[#] Next page

Go to full version