diff options
Diffstat (limited to 'src/render/camera.cc')
-rw-r--r-- | src/render/camera.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/render/camera.cc b/src/render/camera.cc index 7f1f307..5a6607f 100644 --- a/src/render/camera.cc +++ b/src/render/camera.cc @@ -286,12 +286,18 @@ void Camera::draw(float seconds) camera_axis.change_pitch(pitch_current); } else if (mode() == Cockpit) { + camera_axis.assign(target_axis); - if (core::localcontrol()->state() && core::localcontrol()->model()) - camera_target += (core::localcontrol()->model()->maxbbox().x+0.05) * - core::localcontrol()->state()->axis().forward(); - + if (core::localcontrol()->state()) { + if (core::localcontrol()->model()) { + camera_target += (core::localcontrol()->model()->maxbbox().x+0.05) * + core::localcontrol()->state()->axis().forward(); + } else { + camera_target += (core::localcontrol()->radius() + 0.05) * + core::localcontrol()->state()->axis().forward(); + } + } distance = 0.0f; } } |