diff options
Diffstat (limited to 'indra/newview/llagentcamera.cpp')
-rw-r--r-- | indra/newview/llagentcamera.cpp | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 62f1746f28..2dd523cb24 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -374,7 +374,7 @@ void LLAgentCamera::unlockView() { if (isAgentAvatarValid()) { - setFocusGlobal(LLVector3d::zero, gAgentAvatar->mID); + setFocusGlobal(LLVector3d::zero, gAgentAvatarp->mID); } setFocusOnAvatar(FALSE, FALSE); // no animation } @@ -1093,23 +1093,23 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) if (!isAgentAvatarValid()) return; - LLQuaternion av_inv_rot = ~gAgentAvatar->mRoot.getWorldRotation(); - LLVector3 root_at = LLVector3::x_axis * gAgentAvatar->mRoot.getWorldRotation(); + LLQuaternion av_inv_rot = ~gAgentAvatarp->mRoot.getWorldRotation(); + LLVector3 root_at = LLVector3::x_axis * gAgentAvatarp->mRoot.getWorldRotation(); if ((gViewerWindow->getMouseVelocityStat()->getCurrent() < 0.01f) && (root_at * last_at_axis > 0.95f)) { - LLVector3 vel = gAgentAvatar->getVelocity(); + LLVector3 vel = gAgentAvatarp->getVelocity(); if (vel.magVecSquared() > 4.f) { - setLookAt(LOOKAT_TARGET_IDLE, gAgentAvatar, vel * av_inv_rot); + setLookAt(LOOKAT_TARGET_IDLE, gAgentAvatarp, vel * av_inv_rot); } else { // *FIX: rotate mframeagent by sit object's rotation? - LLQuaternion look_rotation = gAgentAvatar->isSitting() ? gAgentAvatar->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); // use camera's current rotation + LLQuaternion look_rotation = gAgentAvatarp->isSitting() ? gAgentAvatarp->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); // use camera's current rotation LLVector3 look_offset = LLVector3(2.f, 0.f, 0.f) * look_rotation * av_inv_rot; - setLookAt(LOOKAT_TARGET_IDLE, gAgentAvatar, look_offset); + setLookAt(LOOKAT_TARGET_IDLE, gAgentAvatarp, look_offset); } last_at_axis = root_at; return; @@ -1119,7 +1119,7 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) if (CAMERA_MODE_CUSTOMIZE_AVATAR == getCameraMode()) { - setLookAt(LOOKAT_TARGET_NONE, gAgentAvatar, LLVector3(-2.f, 0.f, 0.f)); + setLookAt(LOOKAT_TARGET_NONE, gAgentAvatarp, LLVector3(-2.f, 0.f, 0.f)); } else { @@ -1148,7 +1148,7 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) headLookAxis = frameCamera.getAtAxis(); // RN: we use world-space offset for mouselook and freelook //headLookAxis = headLookAxis * av_inv_rot; - setLookAt(lookAtType, gAgentAvatar, headLookAxis); + setLookAt(lookAtType, gAgentAvatarp, headLookAxis); } } @@ -1170,12 +1170,12 @@ void LLAgentCamera::updateCamera() validateFocusObject(); if (isAgentAvatarValid() && - gAgentAvatar->isSitting() && + gAgentAvatarp->isSitting() && camera_mode == CAMERA_MODE_MOUSELOOK) { //Ventrella //changed camera_skyward to the new global "mCameraUpVector" - mCameraUpVector = mCameraUpVector * gAgentAvatar->getRenderRotation(); + mCameraUpVector = mCameraUpVector * gAgentAvatarp->getRenderRotation(); //end Ventrella } @@ -1291,13 +1291,13 @@ void LLAgentCamera::updateCamera() // (2) focus, and (3) upvector. They can then be queried elsewhere in llAgent. //-------------------------------------------------------------------------------- // *TODO: use combined rotation of frameagent and sit object - LLQuaternion avatarRotationForFollowCam = gAgentAvatar->isSitting() ? gAgentAvatar->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); + LLQuaternion avatarRotationForFollowCam = gAgentAvatarp->isSitting() ? gAgentAvatarp->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); LLFollowCamParams* current_cam = LLFollowCamMgr::getActiveFollowCamParams(); if (current_cam) { mFollowCam.copyParams(*current_cam); - mFollowCam.setSubjectPositionAndRotation( gAgentAvatar->getRenderPosition(), avatarRotationForFollowCam ); + mFollowCam.setSubjectPositionAndRotation( gAgentAvatarp->getRenderPosition(), avatarRotationForFollowCam ); mFollowCam.update(); LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true); } @@ -1374,7 +1374,7 @@ void LLAgentCamera::updateCamera() if (isAgentAvatarValid() && (mCameraMode != CAMERA_MODE_MOUSELOOK)) { - gAgentAvatar->updateAttachmentVisibility(mCameraMode); + gAgentAvatarp->updateAttachmentVisibility(mCameraMode); } } else @@ -1472,40 +1472,40 @@ void LLAgentCamera::updateCamera() } gAgent.setLastPositionGlobal(global_pos); - if (LLVOAvatar::sVisibleInFirstPerson && isAgentAvatarValid() && !gAgentAvatar->isSitting() && cameraMouselook()) + if (LLVOAvatar::sVisibleInFirstPerson && isAgentAvatarValid() && !gAgentAvatarp->isSitting() && cameraMouselook()) { - LLVector3 head_pos = gAgentAvatar->mHeadp->getWorldPosition() + - LLVector3(0.08f, 0.f, 0.05f) * gAgentAvatar->mHeadp->getWorldRotation() + - LLVector3(0.1f, 0.f, 0.f) * gAgentAvatar->mPelvisp->getWorldRotation(); + LLVector3 head_pos = gAgentAvatarp->mHeadp->getWorldPosition() + + LLVector3(0.08f, 0.f, 0.05f) * gAgentAvatarp->mHeadp->getWorldRotation() + + LLVector3(0.1f, 0.f, 0.f) * gAgentAvatarp->mPelvisp->getWorldRotation(); LLVector3 diff = mCameraPositionAgent - head_pos; - diff = diff * ~gAgentAvatar->mRoot.getWorldRotation(); + diff = diff * ~gAgentAvatarp->mRoot.getWorldRotation(); - LLJoint* torso_joint = gAgentAvatar->mTorsop; - LLJoint* chest_joint = gAgentAvatar->mChestp; + LLJoint* torso_joint = gAgentAvatarp->mTorsop; + LLJoint* chest_joint = gAgentAvatarp->mChestp; LLVector3 torso_scale = torso_joint->getScale(); LLVector3 chest_scale = chest_joint->getScale(); // shorten avatar skeleton to avoid foot interpenetration - if (!gAgentAvatar->mInAir) + if (!gAgentAvatarp->mInAir) { LLVector3 chest_offset = LLVector3(0.f, 0.f, chest_joint->getPosition().mV[VZ]) * torso_joint->getWorldRotation(); F32 z_compensate = llclamp(-diff.mV[VZ], -0.2f, 1.f); F32 scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / chest_offset.mV[VZ]), 0.5f, 1.2f); torso_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); - LLJoint* neck_joint = gAgentAvatar->mNeckp; + LLJoint* neck_joint = gAgentAvatarp->mNeckp; LLVector3 neck_offset = LLVector3(0.f, 0.f, neck_joint->getPosition().mV[VZ]) * chest_joint->getWorldRotation(); scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / neck_offset.mV[VZ]), 0.5f, 1.2f); chest_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); diff.mV[VZ] = 0.f; } - gAgentAvatar->mPelvisp->setPosition(gAgentAvatar->mPelvisp->getPosition() + diff); + gAgentAvatarp->mPelvisp->setPosition(gAgentAvatarp->mPelvisp->getPosition() + diff); - gAgentAvatar->mRoot.updateWorldMatrixChildren(); + gAgentAvatarp->mRoot.updateWorldMatrixChildren(); - for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatar->mAttachmentPoints.begin(); - iter != gAgentAvatar->mAttachmentPoints.end(); ) + for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); + iter != gAgentAvatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; @@ -1607,12 +1607,12 @@ LLVector3d LLAgentCamera::calcFocusPositionTargetGlobal() { LLVector3d at_axis(1.0, 0.0, 0.0); LLQuaternion agent_rot = gAgent.getFrameAgent().getQuaternion(); - if (isAgentAvatarValid() && gAgentAvatar->getParent()) + if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { - LLViewerObject* root_object = (LLViewerObject*)gAgentAvatar->getRoot(); + LLViewerObject* root_object = (LLViewerObject*)gAgentAvatarp->getRoot(); if (!root_object->flagCameraDecoupled()) { - agent_rot *= ((LLViewerObject*)(gAgentAvatar->getParent()))->getRenderRotation(); + agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation(); } } at_axis = at_axis * agent_rot; @@ -1662,7 +1662,7 @@ LLVector3d LLAgentCamera::calcFocusPositionTargetGlobal() } return mFocusTargetGlobal; } - else if (mSitCameraEnabled && isAgentAvatarValid() && gAgentAvatar->isSitting() && mSitCameraReferenceObject.notNull()) + else if (mSitCameraEnabled && isAgentAvatarValid() && gAgentAvatarp->isSitting() && mSitCameraReferenceObject.notNull()) { // sit camera LLVector3 object_pos = mSitCameraReferenceObject->getRenderPosition(); @@ -1682,9 +1682,9 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() // ...offset from avatar LLVector3d focus_offset; LLQuaternion agent_rot = gAgent.getFrameAgent().getQuaternion(); - if (isAgentAvatarValid() && gAgentAvatar->getParent()) + if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { - agent_rot *= ((LLViewerObject*)(gAgentAvatar->getParent()))->getRenderRotation(); + agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation(); } focus_offset = mFocusOffsetInitial[mCameraPreset] * agent_rot; @@ -1694,9 +1694,9 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() void LLAgentCamera::setupSitCamera() { // agent frame entering this function is in world coordinates - if (isAgentAvatarValid() && gAgentAvatar->getParent()) + if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { - LLQuaternion parent_rot = ((LLViewerObject*)gAgentAvatar->getParent())->getRenderRotation(); + LLQuaternion parent_rot = ((LLViewerObject*)gAgentAvatarp->getParent())->getRenderRotation(); // slam agent coordinate frame to proper parent local version LLVector3 at_axis = gAgent.getFrameAgent().getAtAxis(); at_axis.mV[VZ] = 0.f; @@ -1763,7 +1763,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) F32 camera_land_height; LLVector3d frame_center_global = !isAgentAvatarValid() ? gAgent.getPositionGlobal() : - gAgent.getPosGlobalFromAgent(gAgentAvatar->mRoot.getWorldPosition()); + gAgent.getPosGlobalFromAgent(gAgentAvatarp->mRoot.getWorldPosition()); BOOL isConstrained = FALSE; LLVector3d head_offset; @@ -1778,32 +1778,32 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) }// End Ventrella else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { - if (!isAgentAvatarValid() || gAgentAvatar->mDrawable.isNull()) + if (!isAgentAvatarValid() || gAgentAvatarp->mDrawable.isNull()) { llwarns << "Null avatar drawable!" << llendl; return LLVector3d::zero; } head_offset.clearVec(); - if (gAgentAvatar->isSitting() && gAgentAvatar->getParent()) + if (gAgentAvatarp->isSitting() && gAgentAvatarp->getParent()) { - gAgentAvatar->updateHeadOffset(); - head_offset.mdV[VX] = gAgentAvatar->mHeadOffset.mV[VX]; - head_offset.mdV[VY] = gAgentAvatar->mHeadOffset.mV[VY]; - head_offset.mdV[VZ] = gAgentAvatar->mHeadOffset.mV[VZ] + 0.1f; - const LLMatrix4& mat = ((LLViewerObject*) gAgentAvatar->getParent())->getRenderMatrix(); + gAgentAvatarp->updateHeadOffset(); + head_offset.mdV[VX] = gAgentAvatarp->mHeadOffset.mV[VX]; + head_offset.mdV[VY] = gAgentAvatarp->mHeadOffset.mV[VY]; + head_offset.mdV[VZ] = gAgentAvatarp->mHeadOffset.mV[VZ] + 0.1f; + const LLMatrix4& mat = ((LLViewerObject*) gAgentAvatarp->getParent())->getRenderMatrix(); camera_position_global = gAgent.getPosGlobalFromAgent - ((gAgentAvatar->getPosition()+ - LLVector3(head_offset)*gAgentAvatar->getRotation()) * mat); + ((gAgentAvatarp->getPosition()+ + LLVector3(head_offset)*gAgentAvatarp->getRotation()) * mat); } else { - head_offset.mdV[VZ] = gAgentAvatar->mHeadOffset.mV[VZ]; - if (gAgentAvatar->isSitting()) + head_offset.mdV[VZ] = gAgentAvatarp->mHeadOffset.mV[VZ]; + if (gAgentAvatarp->isSitting()) { head_offset.mdV[VZ] += 0.1; } - camera_position_global = gAgent.getPosGlobalFromAgent(gAgentAvatar->getRenderPosition());//frame_center_global; - head_offset = head_offset * gAgentAvatar->getRenderRotation(); + camera_position_global = gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition());//frame_center_global; + head_offset = head_offset * gAgentAvatarp->getRenderRotation(); camera_position_global = camera_position_global + head_offset; } } @@ -1814,7 +1814,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (mSitCameraEnabled && isAgentAvatarValid() - && gAgentAvatar->isSitting() + && gAgentAvatarp->isSitting() && mSitCameraReferenceObject.notNull()) { // sit camera @@ -1830,9 +1830,9 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); // are we sitting down? - if (isAgentAvatarValid() && gAgentAvatar->getParent()) + if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { - LLQuaternion parent_rot = ((LLViewerObject*)gAgentAvatar->getParent())->getRenderRotation(); + LLQuaternion parent_rot = ((LLViewerObject*)gAgentAvatarp->getParent())->getRenderRotation(); // slam agent coordinate frame to proper parent local version LLVector3 at_axis = gAgent.getFrameAgent().getAtAxis() * parent_rot; at_axis.mV[VZ] = 0.f; @@ -1846,7 +1846,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) local_camera_offset = gAgent.getFrameAgent().rotateToAbsolute( local_camera_offset ); } - if (!mCameraCollidePlane.isExactlyZero() && (!isAgentAvatarValid() || !gAgentAvatar->isSitting())) + if (!mCameraCollidePlane.isExactlyZero() && (!isAgentAvatarValid() || !gAgentAvatarp->isSitting())) { LLVector3 plane_normal; plane_normal.setVec(mCameraCollidePlane.mV); @@ -1899,7 +1899,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) // set the global camera position LLVector3d camera_offset; - LLVector3 av_pos = !isAgentAvatarValid() ? LLVector3::zero : gAgentAvatar->getRenderPosition(); + LLVector3 av_pos = !isAgentAvatarValid() ? LLVector3::zero : gAgentAvatarp->getRenderPosition(); camera_offset.setVec( local_camera_offset ); camera_position_global = frame_center_global + head_offset + camera_offset; @@ -1911,8 +1911,8 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3 vel = gAgent.getVelocity(); // lag by appropriate amount for flying - F32 time_in_air = gAgentAvatar->mTimeInAir.getElapsedTimeF32(); - if(!mCameraAnimating && gAgentAvatar->mInAir && time_in_air > GROUND_TO_AIR_CAMERA_TRANSITION_START_TIME) + F32 time_in_air = gAgentAvatarp->mTimeInAir.getElapsedTimeF32(); + if(!mCameraAnimating && gAgentAvatarp->mInAir && time_in_air > GROUND_TO_AIR_CAMERA_TRANSITION_START_TIME) { LLVector3 frame_at_axis = gAgent.getFrameAgent().getAtAxis(); frame_at_axis -= projected_vec(frame_at_axis, gAgent.getReferenceUpVector()); @@ -1924,7 +1924,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) lag_interp *= u; - if (gViewerWindow->getLeftMouseDown() && gViewerWindow->getLastPick().mObjectID == gAgentAvatar->getID()) + if (gViewerWindow->getLeftMouseDown() && gViewerWindow->getLastPick().mObjectID == gAgentAvatarp->getID()) { // disable camera lag when using mouse-directed steering target_lag.clearVec(); @@ -2135,8 +2135,8 @@ void LLAgentCamera::changeCameraToMouselook(BOOL animate) if (isAgentAvatarValid()) { - gAgentAvatar->stopMotion(ANIM_AGENT_BODY_NOISE); - gAgentAvatar->stopMotion(ANIM_AGENT_BREATHE_ROT); + gAgentAvatarp->stopMotion(ANIM_AGENT_BODY_NOISE); + gAgentAvatarp->stopMotion(ANIM_AGENT_BREATHE_ROT); } //gViewerWindow->stopGrab(); @@ -2223,9 +2223,9 @@ void LLAgentCamera::changeCameraToFollow(BOOL animate) if (isAgentAvatarValid()) { - gAgentAvatar->mPelvisp->setPosition(LLVector3::zero); - gAgentAvatar->startMotion( ANIM_AGENT_BODY_NOISE ); - gAgentAvatar->startMotion( ANIM_AGENT_BREATHE_ROT ); + gAgentAvatarp->mPelvisp->setPosition(LLVector3::zero); + gAgentAvatarp->startMotion( ANIM_AGENT_BODY_NOISE ); + gAgentAvatarp->startMotion( ANIM_AGENT_BREATHE_ROT ); } // unpause avatar animation @@ -2266,12 +2266,12 @@ void LLAgentCamera::changeCameraToThirdPerson(BOOL animate) if (isAgentAvatarValid()) { - if (!gAgentAvatar->isSitting()) + if (!gAgentAvatarp->isSitting()) { - gAgentAvatar->mPelvisp->setPosition(LLVector3::zero); + gAgentAvatarp->mPelvisp->setPosition(LLVector3::zero); } - gAgentAvatar->startMotion(ANIM_AGENT_BODY_NOISE); - gAgentAvatar->startMotion(ANIM_AGENT_BREATHE_ROT); + gAgentAvatarp->startMotion(ANIM_AGENT_BODY_NOISE); + gAgentAvatarp->startMotion(ANIM_AGENT_BREATHE_ROT); } LLVector3 at_axis; @@ -2305,9 +2305,9 @@ void LLAgentCamera::changeCameraToThirdPerson(BOOL animate) } // Remove any pitch from the avatar - if (isAgentAvatarValid() && gAgentAvatar->getParent()) + if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { - LLQuaternion obj_rot = ((LLViewerObject*)gAgentAvatar->getParent())->getRenderRotation(); + LLQuaternion obj_rot = ((LLViewerObject*)gAgentAvatarp->getParent())->getRenderRotation(); at_axis = LLViewerCamera::getInstance()->getAtAxis(); at_axis.mV[VZ] = 0.f; at_axis.normalize(); @@ -2391,8 +2391,8 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came gAgent.sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START); gAgent.setCustomAnim(TRUE); - gAgentAvatar->startMotion(ANIM_AGENT_CUSTOMIZE); - LLMotion* turn_motion = gAgentAvatar->findMotion(ANIM_AGENT_CUSTOMIZE); + gAgentAvatarp->startMotion(ANIM_AGENT_CUSTOMIZE); + LLMotion* turn_motion = gAgentAvatarp->findMotion(ANIM_AGENT_CUSTOMIZE); if (turn_motion) { @@ -2503,7 +2503,7 @@ void LLAgentCamera::setFocusGlobal(const LLVector3d& focus, const LLUUID &object { if (isAgentAvatarValid()) { - mFocusTargetGlobal = gAgent.getPosGlobalFromAgent(gAgentAvatar->mHeadp->getWorldPosition()); + mFocusTargetGlobal = gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition()); } else { @@ -2548,7 +2548,7 @@ void LLAgentCamera::setFocusGlobal(const LLVector3d& focus, const LLUUID &object { if (isAgentAvatarValid()) { - mFocusTargetGlobal = gAgent.getPosGlobalFromAgent(gAgentAvatar->mHeadp->getWorldPosition()); + mFocusTargetGlobal = gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition()); } else { @@ -2685,9 +2685,9 @@ void LLAgentCamera::setFocusOnAvatar(BOOL focus_on_avatar, BOOL animate) if (mCameraMode == CAMERA_MODE_THIRD_PERSON) { LLVector3 at_axis; - if (isAgentAvatarValid() && gAgentAvatar->getParent()) + if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { - LLQuaternion obj_rot = ((LLViewerObject*)gAgentAvatar->getParent())->getRenderRotation(); + LLQuaternion obj_rot = ((LLViewerObject*)gAgentAvatarp->getParent())->getRenderRotation(); at_axis = LLViewerCamera::getInstance()->getAtAxis(); at_axis.mV[VZ] = 0.f; at_axis.normalize(); @@ -2720,10 +2720,10 @@ BOOL LLAgentCamera::setLookAt(ELookAtType target_type, LLViewerObject *object, L LLViewerObject* parent = object; while(parent) { - if (parent == gAgentAvatar) + if (parent == gAgentAvatarp) { // looking at an attachment on ourselves, which we don't want to do - object = gAgentAvatar; + object = gAgentAvatarp; position.clearVec(); } parent = (LLViewerObject*)parent->getParent(); @@ -2732,7 +2732,7 @@ BOOL LLAgentCamera::setLookAt(ELookAtType target_type, LLViewerObject *object, L if(!mLookAt || mLookAt->isDead()) { mLookAt = (LLHUDEffectLookAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_LOOKAT); - mLookAt->setSourceObject(gAgentAvatar); + mLookAt->setSourceObject(gAgentAvatarp); } return mLookAt->setLookAt(target_type, object, position); @@ -2761,7 +2761,7 @@ void LLAgentCamera::lookAtLastChat() LLVOAvatar *chatter_av = (LLVOAvatar*)chatter; if (isAgentAvatarValid() && chatter_av->mHeadp) { - delta_pos = chatter_av->mHeadp->getWorldPosition() - gAgentAvatar->mHeadp->getWorldPosition(); + delta_pos = chatter_av->mHeadp->getWorldPosition() - gAgentAvatarp->mHeadp->getWorldPosition(); } else { @@ -2773,7 +2773,7 @@ void LLAgentCamera::lookAtLastChat() changeCameraToThirdPerson(); - LLVector3 new_camera_pos = gAgentAvatar->mHeadp->getWorldPosition(); + LLVector3 new_camera_pos = gAgentAvatarp->mHeadp->getWorldPosition(); LLVector3 left = delta_pos % LLVector3::z_axis; left.normalize(); LLVector3 up = left % delta_pos; @@ -2802,7 +2802,7 @@ void LLAgentCamera::lookAtLastChat() changeCameraToThirdPerson(); - LLVector3 new_camera_pos = gAgentAvatar->mHeadp->getWorldPosition(); + LLVector3 new_camera_pos = gAgentAvatarp->mHeadp->getWorldPosition(); LLVector3 left = delta_pos % LLVector3::z_axis; left.normalize(); LLVector3 up = left % delta_pos; @@ -2827,7 +2827,7 @@ BOOL LLAgentCamera::setPointAt(EPointAtType target_type, LLViewerObject *object, if (!mPointAt || mPointAt->isDead()) { mPointAt = (LLHUDEffectPointAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT); - mPointAt->setSourceObject(gAgentAvatar); + mPointAt->setSourceObject(gAgentAvatarp); } return mPointAt->setPointAt(target_type, object, position); } |