diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-05-30 22:03:43 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-05-30 22:03:43 +0100 |
commit | 55612611c679efda5d491944dee75f4768749277 (patch) | |
tree | 244861bd6c8b63f4a68a87bfbac6da79373b94d9 /indra/newview | |
parent | 4d68945595227b0f863a1c496be5da0f3c3c5113 (diff) |
SL-694 - stub support for ObjectAnimation message type
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llstartup.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 63 | ||||
-rw-r--r-- | indra/newview/llviewermessage.h | 1 |
3 files changed, 62 insertions, 3 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 33b6352bf5..0c2fcdaf10 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2384,6 +2384,7 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_NameValuePair, process_name_value); msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value); msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); + msg->setHandlerFuncFast(_PREHASH_ObjectAnimation, process_object_animation); msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance); msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint); msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 507087d1ae..6a6e932b4a 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -103,6 +103,7 @@ #include "llviewerwindow.h" #include "llvlmanager.h" #include "llvoavatarself.h" +#include "llvovolume.h" #include "llworld.h" #include "pipeline.h" #include "llfloaterworldmap.h" @@ -4976,12 +4977,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) { @@ -4993,6 +4997,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()) @@ -5063,6 +5068,58 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) } } +void process_object_animation(LLMessageSystem *mesgsys, void **user_data) +{ + LLUUID animation_id; + LLUUID uuid; +#if 0 + S32 anim_sequence_id; +#endif + + mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid); + + LLViewerObject *objp = gObjectList.findObject(uuid); + if (!objp) + { + LL_WARNS("Messaging") << "Received animation state for unknown object" << uuid << LL_ENDL; + return; + } + + LLVOVolume *volp = dynamic_cast<LLVOVolume*>(objp); + if (!volp) + { + LL_WARNS("Messaging") << "Received animation state for non-volume object" << uuid << LL_ENDL; + return; + } + + if (!volp->isAnimatedMesh()) + { + LL_WARNS("Messaging") << "Received animation state for non-animated object" << uuid << LL_ENDL; + return; + } + + LL_WARNS() << "ADD SUPPORT FOR OBJECT ANIMATION HERE" << LL_ENDL; +#if 0 + S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationList); + S32 num_source_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationSourceList); + + avatarp->mSignaledAnimations.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); + avatarp->mSignaledAnimations[animation_id] = anim_sequence_id; + } + + if (num_blocks) + { + avatarp->processAnimationStateChanges(); + } +#endif +} + + void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data) { LLUUID uuid; diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index b0eaa37541..cef6f79812 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -95,6 +95,7 @@ void process_health_message(LLMessageSystem *mesgsys, void **user_data); void process_sim_stats(LLMessageSystem *mesgsys, void **user_data); void process_shooter_agent_hit(LLMessageSystem* msg, void** user_data); void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data); +void process_object_animation(LLMessageSystem *mesgsys, void **user_data); void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data); void process_camera_constraint(LLMessageSystem *mesgsys, void **user_data); void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data); |