diff options
| author | Richard Linden <none@none> | 2014-02-12 10:32:02 -0800 |
|---|---|---|
| committer | Richard Linden <none@none> | 2014-02-12 10:32:02 -0800 |
| commit | 5866bb7ef09b786f8f195770a70dc4289d183ca0 (patch) | |
| tree | 0be3b5e63506bf30edd3748f9e31740ae9ebbaa8 /indra/newview/llviewercamera.cpp | |
| parent | 413be91cf5044889ade97dcbec4b17fceff122e3 (diff) | |
| parent | a8192fbf60540e42dcff5f1efb8bf8cafbfac484 (diff) | |
merge with release
Diffstat (limited to 'indra/newview/llviewercamera.cpp')
| -rwxr-xr-x | indra/newview/llviewercamera.cpp | 16 |
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 ¢er, 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 ¢er, 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 |
