From 0ddeaa196731299e443d96e9f2797d8247c0de97 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 25 Mar 2013 18:45:42 -0600 Subject: for SH-3927: Interesting: Viewer should send predicted camera position to simulator to control object load order --- indra/newview/llface.cpp | 2 -- indra/newview/llviewercamera.h | 2 +- indra/newview/llviewermessage.cpp | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 28e4b32793..56619563cf 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -2346,8 +2346,6 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist) return 0.f ; } - //F32 camera_relative_speed = camera_moving_speed * (lookAt * LLViewerCamera::getInstance()->getVelocityDir()) ; - S32 i = 0 ; for(i = 0; i < FACE_IMPORTANCE_LEVEL && dist > FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[i][0]; ++i); i = llmin(i, FACE_IMPORTANCE_LEVEL - 1) ; diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index ffec284f72..d7835d8567 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -100,7 +100,7 @@ public: BOOL projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoordGL &out_point, const BOOL clamp = TRUE) const; BOOL projectPosAgentToScreenEdge(const LLVector3 &pos_agent, LLCoordGL &out_point) const; - const LLVector3* getVelocityDir() const {return &mVelocityDir;} + LLVector3 getVelocityDir() const {return mVelocityDir;} static LLTrace::CountStatHandle<>* getVelocityStat() {return &sVelocityStat; } static LLTrace::CountStatHandle<>* getAngularVelocityStat() {return &sAngularVelocityStat; } F32 getCosHalfFov() {return mCosHalfCameraFOV;} diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4b1c9c5574..8dc72ba5b4 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4222,6 +4222,9 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) LLQuaternion head_rotation = gAgent.getHeadRotation(); camera_pos_agent = gAgentCamera.getCameraPositionAgent(); + LLVector3 camera_velocity = LLViewerCamera::getInstance()->getVelocityDir() * LLViewerCamera::getInstance()->getAverageSpeed(); + F32 time_delta = 1.0f; //predict the camera position in 1 second + camera_pos_agent += camera_velocity * time_delta; render_state = gAgent.getRenderState(); -- cgit v1.2.3