Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 106 additions & 24 deletions indra/newview/llagentcamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,108 @@ static bool isDisableCameraConstraints()
return sDisableCameraConstraints;
}

// Keep the focused linkset's render state in step with the focused root without
// replaying movement that the normal pipeline has already processed this frame.
static void updateFocusedLinksetObject(LLViewerObject* objectp)
{
if (!objectp || objectp->isDead())
{
return;
}

LLDrawable* drawablep = objectp->mDrawable.get();
bool movement_updated = false;
if (drawablep && drawablep->isActive())
{
if (!drawablep->isState(LLDrawable::EARLY_MOVE))
{
if (objectp->isSelected() ||
drawablep->isState(LLDrawable::MOVE_UNDAMPED) ||
!objectp->getAngularVelocity().isExactlyZero())
{
gPipeline.updateMoveNormalAsync(drawablep);
}
else
{
gPipeline.updateMoveDampedAsync(drawablep);
}
movement_updated = true;
}
}

if (LLVOAvatar* avatarp = objectp->asAvatar())
{
if (movement_updated)
{
if (LLJoint* root_jointp = avatarp->getRootJoint())
{
root_jointp->touch();
root_jointp->updateWorldMatrixChildren();
const LLVector3 hud_name_pos =
avatarp->idleCalcNameTagPosition(root_jointp->getWorldPosition());
avatarp->idleUpdateNameTag(hud_name_pos);
avatarp->idleUpdateVoiceVisualizerPosition(hud_name_pos);
}

// Attachments have mixed movement sources. Preserve the same policy used by the normal avatar update path.
const bool attachment_selected =
LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 0 &&
LLSelectMgr::getInstance()->getSelection()->isAttachment();
for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
iter != avatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (!attachment)
{
continue;
}
Comment thread
trish-sl marked this conversation as resolved.

for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
LLViewerObject* attached_object = attachment_iter->get();
if (!attached_object || attached_object->isDead() ||
attached_object->mDrawable.isNull())
{
continue;
}

LLDrawable* attached_drawablep = attached_object->mDrawable.get();
if (!attached_drawablep->isActive())
{
continue;
}

if (!attached_drawablep->isState(LLDrawable::EARLY_MOVE))
{
if (attachment_selected)
{
gPipeline.updateMoveNormalAsync(attached_drawablep);
}
else
{
gPipeline.updateMoveDampedAsync(attached_drawablep);
Comment thread
trish-sl marked this conversation as resolved.
}

if (LLSpatialBridge* bridgep = attached_drawablep->getSpatialBridge())
{
gPipeline.updateMoveNormalAsync(bridgep);
}
}
Comment thread
trish-sl marked this conversation as resolved.
}
}
}
}

// Seated avatars and sit-target children can be deeper than one level in the hierarchy.
for (LLViewerObject* childp : objectp->getChildren())
{
updateFocusedLinksetObject(childp);
}
}

// The agent instance.
LLAgentCamera gAgentCamera;

Expand Down Expand Up @@ -1628,33 +1730,14 @@ LLVector3d LLAgentCamera::calcFocusPositionTargetGlobal()
{
if (mFocusObject.notNull() && !mFocusObject->isDead() && mFocusObject->mDrawable.notNull())
{
LLDrawable* drawablep = mFocusObject->mDrawable;

if (mTrackFocusObject &&
drawablep &&
drawablep->isActive())
mFocusObject->mDrawable->isActive() &&
!mFocusObject->isAvatar())
{
if (!mFocusObject->isAvatar())
{
if (mFocusObject->isSelected())
{
gPipeline.updateMoveNormalAsync(drawablep);
}
else
{
if (drawablep->isState(LLDrawable::MOVE_UNDAMPED))
{
gPipeline.updateMoveNormalAsync(drawablep);
}
else
{
gPipeline.updateMoveDampedAsync(drawablep);
}
}
}
updateFocusedLinksetObject(mFocusObject.get());
}
// if not tracking object, update offset based on new object position
else
else if (!mTrackFocusObject)
{
updateFocusOffset();
}
Expand Down Expand Up @@ -2948,4 +3031,3 @@ S32 LLAgentCamera::directionToKey(S32 direction)


// EOF

4 changes: 2 additions & 2 deletions indra/newview/llviewerobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4795,7 +4795,8 @@ const LLVector3 LLViewerObject::getRenderPosition() const
}
}

if (mDrawable.isNull() || mDrawable->getGeneration() < 0)
if (mDrawable.isNull() ||
(!mDrawable->isActive() && mDrawable->getGeneration() < 0))
{
return getPositionAgent();
}
Expand Down Expand Up @@ -8036,4 +8037,3 @@ class ObjectPhysicsProperties : public LLHTTPNode

LLHTTPRegistration<ObjectPhysicsProperties>
gHTTPRegistrationObjectPhysicsProperties("/message/ObjectPhysicsProperties");

10 changes: 9 additions & 1 deletion indra/newview/llvoavatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3015,10 +3015,18 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled, const LLVector3 &
}
}
}
mVoiceVisualizer->setPositionAgent(position);
idleUpdateVoiceVisualizerPosition(position);
Comment thread
akleshchev marked this conversation as resolved.
}//if ( voiceEnabled )
}

void LLVOAvatar::idleUpdateVoiceVisualizerPosition(const LLVector3 &position)
{
if (mVoiceVisualizer)
{
mVoiceVisualizer->setPositionAgent(position);
}
}

static void override_bbox(LLDrawable* drawable, LLVector4a* extents)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
Expand Down
2 changes: 1 addition & 1 deletion indra/newview/llvoavatar.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ class LLVOAvatar :
void updateRootPositionAndRotation(LLAgent &agent, F32 speed, bool was_sit_ground_constrained);

void idleUpdateVoiceVisualizer(bool voice_enabled, const LLVector3 &position);
void idleUpdateVoiceVisualizerPosition(const LLVector3 &position);
void idleUpdateMisc(bool detailed_update);
virtual void idleUpdateAppearanceAnimation();
void idleUpdateLipSync(bool voice_enabled);
Expand Down Expand Up @@ -1355,4 +1356,3 @@ void dump_sequential_xml(const std::string outprefix, const LLSD& content);
void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value);

#endif // LL_VOAVATAR_H

Loading