History

Removing access to the gl widget and display managers

Brad Davis committed 11 years ago

Commit 302aa9d1 parent 539063035 files · +401 −440Browse files

Showing the changes to interface/src/Camera.cpp (1 of 35 files). Show all

Unified · Split

interface/src/Camera.cpp+1−49
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include "Camera.h"
1818 #include "Menu.h"
1919 #include "Util.h"
20−#include "devices/OculusManager.h"
2120
2221
2322 CameraMode stringToMode(const QString& mode) {
@@ -54,42 +53,24 @@ Camera::Camera() : · 30 unmodified lines
5453 _nearClip(DEFAULT_NEAR_CLIP), // default
5554 _farClip(DEFAULT_FAR_CLIP), // default
5655 _hmdPosition(),
57− _hmdRotation(),
58− _isKeepLookingAt(false),
59− _lookingAt(0.0f, 0.0f, 0.0f)
56+ _hmdRotation()
6057 {
6158 }
6259
63−void Camera::update(float deltaTime) {
64− if (_isKeepLookingAt) {
65− lookAt(_lookingAt);
66− }
67− return;
68−}
69−
7060 void Camera::setPosition(const glm::vec3& position) {
7161 _position = position;
7262 }
7363
7464 void Camera::setRotation(const glm::quat& rotation) {
7565 _rotation = rotation;
76− if (_isKeepLookingAt) {
77− lookAt(_lookingAt);
78− }
7966 }
8067
8168 void Camera::setHmdPosition(const glm::vec3& hmdPosition) {
8269 _hmdPosition = hmdPosition;
83− if (_isKeepLookingAt) {
84− lookAt(_lookingAt);
85− }
8670 }
8771
8872 void Camera::setHmdRotation(const glm::quat& hmdRotation) {
8973 _hmdRotation = hmdRotation;
90− if (_isKeepLookingAt) {
91− lookAt(_lookingAt);
92− }
9374 }
9475
9576 float Camera::getFarClip() const {
@@ -120,21 +101,6 @@ void Camera::setFarClip(float f) { · 24 unmodified lines
120101 _farClip = f;
121102 }
122103
123−PickRay Camera::computePickRay(float x, float y) {
124− auto glCanvas = Application::getInstance()->getGLWidget();
125− return computeViewPickRay(x / glCanvas->width(), y / glCanvas->height());
126−}
127−
128−PickRay Camera::computeViewPickRay(float xRatio, float yRatio) {
129− PickRay result;
130− if (OculusManager::isConnected()) {
131− Application::getInstance()->getApplicationOverlay().computeOculusPickRay(xRatio, yRatio, result.origin, result.direction);
132− } else {
133− Application::getInstance()->getViewFrustum()->computePickRay(xRatio, yRatio, result.origin, result.direction);
134− }
135− return result;
136−}
137−
138104 void Camera::setModeString(const QString& mode) {
139105 CameraMode targetMode = stringToMode(mode);
140106
@@ -163,17 +129,3 @@ void Camera::setModeString(const QString& mode) { · 22 unmodified lines
163129 QString Camera::getModeString() const {
164130 return modeToString(_mode);
165131 }
166−
167−void Camera::lookAt(const glm::vec3& lookAt) {
168− glm::vec3 up = IDENTITY_UP;
169− glm::mat4 lookAtMatrix = glm::lookAt(_position, lookAt, up);
170− glm::quat rotation = glm::quat_cast(lookAtMatrix);
171− rotation.w = -rotation.w; // Rosedale approved
172− _rotation = rotation;
173−}
174−
175−void Camera::keepLookingAt(const glm::vec3& point) {
176− lookAt(point);
177− _isKeepLookingAt = true;
178− _lookingAt = point;
179−}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t