5 minutes
Make the Ship Move on Its Own
Last lesson the falcon learned which way it points. It still doesn't go anywhere. Set ry, reload, and the ship is at the new heading — it never travelled there. Changing a pose by hand is teleporting, and a fighter that teleports isn't flying.
Flying needs two things this scene doesn't have: a velocity, and something that adds that velocity to the pose every frame, on its own.
Add Velocity6DOF next to the transform
Give the player a Velocity6DOF next to its Transform6DOF:
Empty braces mean the ship starts at rest. Transform6DOF says where the falcon is; Velocity6DOF says where it's going, and it carries two separate velocities:
Six numbers, and the two halves live in different reference frames on purpose.
vx / vy / vz is linear velocity in world space, units per second. Keeping it in world space is what makes the ship feel like it's in space: coast forward, yaw hard, and you keep sliding along the old line while the nose swings away. There's no air out here to bend your path for you. (It also means next lesson's flight law has to rotate nose-direction thrust into world space before it can land here.)
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.