summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-07-07 20:23:51 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-07-07 20:23:51 +0100
commit0ca9b74516eb73e3b0943fce61fbd7473bd707c2 (patch)
tree5337b075ae61ff99ea7f20f0150938f3eb17f0c3 /indra
parent59976ece36a304421135650e6bc3b4f70db6f64c (diff)
SL-718 - start on support of animated objects as attachments.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llcontrolavatar.cpp10
-rw-r--r--indra/newview/llvovolume.cpp9
2 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index f18d1c636a..4aee5819aa 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -186,7 +186,15 @@ void LLControlAvatar::idleUpdate(LLAgent &agent, const F64 &time)
//virtual
void LLControlAvatar::updateDebugText()
{
- addDebugText("I'm a control avatar");
+ S32 total_linkset_count = 0;
+ if (mRootVolp)
+ {
+ total_linkset_count = 1 + mRootVolp->getChildren().size();
+ }
+ std::vector<LLVOVolume*> volumes;
+ getAnimatedVolumes(volumes);
+ S32 animated_volume_count = volumes.size();
+ addDebugText(llformat("CAV obj %d anim %d", total_linkset_count, animated_volume_count));
LLVOAvatar::updateDebugText();
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 378a353f31..4065f9fc37 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3316,10 +3316,13 @@ bool LLVOVolume::canBeAnimatedObject() const
{
return false;
}
+// AXON remove this check if animated object attachments are allowed
+#if 0
if (isAttachment())
{
return false;
}
+#endif
if (!getVolume())
{
return false;
@@ -3392,7 +3395,9 @@ void LLVOVolume::updateAnimatedObjectState(LLViewerObject *old_parent, LLViewerO
LLVOVolume *old_volp = dynamic_cast<LLVOVolume*>(old_parent);
LLVOVolume *new_volp = dynamic_cast<LLVOVolume*>(new_parent);
- if (new_parent)
+ // AXON - depending on whether animated objects can be attached,
+ // we may want to include or remove the isAvatar() check.
+ if (new_parent && !new_parent->isAvatar())
{
// Object should inherit control avatar and animated mesh flag
// from parent, so clear them out from our own state
@@ -3407,7 +3412,7 @@ void LLVOVolume::updateAnimatedObjectState(LLViewerObject *old_parent, LLViewerO
av->markForDeath();
}
// If this succeeds now, it's because the new_parent is an animated object
- if (isAnimatedObject())
+ if (isAnimatedObject() && getControlAvatar())
{
getControlAvatar()->addAttachmentOverridesForObject(this);
}