diff --git a/etc/message.xml b/etc/message.xml index bb2c593f68..75adc95a04 100755 --- a/etc/message.xml +++ b/etc/message.xml @@ -236,6 +236,14 @@ false + ObjectAnimation + + flavor + template + trusted-sender + false + + AvatarAppearance flavor diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index d0bb2906c2..8df3858936 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -903,7 +903,7 @@ void LLJoint::setWorldRotation( const LLQuaternion& rot ) //-------------------------------------------------------------------- const LLVector3& LLJoint::getScale() { - return mXform.getScale(); + return mXform.getScale(); } //-------------------------------------------------------------------- diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index d449c3649c..ab4e844bd2 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -150,10 +150,13 @@ public: BOOL isPaused() const { return mPaused; } void setTimeStep(F32 step); + F32 getTimeStep() const { return mTimeStep; } void setTimeFactor(F32 time_factor); F32 getTimeFactor() const { return mTimeFactor; } + F32 getAnimTime() const { return mAnimTime; } + // Fix impostered animation speed based on a fix by Henri Beauchamp void setUpdateFactor(F32 update_factor) { mUpdateFactor = update_factor; } diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 4866da0e78..533e208175 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -157,6 +157,7 @@ const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; // attachment constants const S32 MAX_AGENT_ATTACHMENTS = 38; +const S32 MAX_AGENT_ANIMATED_OBJECT_ATTACHMENTS = 1; const U8 ATTACHMENT_ADD = 0x80; // god levels diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index b00b28cf51..44b136bf23 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1,5 +1,4 @@ /** - * @file llvolume.cpp * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index b901808865..2b77b3c0b0 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -818,6 +818,7 @@ char const* const _PREHASH_StateSave = LLMessageStringTable::getInstance()->getS char const* const _PREHASH_RoleData = LLMessageStringTable::getInstance()->getString("RoleData"); char const* const _PREHASH_AgentAnimation = LLMessageStringTable::getInstance()->getString("AgentAnimation"); char const* const _PREHASH_AvatarAnimation = LLMessageStringTable::getInstance()->getString("AvatarAnimation"); +char const* const _PREHASH_ObjectAnimation = LLMessageStringTable::getInstance()->getString("ObjectAnimation"); char const* const _PREHASH_LogDwellTime = LLMessageStringTable::getInstance()->getString("LogDwellTime"); char const* const _PREHASH_ParcelGodMarkAsContent = LLMessageStringTable::getInstance()->getString("ParcelGodMarkAsContent"); char const* const _PREHASH_UsePhysics = LLMessageStringTable::getInstance()->getString("UsePhysics"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index a566037acc..6e86c00588 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -818,6 +818,7 @@ extern char const* const _PREHASH_StateSave; extern char const* const _PREHASH_RoleData; extern char const* const _PREHASH_AgentAnimation; extern char const* const _PREHASH_AvatarAnimation; +extern char const* const _PREHASH_ObjectAnimation; extern char const* const _PREHASH_LogDwellTime; extern char const* const _PREHASH_ParcelGodMarkAsContent; extern char const* const _PREHASH_UsePhysics; diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 6bebb1ca40..af11469fb1 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1607,6 +1607,8 @@ BOOL LLNetworkData::isValid(U16 param_type, U32 size) return (size == 17); case PARAMS_LIGHT_IMAGE: return (size == 28); + case PARAMS_EXTENDED_MESH: + return (size == 4); } return FALSE; @@ -2034,3 +2036,67 @@ bool LLLightImageParams::fromLLSD(LLSD& sd) return false; } + +//============================================================================ + +LLExtendedMeshParams::LLExtendedMeshParams() +{ + mType = PARAMS_EXTENDED_MESH; + mFlags = 0; +} + +BOOL LLExtendedMeshParams::pack(LLDataPacker &dp) const +{ + dp.packU32(mFlags, "flags"); + + return TRUE; +} + +BOOL LLExtendedMeshParams::unpack(LLDataPacker &dp) +{ + dp.unpackU32(mFlags, "flags"); + + return TRUE; +} + +bool LLExtendedMeshParams::operator==(const LLNetworkData& data) const +{ + if (data.mType != PARAMS_EXTENDED_MESH) + { + return false; + } + + const LLExtendedMeshParams *param = (const LLExtendedMeshParams*)&data; + if ( (param->mFlags != mFlags) ) + { + return false; + } + + return true; +} + +void LLExtendedMeshParams::copy(const LLNetworkData& data) +{ + const LLExtendedMeshParams *param = (LLExtendedMeshParams*)&data; + mFlags = param->mFlags; +} + +LLSD LLExtendedMeshParams::asLLSD() const +{ + LLSD sd; + + sd["flags"] = LLSD::Integer(mFlags); + + return sd; +} + +bool LLExtendedMeshParams::fromLLSD(LLSD& sd) +{ + if (sd.has("flags")) + { + setFlags( sd["flags"].asInteger()); + return true; + } + + return false; +} diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 95938bea24..5d89e56482 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -114,6 +114,7 @@ public: PARAMS_LIGHT_IMAGE = 0x40, PARAMS_RESERVED = 0x50, // Used on server-side PARAMS_MESH = 0x60, + PARAMS_EXTENDED_MESH = 0x70, }; public: @@ -296,6 +297,27 @@ public: }; +class LLExtendedMeshParams : public LLNetworkData +{ +protected: + U32 mFlags; + +public: + static const U32 ANIMATED_MESH_ENABLED_FLAG = 0x1 << 0; + + LLExtendedMeshParams(); + /*virtual*/ BOOL pack(LLDataPacker &dp) const; + /*virtual*/ BOOL unpack(LLDataPacker &dp); + /*virtual*/ bool operator==(const LLNetworkData& data) const; + /*virtual*/ void copy(const LLNetworkData& data); + LLSD asLLSD() const; + operator LLSD() const { return asLLSD(); } + bool fromLLSD(LLSD& sd); + + void setFlags(const U32& flags) { mFlags = flags; } + U32 getFlags() const { return mFlags; } + +}; // This code is not naming-standards compliant. Leaving it like this for // now to make the connection to code in diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4dfee491a6..ed8632bd5e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -256,6 +256,7 @@ set(viewer_SOURCE_FILES llcommunicationchannel.cpp llcompilequeue.cpp llconfirmationmanager.cpp + llcontrolavatar.cpp llconversationlog.cpp llconversationloglist.cpp llconversationloglistitem.cpp @@ -1007,6 +1008,7 @@ set(viewer_HEADER_FILES llcommunicationchannel.h llcompilequeue.h llconfirmationmanager.h + llcontrolavatar.h llconversationlog.h llconversationloglist.h llconversationloglistitem.h diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 7368dc8021..aead79767c 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -50,7 +50,7 @@ tags - + AXON viewer +{ + ObjectAnimation High 30 Trusted Unencoded + { + Sender Single + { ID LLUUID } + } + { + AnimationList Variable + { AnimID LLUUID } + { AnimSequenceID S32 } + } +} + // ************************************************************************* // Asset storage messages // ************************************************************************* diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index 553fbdcb7b..0e4f3bbed2 100755 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -8535acbfaf222a8e026283a74d869402a0458314 \ No newline at end of file +65309e77b91facecb65ea0dfac478d7737e9641f \ No newline at end of file diff --git a/scripts/testing/lsl/axon_test_region_driver.lsl b/scripts/testing/lsl/axon_test_region_driver.lsl new file mode 100644 index 0000000000..dcf146a9cf --- /dev/null +++ b/scripts/testing/lsl/axon_test_region_driver.lsl @@ -0,0 +1,54 @@ +list buttons = ["anim start", "anim stop", "step", "verbose on", "verbose off", " "]; +string dialogInfo = "\nPlease make a choice."; + +key ToucherID; +integer dialogChannel; +integer listenHandle; +integer commandChannel; + +default +{ + state_entry() + { + dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); + commandChannel = -2001; + } + + touch_start(integer num_detected) + { + ToucherID = llDetectedKey(0); + llListenRemove(listenHandle); + listenHandle = llListen(dialogChannel, "", ToucherID, ""); + llDialog(ToucherID, dialogInfo, buttons, dialogChannel); + //llSetTimerEvent(60.0); // Here we set a time limit for responses + } + + listen(integer channel, string name, key id, string message) + { + if (message == "-") + { + llDialog(ToucherID, dialogInfo, buttons, dialogChannel); + return; + } + + llListenRemove(listenHandle); + // stop timer since the menu was clicked + llSetTimerEvent(0); + + //llOwnerSay("Sending message " + message + " on channel " + (string)commandChannel); + llRegionSay(commandChannel, message); + } + + timer() + { + // stop timer + llSetTimerEvent(0); + + llListenRemove(listenHandle); + //llWhisper(0, "Sorry. You snooze; you lose."); + } +} + +// Local Variables: +// shadow-file-name: "$SW_HOME/axon/scripts/testing/lsl/axon_test_region_driver.lsl" +// End: diff --git a/scripts/testing/lsl/cycle_object_animations.lsl b/scripts/testing/lsl/cycle_object_animations.lsl new file mode 100644 index 0000000000..46910e3656 --- /dev/null +++ b/scripts/testing/lsl/cycle_object_animations.lsl @@ -0,0 +1,118 @@ +integer listenHandle; +integer verbose; +integer current_animation_number; +string NowPlaying; + +say_if_verbose(integer channel, string message) +{ + if (verbose) + { + llSay(channel, message); + } +} + +stop_all_animations() +{ + integer count = llGetInventoryNumber(INVENTORY_ANIMATION); + string ItemName; + string NowPlaying; + while (count--) + { + ItemName = llGetInventoryName(INVENTORY_ANIMATION, count); + say_if_verbose(0, "Stopping " + ItemName); + llStopObjectAnimation(ItemName); + } +} + +start_cycle_animations() +{ + current_animation_number = llGetInventoryNumber(INVENTORY_ANIMATION); + next_animation(); // Do first iteration without waiting for timer + llSetTimerEvent(5.0); +} + +next_animation() +{ + string ItemName; + if (NowPlaying != "") + { + say_if_verbose(0, "Stopping " + NowPlaying); + llStopObjectAnimation(NowPlaying); + } + if (current_animation_number--) + { + ItemName = llGetInventoryName(INVENTORY_ANIMATION, current_animation_number); + say_if_verbose(0, "Starting " + ItemName); + llStartObjectAnimation(ItemName); + NowPlaying = ItemName; + } + else + { + // Start again at the top + current_animation_number = llGetInventoryNumber(INVENTORY_ANIMATION); + } +} + +stop_cycle_animations() +{ + llSetTimerEvent(0); +} + +default +{ + state_entry() + { + say_if_verbose(0, "Animated Object here"); + listenHandle = llListen(-2001,"","",""); + verbose = 0; + + stop_all_animations(); + } + + listen(integer channel, string name, key id, string message) + { + //llOwnerSay("got message " + name + " " + (string) id + " " + message); + list words = llParseString2List(message,[" "],[]); + string command = llList2String(words,0); + string option = llList2String(words,1); + if (command=="anim") + { + stop_all_animations(); + if (option=="start") + { + start_cycle_animations(); + } + else if (option=="stop") + { + stop_cycle_animations(); + } + } + if (command=="verbose") + { + if (option=="on") + { + verbose = 1; + } + else if (option=="off") + { + verbose = 0; + } + } + } + + timer() + { + say_if_verbose(0, "timer triggered"); + next_animation(); + } + + touch_start(integer total_number) + { + say_if_verbose(0, "Touch started."); + start_cycle_animations(); + } +} + +// Local Variables: +// shadow-file-name: "$SW_HOME/axon/scripts/testing/lsl/cycle_object_animations.lsl" +// End: diff --git a/scripts/testing/lsl/cycle_object_animations_v2.lsl b/scripts/testing/lsl/cycle_object_animations_v2.lsl new file mode 100644 index 0000000000..60879fcce2 --- /dev/null +++ b/scripts/testing/lsl/cycle_object_animations_v2.lsl @@ -0,0 +1,133 @@ +integer listenHandle; +integer verbose; +integer current_animation_number; +string NowPlaying; + +say_if_verbose(integer channel, string message) +{ + if (verbose) + { + llSay(channel, message); + } +} + +stop_all_animations() +{ + list curr_anims = llGetObjectAnimationNames(); + say_if_verbose(0,"stopping all, curr_anims are " + (string) curr_anims); + integer length = llGetListLength(curr_anims); + integer index = 0; + while (index < length) + { + string anim = llList2String(curr_anims, index); + say_if_verbose(0, "Stopping " + anim); + llStopObjectAnimation(anim); + // This check isn't really needed, just included to demonstrate is_animation_running() + if (is_animation_running(anim)) + { + say_if_verbose(0, "ERROR - failed to stop " + anim + "!"); + } + ++index; + } +} + +integer is_animation_running(string anim) +{ + list curr_anims = llGetObjectAnimationNames(); + return ~llListFindList(curr_anims, (list)anim); +} + +start_cycle_animations() +{ + current_animation_number = llGetInventoryNumber(INVENTORY_ANIMATION); + next_animation(); // Do first iteration without waiting for timer + llSetTimerEvent(5.0); +} + +next_animation() +{ + string ItemName; + if (NowPlaying != "") + { + say_if_verbose(0, "Stopping " + NowPlaying); + llStopObjectAnimation(NowPlaying); + } + if (current_animation_number--) + { + ItemName = llGetInventoryName(INVENTORY_ANIMATION, current_animation_number); + say_if_verbose(0, "Starting " + ItemName); + llStartObjectAnimation(ItemName); + key anim_id = llGetInventoryKey(ItemName); + say_if_verbose(0, "Started item " + ItemName + " inv key " + (string) anim_id); + NowPlaying = ItemName; + } + else + { + // Start again at the top + current_animation_number = llGetInventoryNumber(INVENTORY_ANIMATION); + } +} + +stop_cycle_animations() +{ + llSetTimerEvent(0); +} + +default +{ + state_entry() + { + say_if_verbose(0, "Animated Object here"); + listenHandle = llListen(-2001,"","",""); + verbose = 0; + + stop_all_animations(); + } + + listen(integer channel, string name, key id, string message) + { + //llOwnerSay("got message " + name + " " + (string) id + " " + message); + list words = llParseString2List(message,[" "],[]); + string command = llList2String(words,0); + string option = llList2String(words,1); + if (command=="anim") + { + stop_all_animations(); + if (option=="start") + { + start_cycle_animations(); + } + else if (option=="stop") + { + stop_cycle_animations(); + } + } + if (command=="verbose") + { + if (option=="on") + { + verbose = 1; + } + else if (option=="off") + { + verbose = 0; + } + } + } + + timer() + { + say_if_verbose(0, "timer triggered"); + next_animation(); + } + + touch_start(integer total_number) + { + say_if_verbose(0, "Touch started."); + start_cycle_animations(); + } +} + +// Local Variables: +// shadow-file-name: "$SW_HOME/axon/scripts/testing/lsl/cycle_object_animations_v2.lsl" +// End: diff --git a/scripts/testing/lsl/move_in_circle_using_llSetRegionPos.lsl b/scripts/testing/lsl/move_in_circle_using_llSetRegionPos.lsl new file mode 100644 index 0000000000..cc5b899b67 --- /dev/null +++ b/scripts/testing/lsl/move_in_circle_using_llSetRegionPos.lsl @@ -0,0 +1,90 @@ +integer listenHandle; +integer verbose; +integer num_steps = 12; +float circle_time = 5.0; +integer circle_step; +vector circle_pos; +vector circle_center; +float circle_radius; + +start_circle(vector center, float radius) +{ + vector currentPosition = llGetPos(); + circle_center = center; + circle_radius = radius; + circle_step = 0; + llSetTimerEvent(circle_time/num_steps); + llTargetOmega(<0.0, 0.0, 1.0>, TWO_PI/circle_time, 1.0); +} + +stop_circle() +{ + llSetTimerEvent(0); + llTargetOmega(<0.0, 0.0, 1.0>, TWO_PI/circle_time, 0.0); + llSetRegionPos(circle_center); +} + +next_circle() +{ + float rad = (circle_step * TWO_PI)/num_steps; + float x = circle_center.x + llCos(rad)*circle_radius; + float y = circle_center.y + llSin(rad)*circle_radius; + float z = circle_center.z; + llSetRegionPos(); + circle_step = (circle_step+1)%num_steps; +} + +default +{ + state_entry() + { + //llSay(0, "Hello, Avatar!"); + listenHandle = llListen(-2001,"","",""); + verbose = 0; + circle_center = llGetPos(); + } + + listen(integer channel, string name, key id, string message) + { + //llOwnerSay("got message " + name + " " + (string) id + " " + message); + list words = llParseString2List(message,[" "],[]); + string command = llList2String(words,0); + string option = llList2String(words,1); + if (command=="anim") + { + if (option=="start") + { + start_circle(llGetPos(), 3.0); + } + else if (option=="stop") + { + stop_circle(); + } + } + if (command=="verbose") + { + if (option=="on") + { + verbose = 1; + } + else if (option=="off") + { + verbose = 0; + } + } + if (command=="step") + { + llSetTimerEvent(0); + next_circle(); + } + } + + timer() + { + next_circle(); + } +} + +// Local Variables: +// shadow-file-name: "$SW_HOME/axon/scripts/testing/lsl/move_in_circle_using_llSetRegionPos.lsl" +// End: