Overview
This is a simple flight simulator that applies Newtonian physics on a helicopter model, treating it as a point mass. The helicopter can move vertically and horizontally, and can change its yaw angle. The operations are done by (1) applying force and/or torque to the point mass, (2) calculating linear and angular acceleration according to Newton's Law, and (3) calculate linear and angular drag/damping, linear and angular velocity, position, and rotation. Air drag is dependent on the velocity, and angular damping depends on the angular velocity so the velocity and angular velocity are capped and will decrease to 0 if given no input. The terrain is generated using Perlin noise, and it collides with the helicopter. If the acceleration of the helicopter is above 50 m/s^2, it is considered "crashed" and all physical parameters of the helicopter will be reset to its initial state.
Operation
- w: Apply a force pointing towards the forward direction of the helicopter.
- s: Apply a force pointing towards the backward direction of the helicopter.
- a: Apply a force pointing towards the left of the helicopter.
- d: Apply a force pointing towards the right of the helicopter.
- i: Apply a force pointing towards the positive-y direction (up).
- k: Remove lift (free fall with air drag).
- j: Apply a counterclockwise torque.
- l: Apply a clockwise torque.
Tools & Libraries
- C++
- GLM, GLFW, and GLEW
- Tinyobjloader
- Perlin noise generation reference