[Fix] Fixed the horrible rotating in external view. Also, the ships almost look badass now!

This commit is contained in:
Rtch90 2017-11-12 19:11:14 +00:00
parent caba05d699
commit 50c5b3da0f
2 changed files with 6 additions and 4 deletions

View File

@ -56,6 +56,10 @@ void Player::AITurn(void) {
float time_step = L3D::GetTimeStep(); float time_step = L3D::GetTimeStep();
float ts2 = time_step*time_step; float ts2 = time_step*time_step;
SetAngThrusterState(0, 0.0f);
SetAngThrusterState(1, 0.0f);
SetAngThrusterState(2, 0.0f);
if(time_step == 0) return; if(time_step == 0) return;
if(GetDockedWith()) return; if(GetDockedWith()) return;
@ -105,14 +109,12 @@ void Player::AITurn(void) {
} }
if(time_step > 10) { if(time_step > 10) {
dBodySetAngularVel(m_body, 0, 0, 0); dBodySetAngularVel(m_body, 0, 0, 0);
SetAngThrusterState(0, 0.0f);
SetAngThrusterState(1, 0.0f);
SetAngThrusterState(2, 0.0f);
} }
if(L3D::GetCamType() == L3D::CAM_EXTERNAL) { if(L3D::GetCamType() == L3D::CAM_EXTERNAL) {
if(L3D::KeyState(SDLK_UP)) m_external_view_rotx -= 1; if(L3D::KeyState(SDLK_UP)) m_external_view_rotx -= 1;
if(L3D::KeyState(SDLK_DOWN)) m_external_view_rotx += 1; if(L3D::KeyState(SDLK_DOWN)) m_external_view_rotx += 1;
if(L3D::KeyState(SDLK_LEFT)) m_external_view_roty -= 1; if(L3D::KeyState(SDLK_LEFT)) m_external_view_roty -= 1;
if(L3D::KeyState(SDLK_RIGHT)) m_external_view_roty += 1;
if(L3D::KeyState(SDLK_EQUALS)) m_external_view_dist -= 10; if(L3D::KeyState(SDLK_EQUALS)) m_external_view_dist -= 10;
if(L3D::KeyState(SDLK_MINUS)) m_external_view_dist += 10; if(L3D::KeyState(SDLK_MINUS)) m_external_view_dist += 10;
m_external_view_dist = MAX(50, m_external_view_dist); m_external_view_dist = MAX(50, m_external_view_dist);

View File

@ -135,6 +135,6 @@ void Ship::Render(const Frame* camFrame) {
params.linthrust[2] = m_thrusters[ShipType::THRUSTER_REAR] - m_thrusters[ShipType::THRUSTER_FRONT]; params.linthrust[2] = m_thrusters[ShipType::THRUSTER_REAR] - m_thrusters[ShipType::THRUSTER_FRONT];
strncpy(params.pText[0], GetLabel().c_str(), sizeof(params.pText)); strncpy(params.pText[0], GetLabel().c_str(), sizeof(params.pText));
RenderSbreModel(camFrame, 13, &params); RenderSbreModel(camFrame, 10, &params);
} }