Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 779 vs 780 for /trunk/Source Code/Rendering/Camera/Camera.cpp

Diff revisions: vs.
  @@ -70,49 +70,32 @@
70 70 _cameraZoomSpeed = _zoomSpeedFactor * timeFactor;
71 71 }
72 72
73 - void Camera::updateProjection(bool updateGPU) {
73 + void Camera::updateProjection() {
74 74 assert(_isActive);
75 75
76 - if (updateGPU) {
77 - GFXDevice& gfx = GFX_DEVICE;
78 -
79 - F32* projectionMatrixData =
80 - _isOrthoCamera ? gfx.setProjection(_orthoRect,
81 - _zPlanes)
82 -
83 - : gfx.setProjection(_verticalFoV,
84 - _aspectRatio,
85 - _zPlanes);
86 - if (_projectionDirty) {
87 - _projectionMatrix.set(projectionMatrixData);
88 - _frustumDirty = true;
89 - _projectionDirty = false;
90 - }
91 -
92 - } else {
93 - if (_projectionDirty) {
94 - if (_isOrthoCamera) {
95 - _projectionMatrix.ortho(_orthoRect.x,
96 - _orthoRect.y,
97 - _orthoRect.z,
98 - _orthoRect.w,
99 - _zPlanes.x,
100 - _zPlanes.y);
101 - } else {
102 - _projectionMatrix.perspective(Angle::DegreesToRadians(_verticalFoV),
103 - _aspectRatio,
104 - _zPlanes.x,
105 - _zPlanes.y);
106 - }
107 - _frustumDirty = true;
108 - _projectionDirty = false;
76 + if (_projectionDirty) {
77 + if (_isOrthoCamera) {
78 + _projectionMatrix.ortho(_orthoRect.x,
79 + _orthoRect.y,
80 + _orthoRect.z,
81 + _orthoRect.w,
82 + _zPlanes.x,
83 + _zPlanes.y);
84 + } else {
85 + _projectionMatrix.perspective(Angle::DegreesToRadians(_verticalFoV),
86 + _aspectRatio,
87 + _zPlanes.x,
88 + _zPlanes.y);
109 89 }
90 + _frustumDirty = true;
91 + _projectionDirty = false;
110 92 }
93 +
111 94 }
112 95
113 96 void Camera::onActivate() {
114 97 _isActive = true;
115 - updateProjection(false);
98 + updateProjection();
116 99 }
117 100
118 101 void Camera::onDeactivate() {
  @@ -265,15 +248,12 @@
265 248 }
266 249
267 250 /// Tell the rendering API to set up our desired PoV
268 - void Camera::renderLookAt(mat4<F32>& viewMatrixOut, vec3<F32>& eyeVecOut) {
251 + void Camera::updateLookAt() {
269 252 updateViewMatrix();
270 253 updateProjection();
271 254 updateFrustum();
272 255 // Inform all listeners of a new event
273 256 updateListeners();
274 -
275 - viewMatrixOut = _viewMatrix;
276 - eyeVecOut = _eye;
277 257 }
278 258
279 259 void Camera::reflect(const Plane<F32>& reflectionPlane) {