summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp101
1 files changed, 98 insertions, 3 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 2144c7d481..24af491391 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -55,6 +55,7 @@
#include "llagentcamera.h"
#include "llcallingcard.h"
#include "llbuycurrencyhtml.h"
+#include "llcontrolavatar.h"
#include "llfirstuse.h"
#include "llfloaterbump.h"
#include "llfloaterbuyland.h"
@@ -103,6 +104,7 @@
#include "llviewerwindow.h"
#include "llvlmanager.h"
#include "llvoavatarself.h"
+#include "llvovolume.h"
#include "llworld.h"
#include "pipeline.h"
#include "llfloaterworldmap.h"
@@ -4982,12 +4984,15 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
LLUUID animation_id;
LLUUID uuid;
S32 anim_sequence_id;
- LLVOAvatar *avatarp;
+ LLVOAvatar *avatarp = NULL;
mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid);
- //clear animation flags
- avatarp = (LLVOAvatar *)gObjectList.findObject(uuid);
+ LLViewerObject *objp = gObjectList.findObject(uuid);
+ if (objp)
+ {
+ avatarp = objp->asAvatar();
+ }
if (!avatarp)
{
@@ -4999,6 +5004,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationList);
S32 num_source_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationSourceList);
+ //clear animation flags
avatarp->mSignaledAnimations.clear();
if (avatarp->isSelf())
@@ -5069,6 +5075,95 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
}
}
+void process_object_animation(LLMessageSystem *mesgsys, void **user_data)
+{
+ LLUUID animation_id;
+ LLUUID uuid;
+ S32 anim_sequence_id;
+
+ mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid);
+
+ LLViewerObject *objp = gObjectList.findObject(uuid);
+ if (!objp)
+ {
+ LL_WARNS("Messaging") << "AXON Received animation state for unknown object" << uuid << LL_ENDL;
+ return;
+ }
+
+ LLVOVolume *volp = dynamic_cast<LLVOVolume*>(objp);
+ if (!volp)
+ {
+ LL_WARNS("Messaging") << "AXON Received animation state for non-volume object" << uuid << LL_ENDL;
+ return;
+ }
+
+ if (!volp->isAnimatedObject())
+ {
+ LL_WARNS("Messaging") << "AXON Received animation state for non-animated object" << uuid << LL_ENDL;
+ return;
+ }
+
+ LLControlAvatar *avatarp = volp->getControlAvatar();
+ if (!avatarp)
+ {
+ LL_WARNS("Messaging") << "AXON no control avatar, ignoring" << LL_ENDL;
+ return;
+ }
+
+ S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationList);
+ LL_DEBUGS("AXON") << "processing object animation requests, num_blocks " << num_blocks << LL_ENDL;
+
+#if 1
+ // Here we go into skinned mode once, the first time we get an
+ // animation request, and then stay there. This is probably the
+ // normally desired behavior.
+ if (!avatarp->mPlaying)
+ {
+ avatarp->mPlaying = true;
+ if (!avatarp->mRootVolp->isAnySelected())
+ {
+ avatarp->updateVolumeGeom();
+ avatarp->mRootVolp->recursiveMarkForUpdate(TRUE);
+ }
+ }
+#else// AXON REMOVE BEFORE RELEASE?
+ // In this block we switch back into static mode when no animations are
+ // playing. This is mostly useful for debugging.
+ if (num_blocks > 0 && !avatarp->mPlaying)
+ {
+ avatarp->mPlaying = true;
+ if (!avatarp->mRootVolp->isAnySelected())
+ {
+ avatarp->updateVolumeGeom();
+ avatarp->mRootVolp->recursiveMarkForUpdate(TRUE);
+ }
+ }
+ else if (num_blocks == 0 && avatarp->mPlaying)
+ {
+ avatarp->mPlaying = false;
+ if (!avatarp->mRootVolp->isAnySelected())
+ {
+ avatarp->updateVolumeGeom();
+ avatarp->mRootVolp->recursiveMarkForUpdate(TRUE);
+ }
+ }
+#endif
+
+ volp->mObjectSignaledAnimations.clear();
+
+ for( S32 i = 0; i < num_blocks; i++ )
+ {
+ mesgsys->getUUIDFast(_PREHASH_AnimationList, _PREHASH_AnimID, animation_id, i);
+ mesgsys->getS32Fast(_PREHASH_AnimationList, _PREHASH_AnimSequenceID, anim_sequence_id, i);
+ volp->mObjectSignaledAnimations[animation_id] = anim_sequence_id;
+ LL_DEBUGS("AXON") << "got object animation request for object "
+ << uuid << " animation id " << animation_id << LL_ENDL;
+ }
+
+ avatarp->updateAnimations();
+}
+
+
void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data)
{
LLUUID uuid;