Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/camera.cc')
-rw-r--r--src/render/camera.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/render/camera.cc b/src/render/camera.cc
index 875b147..c136375 100644
--- a/src/render/camera.cc
+++ b/src/render/camera.cc
@@ -98,10 +98,7 @@ void Camera::set_mode(Mode newmode) {
// switch camera to Track mode
camera_mode = Track;
if (core::localcontrol()) {
- if (core::localcontrol()->state())
- camera_axis.assign(core::localcontrol()->state()->axis());
- else
- camera_axis.assign(core::localcontrol()->axis());
+ camera_axis.assign(core::localcontrol()->axis());
}
break;
@@ -242,8 +239,8 @@ void Camera::frame(float seconds)
}
} else {
- camera_target.assign(core::localcontrol()->state()->location());
- target_axis.assign(core::localcontrol()->state()->axis());
+ camera_target.assign(core::localcontrol()->location());
+ target_axis.assign(core::localcontrol()->axis());
distance = core::localcontrol()->radius();
if (mode() == Track) {
@@ -306,14 +303,12 @@ void Camera::frame(float seconds)
camera_axis.assign(target_axis);
- 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();
- }
+ if (core::localcontrol()->model()) {
+ camera_target += (core::localcontrol()->model()->maxbbox().x+0.05) *
+ core::localcontrol()->axis().forward();
+ } else {
+ camera_target += (core::localcontrol()->radius() + 0.05) *
+ core::localcontrol()->axis().forward();
}
distance = 0.0f;
}