summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerjointattachment.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-09-18 19:51:44 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-09-18 19:51:44 +0100
commit3346281be35ab6fa3a46c7f166bb1f7da066d5e3 (patch)
treead68173772e4ff86977e48dc4992cf24b907f592 /indra/newview/llviewerjointattachment.cpp
parente360423598002893f5735b9898a565c8d159d1f8 (diff)
SL-790 - Adding UI checks for actions that would increase the animated object attachment count
Diffstat (limited to 'indra/newview/llviewerjointattachment.cpp')
-rw-r--r--indra/newview/llviewerjointattachment.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp
index 66e392ac42..cf9243a871 100644
--- a/indra/newview/llviewerjointattachment.cpp
+++ b/indra/newview/llviewerjointattachment.cpp
@@ -357,6 +357,25 @@ void LLViewerJointAttachment::setOriginalPosition(LLVector3& position)
}
//-----------------------------------------------------------------------------
+// getNumAnimatedObjects()
+//-----------------------------------------------------------------------------
+S32 LLViewerJointAttachment::getNumAnimatedObjects() const
+{
+ S32 count = 0;
+ for (attachedobjs_vec_t::const_iterator iter = mAttachedObjects.begin();
+ iter != mAttachedObjects.end();
+ ++iter)
+ {
+ const LLViewerObject *attached_object = *iter;
+ if (attached_object->isAnimatedObject())
+ {
+ count++;
+ }
+ }
+ return count;
+}
+
+//-----------------------------------------------------------------------------
// clampObjectPosition()
//-----------------------------------------------------------------------------
void LLViewerJointAttachment::clampObjectPosition()