Skip to content

Commit

Permalink
added new video
Browse files Browse the repository at this point in the history
  • Loading branch information
gue-ni committed Feb 18, 2023
1 parent 9fb5722 commit 2af6611
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OpenGL_Flightsim/flightmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct Aircraft
if ((log_timer += dt) > 0.5f)
{
log_timer = 0;
#if 1
#if 0
printf(
"%.2f km/h, thr: %.2f, alt: %.2f m\n",
phi::units::kilometer_per_hour(glm::length(rigid_body.velocity)),
Expand Down
6 changes: 4 additions & 2 deletions OpenGL_Flightsim/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ int main(void)

get_keyboard_state(joystick, dt);

player_aircraft.joystick = glm::vec3(joystick.roll, joystick.yaw, joystick.pitch);
//player_aircraft.joystick = glm::vec3(joystick.roll, joystick.yaw, joystick.pitch);
std::cout << player_aircraft.joystick << std::endl;
player_aircraft.joystick = glm::vec3(joystick.roll, 0.0f, joystick.pitch);
player_aircraft.engine.throttle = joystick.throttle;

if (!paused)
Expand Down Expand Up @@ -439,7 +441,7 @@ inline float center(float value, float factor, float dt)

void get_keyboard_state(Joystick& joystick, phi::Seconds dt)
{
const glm::vec3 factor = {3.0f, 3.0f, 3.0f}; // roll, yaw, pitch
const glm::vec3 factor = {3.0f, 3.0f, 1.0f}; // roll, yaw, pitch
const uint8_t* key_states = SDL_GetKeyboardState(NULL);

if (key_states[SDL_SCANCODE_A])
Expand Down
Binary file not shown.

0 comments on commit 2af6611

Please sign in to comment.