summaryrefslogtreecommitdiff
path: root/indra/newview/llviewercamera.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2014-03-24 19:23:34 -0700
committerRichard Linden <none@none>2014-03-24 19:23:34 -0700
commite5bbdafdeda0f2e6bbe97d59a24ca398b54c31eb (patch)
tree359719c76abf090fb8cc5ae912ed013b64cb8fc7 /indra/newview/llviewercamera.cpp
parent31a3a3da5db077c4d9b8fe06a18de98c822db6ab (diff)
parent5b846ed2a6dce6c5801aa74d0f36a1c7525fbcba (diff)
merge with release
Diffstat (limited to 'indra/newview/llviewercamera.cpp')
-rwxr-xr-xindra/newview/llviewercamera.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index b5aa0ac92a..57a0195d23 100755
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -49,11 +49,15 @@
#include "llglheaders.h"
#include "llquaternion.h"
#include "llwindow.h" // getPixelAspectRatio()
+#include "lltracerecording.h"
// System includes
#include <iomanip> // for setprecision
-U32 LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
+LLTrace::CountStatHandle<> LLViewerCamera::sVelocityStat("camera_velocity");
+LLTrace::CountStatHandle<> LLViewerCamera::sAngularVelocityStat("camera_angular_velocity");
+
+LLViewerCamera::eCameraID LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
//glu pick matrix implementation borrowed from Mesa3D
glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport)
@@ -151,7 +155,7 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center,
setOriginAndLookAt(origin, up_direction, point_of_interest);
- mVelocityDir = center - last_position ;
+ mVelocityDir = origin - last_position ;
F32 dpos = mVelocityDir.normVec() ;
LLQuaternion rotation;
rotation.shortestArc(last_axis, getAtAxis());
@@ -160,11 +164,11 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center,
F32 drot;
rotation.getAngleAxis(&drot, &x, &y, &z);
- mVelocityStat.addValue(dpos);
- mAngularVelocityStat.addValue(drot);
+ add(sVelocityStat, dpos);
+ add(sAngularVelocityStat, drot);
- mAverageSpeed = mVelocityStat.getMeanPerSec() ;
- mAverageAngularSpeed = mAngularVelocityStat.getMeanPerSec() ;
+ mAverageSpeed = LLTrace::get_frame_recording().getPeriodMeanPerSec(sVelocityStat, 50);
+ mAverageAngularSpeed = LLTrace::get_frame_recording().getPeriodMeanPerSec(sAngularVelocityStat);
mCosHalfCameraFOV = cosf(0.5f * getView() * llmax(1.0f, getAspect()));
// update pixel meter ratio using default fov, not modified one