EXT-7767 FIX Outfit editor doesn't appear to have a default camera view
added some comments and cleaned up code based on reviewmeow-7.2.2
parent
0aabcc8134
commit
6dd35018d2
|
|
@ -95,6 +95,8 @@ const F32 OBJECT_MIN_ZOOM = 0.02f;
|
|||
const F32 APPEARANCE_MIN_ZOOM = 0.39f;
|
||||
const F32 APPEARANCE_MAX_ZOOM = 8.f;
|
||||
|
||||
const F32 CUSTOMIZE_AVATAR_CAMERA_DEFAULT_DIST = 3.5f;
|
||||
|
||||
const F32 GROUND_TO_AIR_CAMERA_TRANSITION_TIME = 0.5f;
|
||||
const F32 GROUND_TO_AIR_CAMERA_TRANSITION_START_TIME = 0.5f;
|
||||
|
||||
|
|
@ -2325,8 +2327,6 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came
|
|||
{
|
||||
if(avatar_animate)
|
||||
{
|
||||
// slamming the avatar's axis to the camera so that when the rotation
|
||||
// completes it correctly points to the front of the avatar
|
||||
// Remove any pitch or rotation from the avatar
|
||||
LLVector3 at = gAgent.getAtAxis();
|
||||
at.mV[VZ] = 0.f;
|
||||
|
|
@ -2356,7 +2356,7 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came
|
|||
LLVector3d camera_offset(agent_at * -1.0);
|
||||
// push camera up and out from avatar
|
||||
camera_offset.mdV[VZ] = 0.1f;
|
||||
camera_offset *= 3.5f;
|
||||
camera_offset *= CUSTOMIZE_AVATAR_CAMERA_DEFAULT_DIST;
|
||||
LLVector3d focus_target_global = gAgent.getPosGlobalFromAgent(focus_target);
|
||||
setCameraPosAndFocusGlobal(focus_target_global + camera_offset, focus_target_global, gAgent.getID());
|
||||
|
||||
|
|
@ -2392,6 +2392,7 @@ void LLAgentCamera::setAnimationDuration(F32 duration)
|
|||
{
|
||||
if (mCameraAnimating)
|
||||
{
|
||||
// do not cut any existing camera animation short
|
||||
F32 animation_left = llmax(0.f, mAnimationDuration - mAnimationTimer.getElapsedTimeF32());
|
||||
mAnimationDuration = llmax(duration, animation_left);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ public:
|
|||
F32 getCameraMinOffGround(); // Minimum height off ground for this mode, meters
|
||||
void setCameraCollidePlane(const LLVector4 &plane) { mCameraCollidePlane = plane; }
|
||||
BOOL calcCameraMinDistance(F32 &obj_min_distance);
|
||||
F32 calcCustomizeAvatarUIOffset(const LLVector3d& camera_pos_global);
|
||||
F32 getCurrentCameraBuildOffset() { return (F32)mCameraFocusOffset.length(); }
|
||||
void clearCameraLag() { mCameraLag.clearVec(); }
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -1127,7 +1127,6 @@ void LLPanelEditWearable::changeCamera(U8 subpart)
|
|||
}
|
||||
|
||||
// Update the camera
|
||||
gMorphView->setCameraDistToDefault();
|
||||
gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ) );
|
||||
gMorphView->setCameraTargetOffset( subpart_entry->mTargetOffset );
|
||||
gMorphView->setCameraOffset( subpart_entry->mCameraOffset );
|
||||
|
|
|
|||
|
|
@ -236,7 +236,6 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
|
|||
gAgentCamera.setFocusOnAvatar(FALSE, FALSE);
|
||||
|
||||
LLVector3d cam_pos = gAgentCamera.getCameraPositionGlobal();
|
||||
cam_pos -= LLVector3d(LLViewerCamera::getInstance()->getLeftAxis() * gAgentCamera.calcCustomizeAvatarUIOffset( cam_pos ));
|
||||
|
||||
gAgentCamera.setCameraPosAndFocusGlobal( cam_pos, pick_info.mPosGlobal, pick_info.mObjectID);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3201,6 +3201,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
|
|||
visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
// don't early out for your own avatar, as we rely on your animations playing reliably
|
||||
// for example, the "turn around" animation when entering customize avatar needs to trigger
|
||||
// even when your avatar is offscreen
|
||||
if (!visible && !isSelf())
|
||||
{
|
||||
updateMotions(LLCharacter::HIDDEN_UPDATE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue