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.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/render/camera.cc b/src/render/camera.cc
index 8fe84a7..507a81f 100644
--- a/src/render/camera.cc
+++ b/src/render/camera.cc
@@ -173,19 +173,9 @@ void Camera::frame(float seconds)
if (mode() == Overview)
set_mode(Track);
- if (core::localcontrol()->state()) {
- camera_target.assign(core::localcontrol()->state()->location());
- target_axis.assign(core::localcontrol()->state()->axis());
- } else {
- camera_target.assign(core::localcontrol()->location());
- target_axis.assign(core::localcontrol()->axis());
- }
-
- if (core::localcontrol()->model()) {
- distance = core::localcontrol()->model()->radius();
- } else {
- distance = 1.0f;
- }
+ camera_target.assign(core::localcontrol()->state()->location());
+ target_axis.assign(core::localcontrol()->state()->axis());
+ distance = core::localcontrol()->radius();
if (mode() == Track) {
float cosangle;
@@ -326,12 +316,14 @@ void Camera::draw()
math::Matrix4f matrix;
matrix.assign(camera_axis);
gl::multmatrix(matrix.transpose());
-
+/*
// match the camera with the current target
gl::translate(-1.0f * camera_target);
// apply camera offset
gl::translate(distance * camera_axis.forward());
+*/
+ gl::translate(-1.0f * camera_eye);
}
void Camera::set_direction(float direction)