From 35b4a08ff0485bd6498dc929a99c9fd67da0e089 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 24 Jan 2011 17:50:12 -0800 Subject: Added new notifications for ER-393 and ER-394 --- indra/newview/skins/default/xui/en/notifications.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 6f21938bdb..09e35994ad 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4829,6 +4829,20 @@ You don't have permission to view this notecard. Insufficient permissions to rez object. + +Unable to send IM across parent estates. + + + +Unable to transfer inventory across parent estates. + + Date: Mon, 24 Jan 2011 18:15:03 -0800 Subject: Exposing estate_id in new instant message for viewer use. Part of ER-393 --- indra/newview/llimview.cpp | 1 + indra/newview/llimview.h | 1 + indra/newview/llviewermessage.cpp | 8 ++++++++ 3 files changed, 10 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index afd565bb26..00000bffc9 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3231,6 +3231,7 @@ public: std::string((char*)&bin_bucket[0]), IM_SESSION_INVITE, message_params["parent_estate_id"].asInteger(), + message_params["estate_id"].asInteger(), message_params["region_id"].asUUID(), ll_vector3_from_sd(message_params["position"]), true); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index a15776c207..486e8c2d5d 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -335,6 +335,7 @@ public: const std::string& session_name = LLStringUtil::null, EInstantMessage dialog = IM_NOTHING_SPECIAL, U32 parent_estate_id = 0, + U32 estate_id = 0, const LLUUID& region_id = LLUUID::null, const LLVector3& position = LLVector3::zero, bool link_name = false); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7dc5d96689..858e558e6c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2202,6 +2202,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) std::string name; std::string message; U32 parent_estate_id = 0; + U32 estate_id = 0; LLUUID region_id; LLVector3 position; U8 binary_bucket[MTUBYTES]; @@ -2221,6 +2222,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, name); msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, message); msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_ParentEstateID, parent_estate_id); + if (msg->getNumberOfBlocks(_PREHASH_EstateBlock) > 0) + { + msg->getU32Fast(_PREHASH_EstateBlock, _PREHASH_EstateID, estate_id); + } msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_RegionID, region_id); msg->getVector3Fast(_PREHASH_MessageBlock, _PREHASH_Position, position); msg->getBinaryDataFast( _PREHASH_MessageBlock, _PREHASH_BinaryBucket, binary_bucket, 0, 0, MTUBYTES); @@ -2321,6 +2326,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLStringUtil::null, dialog, parent_estate_id, + estate_id, region_id, position, true); @@ -2366,6 +2372,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLStringUtil::null, dialog, parent_estate_id, + estate_id, region_id, position, true); @@ -2683,6 +2690,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) ll_safe_string((char*)binary_bucket), IM_SESSION_INVITE, parent_estate_id, + estate_id, region_id, position, true); -- cgit v1.2.3 From 4a083db6c52d2cc5c1cd1f908270f5952ace6505 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 25 Jan 2011 08:16:29 -0800 Subject: Backed out changeset b3a24f496b23 --- indra/newview/llimview.cpp | 1 - indra/newview/llimview.h | 1 - indra/newview/llviewermessage.cpp | 8 -------- 3 files changed, 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 00000bffc9..afd565bb26 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3231,7 +3231,6 @@ public: std::string((char*)&bin_bucket[0]), IM_SESSION_INVITE, message_params["parent_estate_id"].asInteger(), - message_params["estate_id"].asInteger(), message_params["region_id"].asUUID(), ll_vector3_from_sd(message_params["position"]), true); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 486e8c2d5d..a15776c207 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -335,7 +335,6 @@ public: const std::string& session_name = LLStringUtil::null, EInstantMessage dialog = IM_NOTHING_SPECIAL, U32 parent_estate_id = 0, - U32 estate_id = 0, const LLUUID& region_id = LLUUID::null, const LLVector3& position = LLVector3::zero, bool link_name = false); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 858e558e6c..7dc5d96689 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2202,7 +2202,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) std::string name; std::string message; U32 parent_estate_id = 0; - U32 estate_id = 0; LLUUID region_id; LLVector3 position; U8 binary_bucket[MTUBYTES]; @@ -2222,10 +2221,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, name); msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, message); msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_ParentEstateID, parent_estate_id); - if (msg->getNumberOfBlocks(_PREHASH_EstateBlock) > 0) - { - msg->getU32Fast(_PREHASH_EstateBlock, _PREHASH_EstateID, estate_id); - } msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_RegionID, region_id); msg->getVector3Fast(_PREHASH_MessageBlock, _PREHASH_Position, position); msg->getBinaryDataFast( _PREHASH_MessageBlock, _PREHASH_BinaryBucket, binary_bucket, 0, 0, MTUBYTES); @@ -2326,7 +2321,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLStringUtil::null, dialog, parent_estate_id, - estate_id, region_id, position, true); @@ -2372,7 +2366,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLStringUtil::null, dialog, parent_estate_id, - estate_id, region_id, position, true); @@ -2690,7 +2683,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) ll_safe_string((char*)binary_bucket), IM_SESSION_INVITE, parent_estate_id, - estate_id, region_id, position, true); -- cgit v1.2.3 From 9a9f813c2f1292942c8cc8fcde9c48ed2ca31f42 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Mon, 7 Mar 2011 17:16:16 -0800 Subject: Added some error checking, because s*** happens. --- indra/newview/llappviewerwin32.cpp | 41 +++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index d328567a0e..2fbec6e49e 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -301,23 +301,44 @@ void create_console() // redirect unbuffered STDOUT to the console l_std_handle = (long)GetStdHandle(STD_OUTPUT_HANDLE); h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT); - fp = _fdopen( h_con_handle, "w" ); - *stdout = *fp; - setvbuf( stdout, NULL, _IONBF, 0 ); + if (h_con_handle == -1) + { + llwarns << "create_console() failed to open stdout handle" << llendl; + } + else + { + fp = _fdopen( h_con_handle, "w" ); + *stdout = *fp; + setvbuf( stdout, NULL, _IONBF, 0 ); + } // redirect unbuffered STDIN to the console l_std_handle = (long)GetStdHandle(STD_INPUT_HANDLE); h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT); - fp = _fdopen( h_con_handle, "r" ); - *stdin = *fp; - setvbuf( stdin, NULL, _IONBF, 0 ); + if (h_con_handle == -1) + { + llwarns << "create_console() failed to open stdin handle" << llendl; + } + else + { + fp = _fdopen( h_con_handle, "r" ); + *stdin = *fp; + setvbuf( stdin, NULL, _IONBF, 0 ); + } // redirect unbuffered STDERR to the console l_std_handle = (long)GetStdHandle(STD_ERROR_HANDLE); h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT); - fp = _fdopen( h_con_handle, "w" ); - *stderr = *fp; - setvbuf( stderr, NULL, _IONBF, 0 ); + if (h_con_handle == -1) + { + llwarns << "create_console() failed to open stderr handle" << llendl; + } + else + { + fp = _fdopen( h_con_handle, "w" ); + *stderr = *fp; + setvbuf( stderr, NULL, _IONBF, 0 ); + } } LLAppViewerWin32::LLAppViewerWin32(const char* cmd_line) : @@ -363,8 +384,10 @@ bool LLAppViewerWin32::initLogging() void LLAppViewerWin32::initConsole() { + llinfos << "Test before create_console" << llendl; // pop up debug console create_console(); + llinfos << "Test after create_console" << llendl; return LLAppViewer::initConsole(); } -- cgit v1.2.3 From 07e3f01389c6f86a370e6b591bf8e7d1ccff2729 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Tue, 8 Mar 2011 09:46:56 -0800 Subject: Removed two log messages commited in error earlier. --- indra/newview/llappviewerwin32.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 2fbec6e49e..b9d546de59 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -384,10 +384,8 @@ bool LLAppViewerWin32::initLogging() void LLAppViewerWin32::initConsole() { - llinfos << "Test before create_console" << llendl; // pop up debug console create_console(); - llinfos << "Test after create_console" << llendl; return LLAppViewer::initConsole(); } -- cgit v1.2.3 From 58b393bb1eb2ef15597803741fded4942f3dc647 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 9 Mar 2011 03:31:48 +0000 Subject: Fix to LLWindow listener keyUp event. Fix to headless client scanKeyboard, allowing input from eventhost --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f7ec83bea9..d0e1a454fa 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1119,11 +1119,11 @@ bool LLAppViewer::mainLoop() // Scan keyboard for movement keys. Command keys and typing // are handled by windows callbacks. Don't do this until we're // done initializing. JC - if (gViewerWindow->mWindow->getVisible() + if ((gHeadlessClient || gViewerWindow->mWindow->getVisible()) && gViewerWindow->getActive() && !gViewerWindow->mWindow->getMinimized() && LLStartUp::getStartupState() == STATE_STARTED - && !gViewerWindow->getShowProgress() + && (gHeadlessClient || !gViewerWindow->getShowProgress()) && !gFocusMgr.focusLocked()) { LLMemType mjk(LLMemType::MTYPE_JOY_KEY); -- cgit v1.2.3 From bdd994d186369afdfd263d4c40689b165b75bee6 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Wed, 9 Mar 2011 14:32:22 -0800 Subject: Get rid of un-used LLUUID. Reviewed by Kelly --- indra/newview/llstartup.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 49d4983294..7ced909dd3 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1965,7 +1965,6 @@ bool idle_startup() // Start automatic replay if the flag is set. if (gSavedSettings.getBOOL("StatsAutoRun") || LLAgentPilot::sReplaySession) { - LLUUID id; LL_DEBUGS("AppInit") << "Starting automatic playback" << LL_ENDL; gAgentPilot.startPlayback(); } -- cgit v1.2.3 From 1558cb30d2e6009fa43a4838b746259298279ef0 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 11 Mar 2011 14:45:15 -0800 Subject: Added 'getPosition' function to LLAgent control in llEventHost. Reviewed by Kelly. --- indra/newview/llagentlistener.cpp | 27 +++++++++++++++++++++++++++ indra/newview/llagentlistener.h | 1 + 2 files changed, 28 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index c453fe91f4..ef39fed587 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -59,11 +59,20 @@ LLAgentListener::LLAgentListener(LLAgent &agent) "Set the agent to a fixed orientation (optionally specify [\"lookat\"] = array of [x, y, z])", &LLAgentListener::resetAxes); add("getAxes", + "Obsolete - use getPosition instead\n" "Send information about the agent's orientation on [\"reply\"]:\n" "[\"euler\"]: map of {roll, pitch, yaw}\n" "[\"quat\"]: array of [x, y, z, w] quaternion values", &LLAgentListener::getAxes, LLSDMap("reply", LLSD())); + add("getPosition", + "Send information about the agent's position and orientation on [\"reply\"]:\n" + "[\"region\"]: array of region {x, y, z} position\n" + "[\"global\"]: array of global {x, y, z} position\n" + "[\"euler\"]: map of {roll, pitch, yaw}\n" + "[\"quat\"]: array of [x, y, z, w] quaternion values", + &LLAgentListener::getPosition, + LLSDMap("reply", LLSD())); } void LLAgentListener::requestTeleport(LLSD const & event_data) const @@ -140,3 +149,21 @@ void LLAgentListener::getAxes(const LLSD& event) const ("euler", LLSDMap("roll", roll)("pitch", pitch)("yaw", yaw)), event); } + + +void LLAgentListener::getPosition(const LLSD& event) const +{ + LLVector3 region_pos(mAgent.getPositionAgent()); + LLVector3 global_pos(mAgent.getPositionGlobal()); + LLQuaternion quat(mAgent.getQuat()); + F32 roll, pitch, yaw; + quat.getEulerAngles(&roll, &pitch, &yaw); + // The official query API for LLQuaternion's [x, y, z, w] values is its + // public member mQ... + sendReply(LLSDMap + ("region", llsd_copy_array(boost::begin(region_pos.mV), boost::end(region_pos.mV))) + ("global", llsd_copy_array(boost::begin(global_pos.mV), boost::end(global_pos.mV))) + ("quat", llsd_copy_array(boost::begin(quat.mQ), boost::end(quat.mQ))) + ("euler", LLSDMap("roll", roll)("pitch", pitch)("yaw", yaw)), + event); +} diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h index 0aa58d0b16..6f087fc3da 100644 --- a/indra/newview/llagentlistener.h +++ b/indra/newview/llagentlistener.h @@ -46,6 +46,7 @@ private: void requestStand(LLSD const & event_data) const; void resetAxes(const LLSD& event) const; void getAxes(const LLSD& event) const; + void getPosition(const LLSD& event) const; private: LLAgent & mAgent; -- cgit v1.2.3 From 797a405b3704ec7c7f1aa871a0274c97def7e55e Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Mon, 14 Mar 2011 17:24:20 -0700 Subject: ER-611: Fix viewer so it can support multiple instances if a SLURL is passed in. Added "SLURLPassToOtherInstance" to settings.xml and check before pushing a slurl to another viewer instance. Reviewed by Kelly --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a94ff89a8e..b09fb9b5ff 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12157,6 +12157,17 @@ Value 1 + SLURLPassToOtherInstance + + Comment + Pass execution to prevoius viewer instances if there is a given slurl + Persist + 1 + Type + Boolean + Value + 1 + soundsbeacon Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d0e1a454fa..2c79749894 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2372,7 +2372,8 @@ bool LLAppViewer::initConfiguration() // it relies on checking a marker file which will not work when running // out of different directories - if (LLStartUp::getStartSLURL().isValid()) + if (LLStartUp::getStartSLURL().isValid() && + !(gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) { if (sendURLToOtherInstance(LLStartUp::getStartSLURL().getSLURLString())) { -- cgit v1.2.3 From 18ae6c639e58c4c996d4c3b2a4b34ef41deab970 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Mon, 14 Mar 2011 17:33:33 -0700 Subject: Added warning if llEventHost LLAgent requestSit() can't find the sit target --- indra/newview/llagentlistener.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index ef39fed587..da5bf59e74 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -117,6 +117,11 @@ void LLAgentListener::requestSit(LLSD const & event_data) const object->getRegion()->sendReliableMessage(); } + else + { + llwarns << "LLAgent requestSit could not find the sit target " + << event_data["obj_uuid"].asUUID() << llendl; + } } void LLAgentListener::requestStand(LLSD const & event_data) const -- cgit v1.2.3 From bc0833d5db9e887f72ea6e7a630781203ad6ad77 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 15 Mar 2011 04:19:16 +0000 Subject: ER-612: Add LLEventAPI access to LLAgent auto pilot --- indra/newview/llagent.cpp | 51 +++++++---- indra/newview/llagent.h | 10 ++- indra/newview/llagentlistener.cpp | 183 ++++++++++++++++++++++++++++---------- indra/newview/llagentlistener.h | 21 +++-- 4 files changed, 191 insertions(+), 74 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 7d491a7774..9025982310 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1214,6 +1214,12 @@ void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::s return; } + // Are there any pending callbacks from previous auto pilot requests? + if (mAutoPilotFinishedCallback) + { + mAutoPilotFinishedCallback(dist_vec(gAgent.getPositionGlobal(), mAutoPilotTargetGlobal) < mAutoPilotStopDistance, mAutoPilotCallbackData); + } + mAutoPilotFinishedCallback = finish_callback; mAutoPilotCallbackData = callback_data; mAutoPilotRotationThreshold = rot_threshold; @@ -1262,22 +1268,8 @@ void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::s } mAutoPilot = TRUE; - mAutoPilotTargetGlobal = target_global; - - // trace ray down to find height of destination from ground - LLVector3d traceEndPt = target_global; - traceEndPt.mdV[VZ] -= 20.f; - - LLVector3d targetOnGround; - LLVector3 groundNorm; - LLViewerObject *obj; + setAutoPilotTargetGlobal(target_global); - LLWorld::getInstance()->resolveStepHeightGlobal(NULL, target_global, traceEndPt, targetOnGround, groundNorm, &obj); - F64 target_height = llmax((F64)gAgentAvatarp->getPelvisToFoot(), target_global.mdV[VZ] - targetOnGround.mdV[VZ]); - - // clamp z value of target to minimum height above ground - mAutoPilotTargetGlobal.mdV[VZ] = targetOnGround.mdV[VZ] + target_height; - mAutoPilotTargetDist = (F32)dist_vec(gAgent.getPositionGlobal(), mAutoPilotTargetGlobal); if (target_rotation) { mAutoPilotUseRotation = TRUE; @@ -1294,13 +1286,37 @@ void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::s } +//----------------------------------------------------------------------------- +// setAutoPilotTargetGlobal +//----------------------------------------------------------------------------- +void LLAgent::setAutoPilotTargetGlobal(const LLVector3d &target_global) +{ + if (mAutoPilot) + { + mAutoPilotTargetGlobal = target_global; + + // trace ray down to find height of destination from ground + LLVector3d traceEndPt = target_global; + traceEndPt.mdV[VZ] -= 20.f; + + LLVector3d targetOnGround; + LLVector3 groundNorm; + LLViewerObject *obj; + + LLWorld::getInstance()->resolveStepHeightGlobal(NULL, target_global, traceEndPt, targetOnGround, groundNorm, &obj); + F64 target_height = llmax((F64)gAgentAvatarp->getPelvisToFoot(), target_global.mdV[VZ] - targetOnGround.mdV[VZ]); + + // clamp z value of target to minimum height above ground + mAutoPilotTargetGlobal.mdV[VZ] = targetOnGround.mdV[VZ] + target_height; + mAutoPilotTargetDist = (F32)dist_vec(gAgent.getPositionGlobal(), mAutoPilotTargetGlobal); + } +} + //----------------------------------------------------------------------------- // startFollowPilot() //----------------------------------------------------------------------------- void LLAgent::startFollowPilot(const LLUUID &leader_id) { - if (!mAutoPilot) return; - mLeaderID = leader_id; if ( mLeaderID.isNull() ) return; @@ -1338,6 +1354,7 @@ void LLAgent::stopAutoPilot(BOOL user_cancel) if (mAutoPilotFinishedCallback) { mAutoPilotFinishedCallback(!user_cancel && dist_vec(gAgent.getPositionGlobal(), mAutoPilotTargetGlobal) < mAutoPilotStopDistance, mAutoPilotCallbackData); + mAutoPilotFinishedCallback = NULL; } mLeaderID = LLUUID::null; diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 896408c0dd..0fc77bd3a1 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -467,6 +467,14 @@ public: public: BOOL getAutoPilot() const { return mAutoPilot; } LLVector3d getAutoPilotTargetGlobal() const { return mAutoPilotTargetGlobal; } + LLUUID getAutoPilotLeaderID() const { return mLeaderID; } + F32 getAutoPilotStopDistance() const { return mAutoPilotStopDistance; } + F32 getAutoPilotTargetDist() const { return mAutoPilotTargetDist; } + BOOL getAutoPilotUseRotation() const { return mAutoPilotUseRotation; } + LLVector3 getAutoPilotTargetFacing() const { return mAutoPilotTargetFacing; } + F32 getAutoPilotRotationThreshold() const { return mAutoPilotRotationThreshold; } + std::string getAutoPilotBehaviorName() const { return mAutoPilotBehaviorName; } + void startAutoPilotGlobal(const LLVector3d &pos_global, const std::string& behavior_name = std::string(), const LLQuaternion *target_rotation = NULL, @@ -474,7 +482,7 @@ public: F32 stop_distance = 0.f, F32 rotation_threshold = 0.03f); void startFollowPilot(const LLUUID &leader_id); void stopAutoPilot(BOOL user_cancel = FALSE); - void setAutoPilotGlobal(const LLVector3d &pos_global); + void setAutoPilotTargetGlobal(const LLVector3d &target_global); void autoPilot(F32 *delta_yaw); // Autopilot walking action, angles in radians void renderAutoPilotTarget(); private: diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index ef39fed587..8377a66286 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -45,14 +45,14 @@ LLAgentListener::LLAgentListener(LLAgent &agent) "LLAgent listener to (e.g.) teleport, sit, stand, etc."), mAgent(agent) { - add("requestTeleport", + add("requestTeleport", "Teleport: [\"regionname\"], [\"x\"], [\"y\"], [\"z\"]\n" "If [\"skip_confirmation\"] is true, use LLURLDispatcher rather than LLCommandDispatcher.", &LLAgentListener::requestTeleport); - add("requestSit", + add("requestSit", "Ask to sit on the object specified in [\"obj_uuid\"]", &LLAgentListener::requestSit); - add("requestStand", + add("requestStand", "Ask to stand up", &LLAgentListener::requestStand); add("resetAxes", @@ -73,55 +73,90 @@ LLAgentListener::LLAgentListener(LLAgent &agent) "[\"quat\"]: array of [x, y, z, w] quaternion values", &LLAgentListener::getPosition, LLSDMap("reply", LLSD())); + add("startAutoPilot", + "Start the autopilot system using the following parameters:\n" + "[\"target_global\"]: array of target global {x, y, z} position\n" + "[\"stop_distance\"]: target maxiumum distance from target [default: autopilot guess]\n" + "[\"target_rotation\"]: array of [x, y, z, w] quaternion values [default: no target]\n" + "[\"rotation_threshold\"]: target maximum angle from target facing rotation [default: 0.03 radians]\n" + "[\"behavior_name\"]: name of the autopilot behavior [default: \"\"]", + //"[\"callback_pump\"]: pump to send success/failure and callback data to [default: none]\n" + //"[\"callback_data\"]: data to send back during a callback [default: none]", + &LLAgentListener::startAutoPilot); + add("getAutoPilot", + "Send information about current state of the autopilot system to [\"reply\"]:\n" + "[\"enabled\"]: boolean indicating whether or not autopilot is enabled\n" + "[\"target_global\"]: array of target global {x, y, z} position\n" + "[\"leader_id\"]: uuid of target autopilot is following\n" + "[\"stop_distance\"]: target maximum distance from target\n" + "[\"target_distance\"]: last known distance from target\n" + "[\"use_rotation\"]: boolean indicating if autopilot has a target facing rotation\n" + "[\"target_facing\"]: array of {x, y} target direction to face\n" + "[\"rotation_threshold\"]: target maximum angle from target facing rotation\n" + "[\"behavior_name\"]: name of the autopilot behavior", + &LLAgentListener::getAutoPilot, + LLSDMap("reply", LLSD())); + add("startFollowPilot", + "Follow [\"leader_id\"] using the autopilot system.", + &LLAgentListener::startFollowPilot); + add("setAutoPilotTarget", + "Update target for currently running autopilot:\n" + "[\"target_global\"]: array of target global {x, y, z} position", + &LLAgentListener::setAutoPilotTarget); + add("stopAutoPilot", + "Stop the autopilot system:\n" + "[\"user_cancel\"] indicates whether or not to act as though user canceled autopilot [default: false]", + &LLAgentListener::stopAutoPilot); + } void LLAgentListener::requestTeleport(LLSD const & event_data) const { - if(event_data["skip_confirmation"].asBoolean()) - { - LLSD params(LLSD::emptyArray()); - params.append(event_data["regionname"]); - params.append(event_data["x"]); - params.append(event_data["y"]); - params.append(event_data["z"]); - LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, true); - // *TODO - lookup other LLCommandHandlers for "agent", "classified", "event", "group", "floater", "parcel", "login", login_refresh", "balance", "chat" - // should we just compose LLCommandHandler and LLDispatchListener? - } - else - { - std::string url = LLSLURL(event_data["regionname"], - LLVector3(event_data["x"].asReal(), - event_data["y"].asReal(), - event_data["z"].asReal())).getSLURLString(); - LLURLDispatcher::dispatch(url, NULL, false); - } + if(event_data["skip_confirmation"].asBoolean()) + { + LLSD params(LLSD::emptyArray()); + params.append(event_data["regionname"]); + params.append(event_data["x"]); + params.append(event_data["y"]); + params.append(event_data["z"]); + LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, true); + // *TODO - lookup other LLCommandHandlers for "agent", "classified", "event", "group", "floater", "parcel", "login", login_refresh", "balance", "chat" + // should we just compose LLCommandHandler and LLDispatchListener? + } + else + { + std::string url = LLSLURL(event_data["regionname"], + LLVector3(event_data["x"].asReal(), + event_data["y"].asReal(), + event_data["z"].asReal())).getSLURLString(); + LLURLDispatcher::dispatch(url, NULL, false); + } } void LLAgentListener::requestSit(LLSD const & event_data) const { - //mAgent.getAvatarObject()->sitOnObject(); - // shamelessly ripped from llviewermenu.cpp:handle_sit_or_stand() - // *TODO - find a permanent place to share this code properly. - LLViewerObject *object = gObjectList.findObject(event_data["obj_uuid"]); - - if (object && object->getPCode() == LL_PCODE_VOLUME) - { - gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, mAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, mAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_TargetObject); - gMessageSystem->addUUIDFast(_PREHASH_TargetID, object->mID); - gMessageSystem->addVector3Fast(_PREHASH_Offset, LLVector3(0,0,0)); - - object->getRegion()->sendReliableMessage(); - } + //mAgent.getAvatarObject()->sitOnObject(); + // shamelessly ripped from llviewermenu.cpp:handle_sit_or_stand() + // *TODO - find a permanent place to share this code properly. + LLViewerObject *object = gObjectList.findObject(event_data["obj_uuid"]); + + if (object && object->getPCode() == LL_PCODE_VOLUME) + { + gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, mAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, mAgent.getSessionID()); + gMessageSystem->nextBlockFast(_PREHASH_TargetObject); + gMessageSystem->addUUIDFast(_PREHASH_TargetID, object->mID); + gMessageSystem->addVector3Fast(_PREHASH_Offset, LLVector3(0,0,0)); + + object->getRegion()->sendReliableMessage(); + } } void LLAgentListener::requestStand(LLSD const & event_data) const { - mAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + mAgent.setControlFlags(AGENT_CONTROL_STAND_UP); } void LLAgentListener::resetAxes(const LLSD& event) const @@ -153,17 +188,69 @@ void LLAgentListener::getAxes(const LLSD& event) const void LLAgentListener::getPosition(const LLSD& event) const { - LLVector3 region_pos(mAgent.getPositionAgent()); - LLVector3 global_pos(mAgent.getPositionGlobal()); - LLQuaternion quat(mAgent.getQuat()); F32 roll, pitch, yaw; + LLQuaternion quat(mAgent.getQuat()); quat.getEulerAngles(&roll, &pitch, &yaw); - // The official query API for LLQuaternion's [x, y, z, w] values is its - // public member mQ... sendReply(LLSDMap - ("region", llsd_copy_array(boost::begin(region_pos.mV), boost::end(region_pos.mV))) - ("global", llsd_copy_array(boost::begin(global_pos.mV), boost::end(global_pos.mV))) - ("quat", llsd_copy_array(boost::begin(quat.mQ), boost::end(quat.mQ))) + ("region", ll_sd_from_vector3(mAgent.getPositionAgent())) + ("global", ll_sd_from_vector3d(mAgent.getPositionGlobal())) + ("quat", ll_sd_from_quaternion(quat)) ("euler", LLSDMap("roll", roll)("pitch", pitch)("yaw", yaw)), event); } + + +void LLAgentListener::startAutoPilot(LLSD const & event) const +{ + LLQuaternion target_rotation_value; + LLQuaternion* target_rotation = NULL; + if (event.has("target_rotation")) + { + target_rotation_value = ll_quaternion_from_sd(event["target_rotation"]); + target_rotation = &target_rotation_value; + } + // *TODO: Use callback_pump and callback_data + F32 rotation_threshold = 0.03f; + if (event.has("rotation_threshold")) + { + rotation_threshold = event["rotation_threshold"].asReal(); + } + mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event["target_global"]), + event["behavior_name"], + target_rotation, + NULL, NULL, + event["stop_distance"].asReal(), + rotation_threshold); +} + +void LLAgentListener::getAutoPilot(const LLSD& event) const +{ + sendReply(LLSDMap + ("enabled", (LLSD::Boolean) mAgent.getAutoPilot()) + ("target_global", ll_sd_from_vector3d(mAgent.getAutoPilotTargetGlobal())) + ("leader_id", mAgent.getAutoPilotLeaderID()) + ("stop_distance", mAgent.getAutoPilotStopDistance()) + ("target_distance", mAgent.getAutoPilotTargetDist()) + ("use_rotation", (LLSD::Boolean) mAgent.getAutoPilotUseRotation()) + ("target_facing", ll_sd_from_vector3(mAgent.getAutoPilotTargetFacing())) + ("rotation_threshold", mAgent.getAutoPilotRotationThreshold()) + ("behavior_name", mAgent.getAutoPilotBehaviorName()), + event); +} + +void LLAgentListener::startFollowPilot(LLSD const & event) const +{ + mAgent.startFollowPilot(event["leader_id"]); +} + +void LLAgentListener::setAutoPilotTarget(LLSD const & event) const +{ + LLVector3d target_global(ll_vector3d_from_sd(event["target_global"])); + mAgent.setAutoPilotTargetGlobal(target_global); +} + +void LLAgentListener::stopAutoPilot(LLSD const & event) const +{ + mAgent.stopAutoPilot(event["user_cancel"]); +} + diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h index 6f087fc3da..40225c9c63 100644 --- a/indra/newview/llagentlistener.h +++ b/indra/newview/llagentlistener.h @@ -38,18 +38,23 @@ class LLSD; class LLAgentListener : public LLEventAPI { public: - LLAgentListener(LLAgent &agent); + LLAgentListener(LLAgent &agent); private: - void requestTeleport(LLSD const & event_data) const; - void requestSit(LLSD const & event_data) const; - void requestStand(LLSD const & event_data) const; - void resetAxes(const LLSD& event) const; - void getAxes(const LLSD& event) const; - void getPosition(const LLSD& event) const; + void requestTeleport(LLSD const & event_data) const; + void requestSit(LLSD const & event_data) const; + void requestStand(LLSD const & event_data) const; + void resetAxes(const LLSD& event) const; + void getAxes(const LLSD& event) const; + void getPosition(const LLSD& event) const; + void startAutoPilot(const LLSD& event) const; + void getAutoPilot(const LLSD& event) const; + void startFollowPilot(const LLSD& event) const; + void setAutoPilotTarget(const LLSD& event) const; + void stopAutoPilot(const LLSD& event) const; private: - LLAgent & mAgent; + LLAgent & mAgent; }; #endif // LL_LLAGENTLISTENER_H -- cgit v1.2.3 From b91ac7ae99c4034b31a07a8074f2e14d64790976 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Tue, 15 Mar 2011 16:06:38 -0700 Subject: ER-614 : Add lleventhost API to send chat messages. Reviewed by Kelly --- indra/newview/CMakeLists.txt | 2 + indra/newview/llbottomtray.cpp | 3 ++ indra/newview/llbottomtray.h | 4 ++ indra/newview/llnearbychatbarlistener.cpp | 87 +++++++++++++++++++++++++++++++ indra/newview/llnearbychatbarlistener.h | 50 ++++++++++++++++++ 5 files changed, 146 insertions(+) create mode 100644 indra/newview/llnearbychatbarlistener.cpp create mode 100644 indra/newview/llnearbychatbarlistener.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 11bebf04ef..c835891cbc 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -307,6 +307,7 @@ set(viewer_SOURCE_FILES llnearbychat.cpp llnearbychatbar.cpp llnearbychathandler.cpp + llnearbychatbarlistener.cpp llnetmap.cpp llnotificationalerthandler.cpp llnotificationgrouphandler.cpp @@ -848,6 +849,7 @@ set(viewer_HEADER_FILES llnearbychat.h llnearbychatbar.h llnearbychathandler.h + llnearbychatbarlistener.h llnetmap.h llnotificationhandler.h llnotificationmanager.h diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index d8ec4b605c..c55c72e2a4 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -44,6 +44,7 @@ #include "llhints.h" #include "llimfloater.h" // for LLIMFloater #include "llnearbychatbar.h" +#include "llnearbychatbarlistener.h" #include "llspeakbutton.h" #include "llsplitbutton.h" #include "llsyswellwindow.h" @@ -551,6 +552,8 @@ BOOL LLBottomTray::postBuild() mNearbyChatBar = findChild("chat_bar"); LLHints::registerHintTarget("chat_bar", mNearbyChatBar->LLView::getHandle()); + mListener.reset(new LLNearbyChatBarListener(*mNearbyChatBar)); + mChatBarContainer = getChild("chat_bar_layout_panel"); mNearbyCharResizeHandlePanel = getChild("chat_bar_resize_handle_panel"); diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 04e5f5e9e0..83a33845bf 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -39,6 +39,7 @@ class LLIMChiclet; class LLBottomTrayLite; class LLLayoutPanel; class LLMenuGL; +class LLNearbyChatBarListener; // Build time optimization, generate once in .cpp file #ifndef LLBOTTOMTRAY_CPP @@ -508,6 +509,9 @@ protected: * Image used to show position where dragged button will be dropped. */ LLUIImage* mImageDragIndication; + + // We want only one LLNearbyChatBarListener object, so it's tied to this singleton + boost::shared_ptr mListener; }; #endif // LL_LLBOTTOMPANEL_H diff --git a/indra/newview/llnearbychatbarlistener.cpp b/indra/newview/llnearbychatbarlistener.cpp new file mode 100644 index 0000000000..c30e89c35e --- /dev/null +++ b/indra/newview/llnearbychatbarlistener.cpp @@ -0,0 +1,87 @@ +/** + * @file llnearbychatbarlistener.cpp + * @author Dave Simmons + * @date 2011-03-15 + * @brief Implementation for LLNearbyChatBarListener. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llnearbychatbarlistener.h" + +#include "llagent.h" +#include "llchat.h" + + +// Ugly glue for llnearbychatbar.cpp utility function. Avoids pulling in a bunch of UI +// definitions. Also needs to get cleaned up from llchatbar.cpp +extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); + + +LLNearbyChatBarListener::LLNearbyChatBarListener(LLNearbyChatBar & chatbar) + : LLEventAPI("LLChatBar", + "LLChatBar listener to (e.g.) sendChat, etc."), + mChatbar(chatbar) +{ + add("sendChat", + "Send chat to the simulator:\n" + "[\"message\"] chat message text [required]\n" + "[\"channel\"] chat channel number [default = 0]\n" + "[\"type\"] chat type \"whisper\", \"normal\", \"shout\" [default = \"normal\"]", + &LLNearbyChatBarListener::sendChat); +} + + +// "sendChat" command +void LLNearbyChatBarListener::sendChat(LLSD const & chat_data) const +{ + // Extract the data + std::string chat_text = chat_data["message"].asString(); + + S32 channel = 0; + if (chat_data.has("channel")) + { + channel = chat_data["channel"].asInteger(); + if (channel < 0 || channel >= 2147483647) + { // Use 0 up to (but not including) DEBUG_CHANNEL (wtf isn't that defined??) + channel = 0; + } + } + + EChatType type_o_chat = CHAT_TYPE_NORMAL; + if (chat_data.has("type")) + { + std::string type_string = chat_data["type"].asString(); + if (type_string == "whisper") + { + type_o_chat = CHAT_TYPE_WHISPER; + } + else if (type_string == "shout") + { + type_o_chat = CHAT_TYPE_SHOUT; + } + } + send_chat_from_viewer(chat_text, type_o_chat, channel); +} + diff --git a/indra/newview/llnearbychatbarlistener.h b/indra/newview/llnearbychatbarlistener.h new file mode 100644 index 0000000000..13e4e5990c --- /dev/null +++ b/indra/newview/llnearbychatbarlistener.h @@ -0,0 +1,50 @@ +/** + * @file llnearbychatbarlistener.h + * @author Dave Simmons + * @date 2011-03-15 + * @brief Class definition for LLNearbyChatBarListener. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#ifndef LL_LLNEARBYCHATBARLISTENER_H +#define LL_LLNEARBYCHATBARLISTENER_H + +#include "lleventapi.h" + +class LLSD; +class LLNearbyChatBar; + +class LLNearbyChatBarListener : public LLEventAPI +{ +public: + LLNearbyChatBarListener(LLNearbyChatBar & chatbar); + +private: + void sendChat(LLSD const & chat_data) const; + + LLNearbyChatBar & mChatbar; +}; + +#endif // LL_LLNEARBYCHATBARLISTENER_H + -- cgit v1.2.3 From acb763878543f2a25131b40646559feb7405c4fa Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Wed, 16 Mar 2011 13:20:18 -0700 Subject: ER-614: Add lleventhost API to send chat messages. Cleanup code a bit, now invoking proper routine to make viewer do chat animations. Commented out some un-used chat related code in llchatbar.cpp and llnotificationmanager.h. Also re-named a singleton class in llnearbychatbar.cpp so we don't have multiple LLChatHandler classes. Reviewed by Kelly --- indra/newview/llchatbar.cpp | 4 ++++ indra/newview/llnearbychatbar.cpp | 6 +++--- indra/newview/llnearbychatbarlistener.cpp | 23 ++++++++++++++++++----- indra/newview/llnotificationmanager.h | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 6e58be8174..4a58dc558a 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -671,6 +671,9 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl) } } + +/* Cruft - global gChatHandler declared below has been commented out, + so this class is never used. See similar code in llnearbychatbar.cpp class LLChatHandler : public LLCommandHandler { public: @@ -710,3 +713,4 @@ public: // Creating the object registers with the dispatcher. //LLChatHandler gChatHandler; +cruft */ diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 836ae9a0cf..7ed949cd10 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -864,11 +864,11 @@ void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT); } -class LLChatHandler : public LLCommandHandler +class LLChatCommandHandler : public LLCommandHandler { public: // not allowed from outside the app - LLChatHandler() : LLCommandHandler("chat", UNTRUSTED_BLOCK) { } + LLChatCommandHandler() : LLCommandHandler("chat", UNTRUSTED_BLOCK) { } // Your code here bool handle(const LLSD& tokens, const LLSD& query_map, @@ -902,6 +902,6 @@ public: }; // Creating the object registers with the dispatcher. -LLChatHandler gChatHandler; +LLChatCommandHandler gChatHandler; diff --git a/indra/newview/llnearbychatbarlistener.cpp b/indra/newview/llnearbychatbarlistener.cpp index c30e89c35e..99286d972b 100644 --- a/indra/newview/llnearbychatbarlistener.cpp +++ b/indra/newview/llnearbychatbarlistener.cpp @@ -29,15 +29,12 @@ #include "llviewerprecompiledheaders.h" #include "llnearbychatbarlistener.h" +#include "llnearbychatbar.h" #include "llagent.h" #include "llchat.h" -// Ugly glue for llnearbychatbar.cpp utility function. Avoids pulling in a bunch of UI -// definitions. Also needs to get cleaned up from llchatbar.cpp -extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); - LLNearbyChatBarListener::LLNearbyChatBarListener(LLNearbyChatBar & chatbar) : LLEventAPI("LLChatBar", @@ -82,6 +79,22 @@ void LLNearbyChatBarListener::sendChat(LLSD const & chat_data) const type_o_chat = CHAT_TYPE_SHOUT; } } - send_chat_from_viewer(chat_text, type_o_chat, channel); + + // Have to prepend /42 style channel numbers + std::string chat_to_send; + if (channel == 0) + { + chat_to_send = chat_text; + } + else + { + chat_to_send += "/"; + chat_to_send += chat_data["channel"].asString(); + chat_to_send += " "; + chat_to_send += chat_text; + } + + // Send it as if it was typed in + mChatbar.sendChatFromViewer(chat_to_send, type_o_chat, (BOOL)(channel == 0)); } diff --git a/indra/newview/llnotificationmanager.h b/indra/newview/llnotificationmanager.h index 72fa394621..16e82e4cce 100644 --- a/indra/newview/llnotificationmanager.h +++ b/indra/newview/llnotificationmanager.h @@ -69,7 +69,7 @@ public: private: //TODO (*) std::map > mNotifyHandlers; - std::map mChatHandlers; + // cruft std::map mChatHandlers; }; } -- cgit v1.2.3 From 034cf7273fab18a7c6ad1fda1b0d2dd600f31825 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Thu, 17 Mar 2011 11:37:20 -0700 Subject: Added optional 'fly' property to LLEventHost "LLAgent" setAutoPilot and getAutoPilot functions. Reviewed by Kelly. --- indra/newview/llagentlistener.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index d0361bf768..8476c4847a 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -220,6 +220,11 @@ void LLAgentListener::startAutoPilot(LLSD const & event) const { rotation_threshold = event["rotation_threshold"].asReal(); } + if (event.has("fly")) + { + mAgent.setFlying(event["fly"].asBoolean()); + } + mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event["target_global"]), event["behavior_name"], target_rotation, @@ -240,6 +245,7 @@ void LLAgentListener::getAutoPilot(const LLSD& event) const ("target_facing", ll_sd_from_vector3(mAgent.getAutoPilotTargetFacing())) ("rotation_threshold", mAgent.getAutoPilotRotationThreshold()) ("behavior_name", mAgent.getAutoPilotBehaviorName()), + ("fly", (LLSD::Boolean) mAgent.getFlying()), event); } -- cgit v1.2.3 From 62214c96d465650f814194215b6b8f39ae38873a Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Thu, 17 Mar 2011 11:38:43 -0700 Subject: ER-616 : Create LLEventHost API to receive incoming chat messages. Added "LLChat" LLEventStream and pass incoming chat to it. Reviewed by Kelly. --- indra/newview/llnearbychathandler.cpp | 31 +++++++++++++++++-------------- indra/newview/llnearbychathandler.h | 4 ++++ 2 files changed, 21 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index de5439e4e0..7e0f066b1d 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -441,6 +441,8 @@ void LLNearbyChatScreenChannel::reshape (S32 width, S32 height, BOOL called_fr //----------------------------------------------------------------------------------------------- //LLNearbyChatHandler //----------------------------------------------------------------------------------------------- +boost::scoped_ptr LLNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat")); + LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& id) { mType = type; @@ -525,6 +527,19 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) LLFirstUse::otherAvatarChatFirst(); } + // Build data and send event on to LLEventStream + LLSD notification; + notification["message"] = chat_msg.mText; + notification["from"] = chat_msg.mFromName; + notification["from_id"] = chat_msg.mFromID; + notification["time"] = chat_msg.mTime; + notification["source"] = (S32)chat_msg.mSourceType; + notification["chat_type"] = (S32)chat_msg.mChatType; + notification["chat_style"] = (S32)chat_msg.mChatStyle; + + sChatWatcher->post(notification); + + if( nearby_chat->getVisible() || ( chat_msg.mSourceType == CHAT_SOURCE_AGENT && gSavedSettings.getBOOL("UseChatBubbles") ) @@ -558,24 +573,13 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) } */ - LLUUID id; - id.generate(); - LLNearbyChatScreenChannel* channel = dynamic_cast(mChannel); - if(channel) { - LLSD notification; + LLUUID id; + id.generate(); notification["id"] = id; - notification["message"] = chat_msg.mText; - notification["from"] = chat_msg.mFromName; - notification["from_id"] = chat_msg.mFromID; - notification["time"] = chat_msg.mTime; - notification["source"] = (S32)chat_msg.mSourceType; - notification["chat_type"] = (S32)chat_msg.mChatType; - notification["chat_style"] = (S32)chat_msg.mChatStyle; - std::string r_color_name = "White"; F32 r_color_alpha = 1.0f; LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha); @@ -585,7 +589,6 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ; channel->addNotification(notification); } - } void LLNearbyChatHandler::onDeleteToast(LLToast* toast) diff --git a/indra/newview/llnearbychathandler.h b/indra/newview/llnearbychathandler.h index ec1f29cdfc..b0e4f62d51 100644 --- a/indra/newview/llnearbychathandler.h +++ b/indra/newview/llnearbychathandler.h @@ -29,6 +29,8 @@ #include "llnotificationhandler.h" +class LLEventPump; + //add LLNearbyChatHandler to LLNotificationsUI namespace namespace LLNotificationsUI{ @@ -44,6 +46,8 @@ public: protected: virtual void onDeleteToast(LLToast* toast); virtual void initChannel(); + + static boost::scoped_ptr sChatWatcher; }; } -- cgit v1.2.3 From 1c34f5caff0f074e983a8ef4d89fd08f1210f526 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Thu, 17 Mar 2011 16:22:54 -0700 Subject: ER-612: Add LLEventAPI access to LLAgent auto pilot. Follow-on work to allow blocking of flying during autopilot. Reviewed by Kelly. --- indra/newview/llagent.cpp | 21 ++++++++++--- indra/newview/llagent.h | 4 ++- indra/newview/llagentlistener.cpp | 66 ++++++++++++++++++++++++--------------- 3 files changed, 60 insertions(+), 31 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9025982310..75acd1a0be 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -198,6 +198,7 @@ LLAgent::LLAgent() : mAutoPilot(FALSE), mAutoPilotFlyOnStop(FALSE), + mAutoPilotAllowFlying(TRUE), mAutoPilotTargetGlobal(), mAutoPilotStopDistance(1.f), mAutoPilotUseRotation(FALSE), @@ -1207,7 +1208,7 @@ BOOL LLAgent::getBusy() const //----------------------------------------------------------------------------- // startAutoPilotGlobal() //----------------------------------------------------------------------------- -void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::string& behavior_name, const LLQuaternion *target_rotation, void (*finish_callback)(BOOL, void *), void *callback_data, F32 stop_distance, F32 rot_threshold) +void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::string& behavior_name, const LLQuaternion *target_rotation, void (*finish_callback)(BOOL, void *), void *callback_data, F32 stop_distance, F32 rot_threshold, BOOL allow_flying) { if (!isAgentAvatarValid()) { @@ -1224,6 +1225,7 @@ void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::s mAutoPilotCallbackData = callback_data; mAutoPilotRotationThreshold = rot_threshold; mAutoPilotBehaviorName = behavior_name; + mAutoPilotAllowFlying = allow_flying; LLVector3d delta_pos( target_global ); delta_pos -= getPositionGlobal(); @@ -1251,14 +1253,23 @@ void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::s } } - mAutoPilotFlyOnStop = getFlying(); + if (mAutoPilotAllowFlying) + { + mAutoPilotFlyOnStop = getFlying(); + } + else + { + mAutoPilotFlyOnStop = FALSE; + } - if (distance > 30.0) + if (distance > 30.0 && mAutoPilotAllowFlying) { setFlying(TRUE); } - if ( distance > 1.f && heightDelta > (sqrtf(mAutoPilotStopDistance) + 1.f)) + if ( distance > 1.f && + mAutoPilotAllowFlying && + heightDelta > (sqrtf(mAutoPilotStopDistance) + 1.f)) { setFlying(TRUE); // Do not force flying for "Sit" behavior to prevent flying after pressing "Stand" @@ -1394,7 +1405,7 @@ void LLAgent::autoPilot(F32 *delta_yaw) if (!isAgentAvatarValid()) return; - if (gAgentAvatarp->mInAir) + if (gAgentAvatarp->mInAir && mAutoPilotAllowFlying) { setFlying(TRUE); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 0fc77bd3a1..a45f55f27a 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -479,7 +479,8 @@ public: const std::string& behavior_name = std::string(), const LLQuaternion *target_rotation = NULL, void (*finish_callback)(BOOL, void *) = NULL, void *callback_data = NULL, - F32 stop_distance = 0.f, F32 rotation_threshold = 0.03f); + F32 stop_distance = 0.f, F32 rotation_threshold = 0.03f, + BOOL allow_flying = TRUE); void startFollowPilot(const LLUUID &leader_id); void stopAutoPilot(BOOL user_cancel = FALSE); void setAutoPilotTargetGlobal(const LLVector3d &target_global); @@ -488,6 +489,7 @@ public: private: BOOL mAutoPilot; BOOL mAutoPilotFlyOnStop; + BOOL mAutoPilotAllowFlying; LLVector3d mAutoPilotTargetGlobal; F32 mAutoPilotStopDistance; BOOL mAutoPilotUseRotation; diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 8476c4847a..6b12853547 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -184,10 +184,13 @@ void LLAgentListener::getAxes(const LLSD& event) const quat.getEulerAngles(&roll, &pitch, &yaw); // The official query API for LLQuaternion's [x, y, z, w] values is its // public member mQ... - sendReply(LLSDMap - ("quat", llsd_copy_array(boost::begin(quat.mQ), boost::end(quat.mQ))) - ("euler", LLSDMap("roll", roll)("pitch", pitch)("yaw", yaw)), - event); + LLSD reply = LLSD::emptyMap(); + reply["quat"] = llsd_copy_array(boost::begin(quat.mQ), boost::end(quat.mQ)); + reply["euler"] = LLSD::emptyMap(); + reply["euler"]["roll"] = roll; + reply["euler"]["pitch"] = pitch; + reply["euler"]["yaw"] = yaw; + sendReply(reply, event); } @@ -196,12 +199,17 @@ void LLAgentListener::getPosition(const LLSD& event) const F32 roll, pitch, yaw; LLQuaternion quat(mAgent.getQuat()); quat.getEulerAngles(&roll, &pitch, &yaw); - sendReply(LLSDMap - ("region", ll_sd_from_vector3(mAgent.getPositionAgent())) - ("global", ll_sd_from_vector3d(mAgent.getPositionGlobal())) - ("quat", ll_sd_from_quaternion(quat)) - ("euler", LLSDMap("roll", roll)("pitch", pitch)("yaw", yaw)), - event); + + LLSD reply = LLSD::emptyMap(); + reply["quat"] = llsd_copy_array(boost::begin(quat.mQ), boost::end(quat.mQ)); + reply["euler"] = LLSD::emptyMap(); + reply["euler"]["roll"] = roll; + reply["euler"]["pitch"] = pitch; + reply["euler"]["yaw"] = yaw; + reply["region"] = ll_sd_from_vector3(mAgent.getPositionAgent()); + reply["global"] = ll_sd_from_vector3d(mAgent.getPositionGlobal()); + + sendReply(reply, event); } @@ -220,9 +228,15 @@ void LLAgentListener::startAutoPilot(LLSD const & event) const { rotation_threshold = event["rotation_threshold"].asReal(); } - if (event.has("fly")) + + BOOL allow_flying = TRUE; + if (event.has("allow_flying")) { - mAgent.setFlying(event["fly"].asBoolean()); + allow_flying = (BOOL) event["allow_flying"].asBoolean(); + if (!allow_flying) + { + mAgent.setFlying(FALSE); + } } mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event["target_global"]), @@ -230,23 +244,25 @@ void LLAgentListener::startAutoPilot(LLSD const & event) const target_rotation, NULL, NULL, event["stop_distance"].asReal(), - rotation_threshold); + rotation_threshold, + allow_flying); } void LLAgentListener::getAutoPilot(const LLSD& event) const { - sendReply(LLSDMap - ("enabled", (LLSD::Boolean) mAgent.getAutoPilot()) - ("target_global", ll_sd_from_vector3d(mAgent.getAutoPilotTargetGlobal())) - ("leader_id", mAgent.getAutoPilotLeaderID()) - ("stop_distance", mAgent.getAutoPilotStopDistance()) - ("target_distance", mAgent.getAutoPilotTargetDist()) - ("use_rotation", (LLSD::Boolean) mAgent.getAutoPilotUseRotation()) - ("target_facing", ll_sd_from_vector3(mAgent.getAutoPilotTargetFacing())) - ("rotation_threshold", mAgent.getAutoPilotRotationThreshold()) - ("behavior_name", mAgent.getAutoPilotBehaviorName()), - ("fly", (LLSD::Boolean) mAgent.getFlying()), - event); + LLSD reply = LLSD::emptyMap(); + reply["enabled"] = (LLSD::Boolean) mAgent.getAutoPilot(); + reply["target_global"] = ll_sd_from_vector3d(mAgent.getAutoPilotTargetGlobal()); + reply["leader_id"] = mAgent.getAutoPilotLeaderID(); + reply["stop_distance"] = mAgent.getAutoPilotStopDistance(); + reply["target_distance"] = mAgent.getAutoPilotTargetDist(); + reply["use_rotation"] = (LLSD::Boolean) mAgent.getAutoPilotUseRotation(); + reply["target_facing"] = ll_sd_from_vector3(mAgent.getAutoPilotTargetFacing()); + reply["rotation_threshold"] = mAgent.getAutoPilotRotationThreshold(); + reply["behavior_name"] = mAgent.getAutoPilotBehaviorName(); + reply["fly"] = (LLSD::Boolean) mAgent.getFlying(); + + sendReply(reply, event); } void LLAgentListener::startFollowPilot(LLSD const & event) const -- cgit v1.2.3 From becc9d09970755f9cc0d95c46b9f2d81d5b856b5 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Tue, 22 Mar 2011 15:44:02 -0700 Subject: Improve LLEventHost API for autopilot and following avatars. Reviewed by Kelly. --- indra/newview/llagent.cpp | 11 +++- indra/newview/llagent.h | 2 +- indra/newview/llagentlistener.cpp | 109 ++++++++++++++++++++++++++++++++++---- indra/newview/llagentlistener.h | 7 +-- 4 files changed, 113 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 75acd1a0be..fd5cee2772 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1326,7 +1326,7 @@ void LLAgent::setAutoPilotTargetGlobal(const LLVector3d &target_global) //----------------------------------------------------------------------------- // startFollowPilot() //----------------------------------------------------------------------------- -void LLAgent::startFollowPilot(const LLUUID &leader_id) +void LLAgent::startFollowPilot(const LLUUID &leader_id, BOOL allow_flying, F32 stop_distance) { mLeaderID = leader_id; if ( mLeaderID.isNull() ) return; @@ -1338,7 +1338,14 @@ void LLAgent::startFollowPilot(const LLUUID &leader_id) return; } - startAutoPilotGlobal(object->getPositionGlobal()); + startAutoPilotGlobal(object->getPositionGlobal(), + std::string(), // behavior_name + NULL, // target_rotation + NULL, // finish_callback + NULL, // callback_data + stop_distance, + 0.03f, // rotation_threshold + allow_flying); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index a45f55f27a..33c05816e2 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -481,7 +481,7 @@ public: void (*finish_callback)(BOOL, void *) = NULL, void *callback_data = NULL, F32 stop_distance = 0.f, F32 rotation_threshold = 0.03f, BOOL allow_flying = TRUE); - void startFollowPilot(const LLUUID &leader_id); + void startFollowPilot(const LLUUID &leader_id, BOOL allow_flying = TRUE, F32 stop_distance = 0.5f); void stopAutoPilot(BOOL user_cancel = FALSE); void setAutoPilotTargetGlobal(const LLVector3d &target_global); void autoPilot(F32 *delta_yaw); // Autopilot walking action, angles in radians diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 6b12853547..0d30b95074 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -31,6 +31,7 @@ #include "llagentlistener.h" #include "llagent.h" +#include "llvoavatar.h" #include "llcommandhandler.h" #include "llslurl.h" #include "llurldispatcher.h" @@ -79,7 +80,8 @@ LLAgentListener::LLAgentListener(LLAgent &agent) "[\"stop_distance\"]: target maxiumum distance from target [default: autopilot guess]\n" "[\"target_rotation\"]: array of [x, y, z, w] quaternion values [default: no target]\n" "[\"rotation_threshold\"]: target maximum angle from target facing rotation [default: 0.03 radians]\n" - "[\"behavior_name\"]: name of the autopilot behavior [default: \"\"]", + "[\"behavior_name\"]: name of the autopilot behavior [default: \"\"]" + "[\"allow_flying\"]: allow flying during autopilot [default: True]", //"[\"callback_pump\"]: pump to send success/failure and callback data to [default: none]\n" //"[\"callback_data\"]: data to send back during a callback [default: none]", &LLAgentListener::startAutoPilot); @@ -97,7 +99,10 @@ LLAgentListener::LLAgentListener(LLAgent &agent) &LLAgentListener::getAutoPilot, LLSDMap("reply", LLSD())); add("startFollowPilot", - "Follow [\"leader_id\"] using the autopilot system.", + "[\"leader_id\"]: uuid of target to follow using the autopilot system (optional with avatar_name)\n" + "[\"avatar_name\"]: avatar name to follow using the autopilot system (optional with leader_id)\n" + "[\"allow_flying\"]: allow flying during autopilot [default: True]\n" + "[\"stop_distance\"]: target maxiumum distance from target [default: autopilot guess]", &LLAgentListener::startFollowPilot); add("setAutoPilotTarget", "Update target for currently running autopilot:\n" @@ -213,7 +218,7 @@ void LLAgentListener::getPosition(const LLSD& event) const } -void LLAgentListener::startAutoPilot(LLSD const & event) const +void LLAgentListener::startAutoPilot(LLSD const & event) { LLQuaternion target_rotation_value; LLQuaternion* target_rotation = NULL; @@ -239,11 +244,20 @@ void LLAgentListener::startAutoPilot(LLSD const & event) const } } + F32 stop_distance = 0.f; + if (event.has("stop_distance")) + { + stop_distance = event["stop_distance"].asReal(); + } + + // Clear follow target, this is doing a path + mFollowTarget.setNull(); + mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event["target_global"]), event["behavior_name"], target_rotation, NULL, NULL, - event["stop_distance"].asReal(), + stop_distance, rotation_threshold, allow_flying); } @@ -251,11 +265,29 @@ void LLAgentListener::startAutoPilot(LLSD const & event) const void LLAgentListener::getAutoPilot(const LLSD& event) const { LLSD reply = LLSD::emptyMap(); - reply["enabled"] = (LLSD::Boolean) mAgent.getAutoPilot(); + + LLSD::Boolean enabled = mAgent.getAutoPilot(); + reply["enabled"] = enabled; + reply["target_global"] = ll_sd_from_vector3d(mAgent.getAutoPilotTargetGlobal()); + reply["leader_id"] = mAgent.getAutoPilotLeaderID(); + reply["stop_distance"] = mAgent.getAutoPilotStopDistance(); + reply["target_distance"] = mAgent.getAutoPilotTargetDist(); + if (!enabled && + mFollowTarget.notNull()) + { // Get an actual distance from the target object we were following + LLViewerObject * target = gObjectList.findObject(mFollowTarget); + if (target) + { // Found the target AV, return the actual distance to them as well as their ID + LLVector3 difference = target->getPositionRegion() - mAgent.getPositionAgent(); + reply["target_distance"] = difference.length(); + reply["leader_id"] = mFollowTarget; + } + } + reply["use_rotation"] = (LLSD::Boolean) mAgent.getAutoPilotUseRotation(); reply["target_facing"] = ll_sd_from_vector3(mAgent.getAutoPilotTargetFacing()); reply["rotation_threshold"] = mAgent.getAutoPilotRotationThreshold(); @@ -265,19 +297,76 @@ void LLAgentListener::getAutoPilot(const LLSD& event) const sendReply(reply, event); } -void LLAgentListener::startFollowPilot(LLSD const & event) const +void LLAgentListener::startFollowPilot(LLSD const & event) { - mAgent.startFollowPilot(event["leader_id"]); + LLUUID target_id; + + BOOL allow_flying = TRUE; + if (event.has("allow_flying")) + { + allow_flying = (BOOL) event["allow_flying"].asBoolean(); + } + + if (event.has("leader_id")) + { + target_id = event["leader_id"]; + } + else if (event.has("avatar_name")) + { // Find the avatar with matching name + std::string target_name = event["avatar_name"].asString(); + + if (target_name.length() > 0) + { + S32 num_objects = gObjectList.getNumObjects(); + S32 cur_index = 0; + while (cur_index < num_objects) + { + LLViewerObject * cur_object = gObjectList.getObject(cur_index++); + if (cur_object && + cur_object->asAvatar() && + cur_object->asAvatar()->getFullname() == target_name) + { // Found avatar with matching name, extract id and break out of loop + target_id = cur_object->getID(); + break; + } + } + } + } + + F32 stop_distance = 0.f; + if (event.has("stop_distance")) + { + stop_distance = event["stop_distance"].asReal(); + } + + if (target_id.notNull()) + { + if (!allow_flying) + { + mAgent.setFlying(FALSE); + } + mFollowTarget = target_id; // Save follow target so we can report distance later + + mAgent.startFollowPilot(target_id, allow_flying, stop_distance); + } } void LLAgentListener::setAutoPilotTarget(LLSD const & event) const { - LLVector3d target_global(ll_vector3d_from_sd(event["target_global"])); - mAgent.setAutoPilotTargetGlobal(target_global); + if (event.has("target_global")) + { + LLVector3d target_global(ll_vector3d_from_sd(event["target_global"])); + mAgent.setAutoPilotTargetGlobal(target_global); + } } void LLAgentListener::stopAutoPilot(LLSD const & event) const { - mAgent.stopAutoPilot(event["user_cancel"]); + BOOL user_cancel = FALSE; + if (event.has("user_cancel")) + { + user_cancel = event["user_cancel"].asBoolean(); + } + mAgent.stopAutoPilot(user_cancel); } diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h index 40225c9c63..aadb87db12 100644 --- a/indra/newview/llagentlistener.h +++ b/indra/newview/llagentlistener.h @@ -47,14 +47,15 @@ private: void resetAxes(const LLSD& event) const; void getAxes(const LLSD& event) const; void getPosition(const LLSD& event) const; - void startAutoPilot(const LLSD& event) const; + void startAutoPilot(const LLSD& event); void getAutoPilot(const LLSD& event) const; - void startFollowPilot(const LLSD& event) const; + void startFollowPilot(const LLSD& event); void setAutoPilotTarget(const LLSD& event) const; void stopAutoPilot(const LLSD& event) const; private: - LLAgent & mAgent; + LLAgent & mAgent; + LLUUID mFollowTarget; }; #endif // LL_LLAGENTLISTENER_H -- cgit v1.2.3 From 7517f25c4322c858cc7a60d62532dfb654a805dc Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Thu, 24 Mar 2011 10:39:22 -0700 Subject: ER-650: touch events. Added 'requestTouch' API for LLAgent operations via llEventHost. Re-factored some message sending code for grabs. Reviewed by Kelly --- indra/newview/llagentlistener.cpp | 75 +++++++++++++++++++++++++++++ indra/newview/llagentlistener.h | 1 + indra/newview/lltoolgrab.cpp | 99 +++++++++++++++++++++++++-------------- indra/newview/lltoolgrab.h | 7 +++ indra/newview/llviewermenu.cpp | 50 +++++--------------- 5 files changed, 160 insertions(+), 72 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 0d30b95074..0a13644911 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -40,6 +40,7 @@ #include "llviewerregion.h" #include "llsdutil.h" #include "llsdutil_math.h" +#include "lltoolgrab.h" LLAgentListener::LLAgentListener(LLAgent &agent) : LLEventAPI("LLAgent", @@ -56,6 +57,11 @@ LLAgentListener::LLAgentListener(LLAgent &agent) add("requestStand", "Ask to stand up", &LLAgentListener::requestStand); + add("requestTouch", + "[\"obj_uuid\"]: id of object to touch, use this or [\"position\"] to indicate the object to touch" + "[\"position\"]: region position {x, y, z} where to find closest object to touch" + "[\"face\"]: optional object face number to touch[Default: 0]", + &LLAgentListener::requestTouch); add("resetAxes", "Set the agent to a fixed orientation (optionally specify [\"lookat\"] = array of [x, y, z])", &LLAgentListener::resetAxes); @@ -169,6 +175,75 @@ void LLAgentListener::requestStand(LLSD const & event_data) const mAgent.setControlFlags(AGENT_CONTROL_STAND_UP); } +void LLAgentListener::requestTouch(LLSD const & event_data) const +{ + LLViewerObject *object = NULL; + + if (event_data.has("obj_uuid")) + { + object = gObjectList.findObject(event_data["obj_uuid"]); + } + else if (event_data.has("position")) + { + LLVector3 target_position = ll_vector3_from_sd(event_data["position"]); + + // Find the object closest to that position + F32 min_distance = 10000.0f; // Start big + S32 num_objects = gObjectList.getNumObjects(); + S32 cur_index = 0; + while (cur_index < num_objects) + { + LLViewerObject * cur_object = gObjectList.getObject(cur_index++); + if (cur_object) + { // Calculate distance from the target position + LLVector3 target_diff = cur_object->getPositionRegion() - target_position; + F32 distance_to_target = target_diff.length(); + if (distance_to_target < min_distance) + { // Found an object closer + min_distance = distance_to_target; + object = cur_object; + } + } + } + } + + S32 face = 0; + if (event_data.has("face")) + { + face = event_data["face"].asInteger(); + } + + if (object && object->getPCode() == LL_PCODE_VOLUME) + { + // Fake enough pick info to get it to (hopefully) work + LLPickInfo pick; + pick.mObjectFace = face; + + /* + These values are sent to the simulator, but face seems to be easiest to use + + pick.mUVCoords "UVCoord" + pick.mSTCoords "STCoord" + pick.mObjectFace "FaceIndex" + pick.mIntersection "Position" + pick.mNormal "Normal" + pick.mBinormal "Binormal" + */ + + // A touch is a sketchy message sequence ... send a grab, immediately + // followed by un-grabbing, crossing fingers and hoping packets arrive in + // the correct order + send_ObjectGrab_message(object, pick, LLVector3::zero); + send_ObjectDeGrab_message(object, pick); + } + else + { + llwarns << "LLAgent requestTouch could not find the touch target " + << event_data["obj_uuid"].asUUID() << llendl; + } +} + + void LLAgentListener::resetAxes(const LLSD& event) const { if (event.has("lookat")) diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h index aadb87db12..6aeda5f8db 100644 --- a/indra/newview/llagentlistener.h +++ b/indra/newview/llagentlistener.h @@ -44,6 +44,7 @@ private: void requestTeleport(LLSD const & event_data) const; void requestSit(LLSD const & event_data) const; void requestStand(LLSD const & event_data) const; + void requestTouch(LLSD const & event_data) const; void resetAxes(const LLSD& event) const; void getAxes(const LLSD& event) const; void getPosition(const LLSD& event) const; diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index b6c0f662e5..319e2508e0 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -54,7 +54,6 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "llviewerwindow.h" #include "llvoavatarself.h" #include "llworld.h" @@ -387,22 +386,7 @@ void LLToolGrab::startGrab() mDragStartPointGlobal = grab_start_global; mDragStartFromCamera = grab_start_global - gAgentCamera.getCameraPositionGlobal(); - LLMessageSystem *msg = gMessageSystem; - msg->newMessageFast(_PREHASH_ObjectGrab); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_ObjectData); - msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID); - msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset ); - msg->nextBlock("SurfaceInfo"); - msg->addVector3("UVCoord", LLVector3(mGrabPick.mUVCoords)); - msg->addVector3("STCoord", LLVector3(mGrabPick.mSTCoords)); - msg->addS32Fast(_PREHASH_FaceIndex, mGrabPick.mObjectFace); - msg->addVector3("Position", mGrabPick.mIntersection); - msg->addVector3("Normal", mGrabPick.mNormal); - msg->addVector3("Binormal", mGrabPick.mBinormal); - msg->sendMessage( objectp->getRegion()->getHost()); + send_ObjectGrab_message(objectp, mGrabPick, grab_offset); mGrabOffsetFromCenterInitial = grab_offset; mGrabHiddenOffsetFromCamera = mDragStartFromCamera; @@ -1036,28 +1020,12 @@ void LLToolGrab::stopGrab() } // Next, send messages to simulator - LLMessageSystem *msg = gMessageSystem; switch(mMode) { case GRAB_ACTIVE_CENTER: case GRAB_NONPHYSICAL: case GRAB_LOCKED: - msg->newMessageFast(_PREHASH_ObjectDeGrab); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_ObjectData); - msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID); - msg->nextBlock("SurfaceInfo"); - msg->addVector3("UVCoord", LLVector3(pick.mUVCoords)); - msg->addVector3("STCoord", LLVector3(pick.mSTCoords)); - msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace); - msg->addVector3("Position", pick.mIntersection); - msg->addVector3("Normal", pick.mNormal); - msg->addVector3("Binormal", pick.mBinormal); - - msg->sendMessage(objectp->getRegion()->getHost()); - + send_ObjectDeGrab_message(objectp, pick); mVerticalDragging = FALSE; break; @@ -1109,3 +1077,66 @@ LLVector3d LLToolGrab::getGrabPointGlobal() return gAgent.getPositionGlobal(); } } + + +void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset) +{ + if (!object) return; + + LLMessageSystem *msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_ObjectGrab); + msg->nextBlockFast( _PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast( _PREHASH_ObjectData); + msg->addU32Fast( _PREHASH_LocalID, object->mLocalID); + msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset); + msg->nextBlock("SurfaceInfo"); + msg->addVector3("UVCoord", LLVector3(pick.mUVCoords)); + msg->addVector3("STCoord", LLVector3(pick.mSTCoords)); + msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace); + msg->addVector3("Position", pick.mIntersection); + msg->addVector3("Normal", pick.mNormal); + msg->addVector3("Binormal", pick.mBinormal); + msg->sendMessage( object->getRegion()->getHost()); + + /* Diagnostic code + llinfos << "mUVCoords: " << pick.mUVCoords + << ", mSTCoords: " << pick.mSTCoords + << ", mObjectFace: " << pick.mObjectFace + << ", mIntersection: " << pick.mIntersection + << ", mNormal: " << pick.mNormal + << ", mBinormal: " << pick.mBinormal + << llendl; + + llinfos << "Avatar pos: " << gAgent.getPositionAgent() << llendl; + llinfos << "Object pos: " << object->getPosition() << llendl; + */ +} + + +void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick) +{ + if (!object) return; + + LLMessageSystem *msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_ObjectDeGrab); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_ObjectData); + msg->addU32Fast(_PREHASH_LocalID, object->mLocalID); + msg->nextBlock("SurfaceInfo"); + msg->addVector3("UVCoord", LLVector3(pick.mUVCoords)); + msg->addVector3("STCoord", LLVector3(pick.mSTCoords)); + msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace); + msg->addVector3("Position", pick.mIntersection); + msg->addVector3("Normal", pick.mNormal); + msg->addVector3("Binormal", pick.mBinormal); + msg->sendMessage(object->getRegion()->getHost()); +} + + + diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h index 61e3fcb8b2..06a3b662c8 100644 --- a/indra/newview/lltoolgrab.h +++ b/indra/newview/lltoolgrab.h @@ -39,6 +39,13 @@ class LLTextBox; class LLViewerObject; class LLPickInfo; + +// Message utilities +void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset); +void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick); + + + class LLToolGrab : public LLTool, public LLSingleton { public: diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ec72df79d1..81a4188cd4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -104,6 +104,7 @@ #include "llappearancemgr.h" #include "lltrans.h" #include "lleconomy.h" +#include "lltoolgrab.h" #include "boost/unordered_map.hpp" using namespace LLVOAvatarDefines; @@ -2392,50 +2393,23 @@ class LLObjectEnableReportAbuse : public view_listener_t } }; + void handle_object_touch() { - LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - if (!object) return; - - LLPickInfo pick = LLToolPie::getInstance()->getPick(); + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return; - LLMessageSystem *msg = gMessageSystem; + LLPickInfo pick = LLToolPie::getInstance()->getPick(); - msg->newMessageFast(_PREHASH_ObjectGrab); - msg->nextBlockFast( _PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast( _PREHASH_ObjectData); - msg->addU32Fast( _PREHASH_LocalID, object->mLocalID); - msg->addVector3Fast(_PREHASH_GrabOffset, LLVector3::zero ); - msg->nextBlock("SurfaceInfo"); - msg->addVector3("UVCoord", LLVector3(pick.mUVCoords)); - msg->addVector3("STCoord", LLVector3(pick.mSTCoords)); - msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace); - msg->addVector3("Position", pick.mIntersection); - msg->addVector3("Normal", pick.mNormal); - msg->addVector3("Binormal", pick.mBinormal); - msg->sendMessage( object->getRegion()->getHost()); - - // *NOTE: Hope the packets arrive safely and in order or else - // there will be some problems. - // *TODO: Just fix this bad assumption. - msg->newMessageFast(_PREHASH_ObjectDeGrab); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_ObjectData); - msg->addU32Fast(_PREHASH_LocalID, object->mLocalID); - msg->nextBlock("SurfaceInfo"); - msg->addVector3("UVCoord", LLVector3(pick.mUVCoords)); - msg->addVector3("STCoord", LLVector3(pick.mSTCoords)); - msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace); - msg->addVector3("Position", pick.mIntersection); - msg->addVector3("Normal", pick.mNormal); - msg->addVector3("Binormal", pick.mBinormal); - msg->sendMessage(object->getRegion()->getHost()); + // *NOTE: Hope the packets arrive safely and in order or else + // there will be some problems. + // *TODO: Just fix this bad assumption. + send_ObjectGrab_message(object, pick, LLVector3::zero); + send_ObjectDeGrab_message(object, pick); } + + static void init_default_item_label(const std::string& item_name) { boost::unordered_map::iterator it = sDefaultItemLabels.find(item_name); -- cgit v1.2.3 From 3c8f6f44dc7b0ec6c8632fc75df6effad3e7ef98 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Mon, 28 Mar 2011 10:22:01 -0700 Subject: Fix usage of flag SLURLPassToOtherInstance during login. --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b670a40cd0..0bf8fc2205 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2459,7 +2459,7 @@ bool LLAppViewer::initConfiguration() // out of different directories if (LLStartUp::getStartSLURL().isValid() && - !(gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) + (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) { if (sendURLToOtherInstance(LLStartUp::getStartSLURL().getSLURLString())) { -- cgit v1.2.3 From 0642000a12785bc4e17b334751f386bd1ec6c702 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Mon, 28 Mar 2011 10:27:52 -0700 Subject: Added optional 'position' property to 'requestSit' LLEventHost function, re-factored code into new findObjectClosestTo() function. Reviewed by Kelly --- indra/newview/llagentlistener.cpp | 67 +++++++++++++++++++++++++-------------- indra/newview/llagentlistener.h | 4 +++ 2 files changed, 48 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 0a13644911..c1edcef4c0 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -52,7 +52,8 @@ LLAgentListener::LLAgentListener(LLAgent &agent) "If [\"skip_confirmation\"] is true, use LLURLDispatcher rather than LLCommandDispatcher.", &LLAgentListener::requestTeleport); add("requestSit", - "Ask to sit on the object specified in [\"obj_uuid\"]", + "[\"obj_uuid\"]: id of object to sit on, use this or [\"position\"] to indicate the sit target" + "[\"position\"]: region position {x, y, z} where to find closest object to sit on", &LLAgentListener::requestSit); add("requestStand", "Ask to stand up", @@ -149,7 +150,17 @@ void LLAgentListener::requestSit(LLSD const & event_data) const //mAgent.getAvatarObject()->sitOnObject(); // shamelessly ripped from llviewermenu.cpp:handle_sit_or_stand() // *TODO - find a permanent place to share this code properly. - LLViewerObject *object = gObjectList.findObject(event_data["obj_uuid"]); + + LLViewerObject *object = NULL; + if (event_data.has("obj_uuid")) + { + object = gObjectList.findObject(event_data["obj_uuid"]); + } + else if (event_data.has("position")) + { + LLVector3 target_position = ll_vector3_from_sd(event_data["position"]); + object = findObjectClosestTo(target_position); + } if (object && object->getPCode() == LL_PCODE_VOLUME) { @@ -165,8 +176,8 @@ void LLAgentListener::requestSit(LLSD const & event_data) const } else { - llwarns << "LLAgent requestSit could not find the sit target " - << event_data["obj_uuid"].asUUID() << llendl; + llwarns << "LLAgent requestSit could not find the sit target: " + << event_data << llendl; } } @@ -175,6 +186,34 @@ void LLAgentListener::requestStand(LLSD const & event_data) const mAgent.setControlFlags(AGENT_CONTROL_STAND_UP); } + +LLViewerObject * LLAgentListener::findObjectClosestTo( const LLVector3 & position ) const +{ + LLViewerObject *object = NULL; + + // Find the object closest to that position + F32 min_distance = 10000.0f; // Start big + S32 num_objects = gObjectList.getNumObjects(); + S32 cur_index = 0; + while (cur_index < num_objects) + { + LLViewerObject * cur_object = gObjectList.getObject(cur_index++); + if (cur_object) + { // Calculate distance from the target position + LLVector3 target_diff = cur_object->getPositionRegion() - position; + F32 distance_to_target = target_diff.length(); + if (distance_to_target < min_distance) + { // Found an object closer + min_distance = distance_to_target; + object = cur_object; + } + } + } + + return object; +} + + void LLAgentListener::requestTouch(LLSD const & event_data) const { LLViewerObject *object = NULL; @@ -186,25 +225,7 @@ void LLAgentListener::requestTouch(LLSD const & event_data) const else if (event_data.has("position")) { LLVector3 target_position = ll_vector3_from_sd(event_data["position"]); - - // Find the object closest to that position - F32 min_distance = 10000.0f; // Start big - S32 num_objects = gObjectList.getNumObjects(); - S32 cur_index = 0; - while (cur_index < num_objects) - { - LLViewerObject * cur_object = gObjectList.getObject(cur_index++); - if (cur_object) - { // Calculate distance from the target position - LLVector3 target_diff = cur_object->getPositionRegion() - target_position; - F32 distance_to_target = target_diff.length(); - if (distance_to_target < min_distance) - { // Found an object closer - min_distance = distance_to_target; - object = cur_object; - } - } - } + object = findObjectClosestTo(target_position); } S32 face = 0; diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h index 6aeda5f8db..c917151b71 100644 --- a/indra/newview/llagentlistener.h +++ b/indra/newview/llagentlistener.h @@ -34,6 +34,8 @@ class LLAgent; class LLSD; +class LLViewerObject; +class LLVector3d; class LLAgentListener : public LLEventAPI { @@ -54,6 +56,8 @@ private: void setAutoPilotTarget(const LLSD& event) const; void stopAutoPilot(const LLSD& event) const; + LLViewerObject * findObjectClosestTo( const LLVector3 & position ) const; + private: LLAgent & mAgent; LLUUID mFollowTarget; -- cgit v1.2.3 From f2bb81d17660054697ed984afc0e3f8d90f77eda Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Mon, 28 Mar 2011 16:54:40 -0700 Subject: Added LLEventHost API for gestures. Have new llgesturelistener.cpp and .h files, wired up to LLGestureMgr class. Reviewed by Kelly --- indra/newview/CMakeLists.txt | 2 + indra/newview/llgesturelistener.cpp | 159 ++++++++++++++++++++++++++++++++++++ indra/newview/llgesturelistener.h | 52 ++++++++++++ indra/newview/llgesturemgr.cpp | 2 + indra/newview/llgesturemgr.h | 4 + 5 files changed, 219 insertions(+) create mode 100644 indra/newview/llgesturelistener.cpp create mode 100644 indra/newview/llgesturelistener.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d6a144f1dc..ef48fcdf2f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -232,6 +232,7 @@ set(viewer_SOURCE_FILES llfolderviewitem.cpp llfollowcam.cpp llfriendcard.cpp + llgesturelistener.cpp llgesturemgr.cpp llgiveinventory.cpp llglsandbox.cpp @@ -776,6 +777,7 @@ set(viewer_HEADER_FILES llfolderviewitem.h llfollowcam.h llfriendcard.h + llgesturelistener.h llgesturemgr.h llgiveinventory.h llgroupactions.h diff --git a/indra/newview/llgesturelistener.cpp b/indra/newview/llgesturelistener.cpp new file mode 100644 index 0000000000..f682700746 --- /dev/null +++ b/indra/newview/llgesturelistener.cpp @@ -0,0 +1,159 @@ +/** + * @file llgesturelistener.cpp + * @author Dave Simmons + * @date 2011-03-28 + * @brief Implementation for LLGestureListener. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llgesturelistener.h" +#include "llgesturemgr.h" +#include "llmultigesture.h" + + +LLGestureListener::LLGestureListener() + : LLEventAPI("LLGesture", + "LLGesture listener interface to control gestures") +{ + add("getActiveGestures", + "Return information about the agent's available gestures [\"reply\"]:\n" + "[\"gestures\"]: list of gestures. This is a dictionary with UUID strings as keys\n" + " and the following values:\n" + " [\"name\"]: name of the gesture, may be empty\n" + " [\"trigger\"]: trigger string used to invoke via user chat, may be empty\n" + " [\"playing\"]: true or false indicating the playing state", + &LLGestureListener::getActiveGestures, + LLSDMap("reply", LLSD())); + add("isGesturePlaying", + "[\"id\"]: UUID of the gesture to query. Returns True or False in [\"playing\"] value of the result", + &LLGestureListener::isGesturePlaying); + add("startGesture", + "[\"id\"]: UUID of the gesture to start play", + &LLGestureListener::startGesture); + add("stopGesture", + "[\"id\"]: UUID of the gesture to stop", + &LLGestureListener::stopGesture); +} + + +// "getActiveGestures" command +void LLGestureListener::getActiveGestures(const LLSD& event_data) const +{ + LLSD reply = LLSD::emptyMap(); + LLSD gesture_map = LLSD::emptyMap(); + + const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures(); + + // Scan active gesture map and get all the names + LLGestureMgr::item_map_t::const_iterator it; + for (it = active_gestures.begin(); it != active_gestures.end(); ++it) + { + LLMultiGesture* gesture = (*it).second; + if (gesture) + { // Add an entry to the result map with the LLUUID as key with a map containing data + LLSD info = LLSD::emptyMap(); + info["name"] = (LLSD::String) gesture->mName; + info["trigger"] = (LLSD::String) gesture->mTrigger; + info["playing"] = (LLSD::Boolean) gesture->mPlaying; + + gesture_map[(*it).first.asString()] = info; + } + } + + reply["gestures"] = gesture_map; + sendReply(reply, event_data); +} + + + +// "isGesturePlaying" command +void LLGestureListener::isGesturePlaying(const LLSD& event_data) const +{ + bool is_playing = false; + if (event_data.has("id")) + { + LLUUID gesture_id = event_data["id"].asUUID(); + if (gesture_id.notNull()) + { + is_playing = LLGestureMgr::instance().isGesturePlaying(gesture_id); + } + else + { + llwarns << "isGesturePlaying did not find a gesture object for " << gesture_id << llendl; + } + } + else + { + llwarns << "isGesturePlaying didn't have 'id' value passed in" << llendl; + } + + LLSD reply = LLSD::emptyMap(); + reply["playing"] = (LLSD::Boolean) is_playing; + sendReply(reply, event_data); +} + + +// "startGesture" command +void LLGestureListener::startGesture(LLSD const & event_data) const +{ + startOrStopGesture(event_data, true); +} + + +// "stopGesture" command +void LLGestureListener::stopGesture(LLSD const & event_data) const +{ + startOrStopGesture(event_data, false); +} + + +// Real code for "startGesture" or "stopGesture" +void LLGestureListener::startOrStopGesture(LLSD const & event_data, bool start) const +{ + if (event_data.has("id")) + { + LLUUID gesture_id = event_data["id"].asUUID(); + if (gesture_id.notNull()) + { + if (start) + { + LLGestureMgr::instance().playGesture(gesture_id); + } + else + { + LLGestureMgr::instance().stopGesture(gesture_id); + } + } + else + { + llwarns << "startOrStopGesture did not find a gesture object for " << gesture_id << llendl; + } + } + else + { + llwarns << "startOrStopGesture didn't have 'id' value passed in" << llendl; + } +} + diff --git a/indra/newview/llgesturelistener.h b/indra/newview/llgesturelistener.h new file mode 100644 index 0000000000..326881ac2b --- /dev/null +++ b/indra/newview/llgesturelistener.h @@ -0,0 +1,52 @@ +/** + * @file llgesturelistener.h + * @author Dave Simmons + * @date 2011-03-15 + * @brief Class definition for LLGestureListener. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#ifndef LL_LLGESTURELISTENER_H +#define LL_LLGESTURELISTENER_H + +#include "lleventapi.h" + +class LLSD; + +class LLGestureListener : public LLEventAPI +{ +public: + LLGestureListener(); + +private: + void getActiveGestures(LLSD const & gesture_data) const; + void isGesturePlaying(LLSD const & gesture_data) const; + void startGesture(LLSD const & gesture_data) const; + void stopGesture(LLSD const & gesture_data) const; + + void startOrStopGesture(LLSD const & event_data, bool start) const; +}; + +#endif // LL_LLGESTURELISTENER_H + diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index f658287fb1..c5b821c360 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -51,6 +51,7 @@ #include "llviewerstats.h" #include "llnearbychatbar.h" #include "llappearancemgr.h" +#include "llgesturelistener.h" // Longest time, in seconds, to wait for all animations to stop playing const F32 MAX_WAIT_ANIM_SECS = 30.f; @@ -68,6 +69,7 @@ LLGestureMgr::LLGestureMgr() mLoadingCount(0) { gInventory.addObserver(this); + mListener.reset(new LLGestureListener()); } diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index b9935efeb3..e305895797 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -37,6 +37,7 @@ #include "llviewerinventory.h" class LLMultiGesture; +class LLGestureListener; class LLGestureStep; class LLUUID; class LLVFS; @@ -172,6 +173,9 @@ private: callback_map_t mCallbackMap; std::vector mPlaying; BOOL mValid; + + // LLEventHost interface + boost::shared_ptr mListener; }; #endif -- cgit v1.2.3 From 3ce04bdcc7dedb1ce0b2c9db75fe22439cd24132 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 1 Apr 2011 18:04:39 -0700 Subject: Comment and line ending repair --- indra/newview/llgesturelistener.cpp | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llgesturelistener.cpp b/indra/newview/llgesturelistener.cpp index f682700746..22b7d233c5 100644 --- a/indra/newview/llgesturelistener.cpp +++ b/indra/newview/llgesturelistener.cpp @@ -39,8 +39,8 @@ LLGestureListener::LLGestureListener() { add("getActiveGestures", "Return information about the agent's available gestures [\"reply\"]:\n" - "[\"gestures\"]: list of gestures. This is a dictionary with UUID strings as keys\n" - " and the following values:\n" + "[\"gestures\"]: a dictionary with UUID strings as keys\n" + " and the following dict values for each entry:\n" " [\"name\"]: name of the gesture, may be empty\n" " [\"trigger\"]: trigger string used to invoke via user chat, may be empty\n" " [\"playing\"]: true or false indicating the playing state", @@ -50,7 +50,7 @@ LLGestureListener::LLGestureListener() "[\"id\"]: UUID of the gesture to query. Returns True or False in [\"playing\"] value of the result", &LLGestureListener::isGesturePlaying); add("startGesture", - "[\"id\"]: UUID of the gesture to start play", + "[\"id\"]: UUID of the gesture to start playing", &LLGestureListener::startGesture); add("stopGesture", "[\"id\"]: UUID of the gesture to stop", @@ -64,23 +64,23 @@ void LLGestureListener::getActiveGestures(const LLSD& event_data) const LLSD reply = LLSD::emptyMap(); LLSD gesture_map = LLSD::emptyMap(); - const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures(); - - // Scan active gesture map and get all the names - LLGestureMgr::item_map_t::const_iterator it; - for (it = active_gestures.begin(); it != active_gestures.end(); ++it) - { - LLMultiGesture* gesture = (*it).second; - if (gesture) - { // Add an entry to the result map with the LLUUID as key with a map containing data - LLSD info = LLSD::emptyMap(); - info["name"] = (LLSD::String) gesture->mName; - info["trigger"] = (LLSD::String) gesture->mTrigger; - info["playing"] = (LLSD::Boolean) gesture->mPlaying; - - gesture_map[(*it).first.asString()] = info; - } - } + const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures(); + + // Scan active gesture map and get all the names + LLGestureMgr::item_map_t::const_iterator it; + for (it = active_gestures.begin(); it != active_gestures.end(); ++it) + { + LLMultiGesture* gesture = (*it).second; + if (gesture) + { // Add an entry to the result map with the LLUUID as key with a map containing data + LLSD info = LLSD::emptyMap(); + info["name"] = (LLSD::String) gesture->mName; + info["trigger"] = (LLSD::String) gesture->mTrigger; + info["playing"] = (LLSD::Boolean) gesture->mPlaying; + + gesture_map[(*it).first.asString()] = info; + } + } reply["gestures"] = gesture_map; sendReply(reply, event_data); @@ -139,12 +139,12 @@ void LLGestureListener::startOrStopGesture(LLSD const & event_data, bool start) { if (start) { - LLGestureMgr::instance().playGesture(gesture_id); - } - else - { - LLGestureMgr::instance().stopGesture(gesture_id); - } + LLGestureMgr::instance().playGesture(gesture_id); + } + else + { + LLGestureMgr::instance().stopGesture(gesture_id); + } } else { -- cgit v1.2.3 From e74e0c8da5ecdb107f89bd33de81397ac41f5a5b Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Tue, 5 Apr 2011 09:07:11 -0700 Subject: ER-671 : Add LLRegionSayTo() LSL function. Added new chat type for direct messages to match server code, use light orange for text. Reviewed by Kelly. --- indra/newview/llnearbychatbarlistener.cpp | 4 ++-- indra/newview/llviewerchat.cpp | 8 ++++++++ indra/newview/skins/default/colors.xml | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llnearbychatbarlistener.cpp b/indra/newview/llnearbychatbarlistener.cpp index 99286d972b..0d64eaed47 100644 --- a/indra/newview/llnearbychatbarlistener.cpp +++ b/indra/newview/llnearbychatbarlistener.cpp @@ -60,8 +60,8 @@ void LLNearbyChatBarListener::sendChat(LLSD const & chat_data) const if (chat_data.has("channel")) { channel = chat_data["channel"].asInteger(); - if (channel < 0 || channel >= 2147483647) - { // Use 0 up to (but not including) DEBUG_CHANNEL (wtf isn't that defined??) + if (channel < 0 || channel >= CHAT_CHANNEL_DEBUG) + { // Use 0 up to (but not including) CHAT_CHANNEL_DEBUG channel = 0; } } diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index 0af850a46b..2f449978dc 100644 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -75,6 +75,10 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color) { r_color = LLUIColorTable::instance().getColor("llOwnerSayChatColor"); } + else if ( chat.mChatType == CHAT_TYPE_DIRECT ) + { + r_color = LLUIColorTable::instance().getColor("DirectChatColor"); + } else { r_color = LLUIColorTable::instance().getColor("ObjectChatColor"); @@ -140,6 +144,10 @@ void LLViewerChat::getChatColor(const LLChat& chat, std::string& r_color_name, F { r_color_name = "llOwnerSayChatColor"; } + else if ( chat.mChatType == CHAT_TYPE_DIRECT ) + { + r_color_name = "DirectChatColor"; + } else { r_color_name = "ObjectChatColor"; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 75aec21f93..d197ab2fdf 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -763,4 +763,7 @@ + -- cgit v1.2.3 From 18f5bbfdd3b08e33bc27b787cb4cc1293e2586c8 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Tue, 5 Apr 2011 10:33:01 -0700 Subject: ER-671: Add LLRegionSayTo() LSL function. Added viewer preferences color picker under 'Colors' panel for messages sent directly to viewer via llRegionSayTo(). Reviewed by Kelly. --- .../default/xui/en/panel_preferences_colors.xml | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_colors.xml b/indra/newview/skins/default/xui/en/panel_preferences_colors.xml index 8a37822413..c6d1e38ee7 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_colors.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_colors.xml @@ -206,6 +206,37 @@ width="95"> Errors + + + + + + Direct + Date: Tue, 5 Apr 2011 10:34:24 -0700 Subject: Cleanup: use CHAT_CHANNEL_DEBUG instead of 2147483647 --- indra/newview/llchatbar.cpp | 2 +- indra/newview/llnearbychatbar.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 4a58dc558a..cf0374075a 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -694,7 +694,7 @@ public: { S32 channel = tokens[0].asInteger(); // VWR-19499 Restrict function to chat channels greater than 0. - if ((channel > 0) && (channel < 2147483647)) + if ((channel > 0) && (channel < CHAT_CHANNEL_DEBUG)) { retval = true; // Say mesg on channel diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 947efdbb19..cf828306d8 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -895,7 +895,7 @@ public: { S32 channel = tokens[0].asInteger(); // VWR-19499 Restrict function to chat channels greater than 0. - if ((channel > 0) && (channel < 2147483647)) + if ((channel > 0) && (channel < CHAT_CHANNEL_DEBUG)) { retval = true; // Send unescaped message, see EXT-6353. -- cgit v1.2.3 From b84ac95c2fa3f020b656737244c38222351b8d36 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Thu, 7 Apr 2011 17:03:42 -0700 Subject: ER-671: add llRegionSayTo(). Cleaned up some chat code, implemented '@' special case. Reviewed by Kelly --- indra/newview/llnearbychathandler.cpp | 35 ++++++++++++++++++++++------------- indra/newview/llviewermessage.cpp | 12 ++++-------- 2 files changed, 26 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 2566bf1095..11dc496311 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -489,6 +489,27 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) // tmp_chat.mFromName = tmp_chat.mFromID.asString(); } + // Build notification data + LLSD notification; + notification["message"] = chat_msg.mText; + notification["from"] = chat_msg.mFromName; + notification["from_id"] = chat_msg.mFromID; + notification["time"] = chat_msg.mTime; + notification["source"] = (S32)chat_msg.mSourceType; + notification["chat_type"] = (S32)chat_msg.mChatType; + notification["chat_style"] = (S32)chat_msg.mChatStyle; + // Pass sender info so that it can be rendered properly (STORM-1021). + notification["sender_slurl"] = LLViewerChat::getSenderSLURL(chat_msg, args); + + if (chat_msg.mChatType == CHAT_TYPE_DIRECT && + chat_msg.mText.length() > 0 && + chat_msg.mText[0] == '@') + { + // Send event on to LLEventStream and exit + sChatWatcher->post(notification); + return; + } + // don't show toast and add message to chat history on receive debug message // with disabled setting showing script errors or enabled setting to show script // errors in separate window. @@ -531,19 +552,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) } - // Build data and send event on to LLEventStream - LLSD notification; - notification["message"] = chat_msg.mText; - notification["from"] = chat_msg.mFromName; - notification["from_id"] = chat_msg.mFromID; - notification["time"] = chat_msg.mTime; - notification["source"] = (S32)chat_msg.mSourceType; - notification["chat_type"] = (S32)chat_msg.mChatType; - notification["chat_style"] = (S32)chat_msg.mChatStyle; - // Pass sender info so that it can be rendered properly (STORM-1021). - notification["sender_slurl"] = LLViewerChat::getSenderSLURL(chat_msg, args); - - + // Send event on to LLEventStream sChatWatcher->post(notification); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9641a0901c..5792bf2c03 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3202,7 +3202,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) if (is_audible) { BOOL visible_in_chat_bubble = FALSE; - std::string verb; color.setVec(1.f,1.f,1.f,1.f); msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); @@ -3251,18 +3250,19 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) } else { + chat.mText = ""; switch(chat.mChatType) { case CHAT_TYPE_WHISPER: - verb = LLTrans::getString("whisper") + " "; + chat.mText = LLTrans::getString("whisper") + " "; break; case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_OWNER: case CHAT_TYPE_NORMAL: - verb = ""; + case CHAT_TYPE_DIRECT: break; case CHAT_TYPE_SHOUT: - verb = LLTrans::getString("shout") + " "; + chat.mText = LLTrans::getString("shout") + " "; break; case CHAT_TYPE_START: case CHAT_TYPE_STOP: @@ -3270,13 +3270,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) break; default: LL_WARNS("Messaging") << "Unknown type " << chat.mChatType << " in chat!" << LL_ENDL; - verb = ""; break; } - - chat.mText = ""; - chat.mText += verb; chat.mText += mesg; } -- cgit v1.2.3 From 2bf967149626672584b17b53fb5d2e6186f3d896 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 8 Apr 2011 15:54:32 -0700 Subject: Fixed a NULL pointer crash found while using viewer. See https://osiris.lindenlab.com/viewer_crash_browser/index.php?filter_id=24941. Reviewed by Kelly --- indra/newview/llwearabletype.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llwearabletype.cpp b/indra/newview/llwearabletype.cpp index f933be4d8f..5b4b820903 100644 --- a/indra/newview/llwearabletype.cpp +++ b/indra/newview/llwearabletype.cpp @@ -144,6 +144,7 @@ BOOL LLWearableType::getDisableCameraSwitch(LLWearableType::EType type) { const LLWearableDictionary *dict = LLWearableDictionary::getInstance(); const WearableEntry *entry = dict->lookup(type); + if (!entry) return FALSE; return entry->mDisableCameraSwitch; } @@ -152,6 +153,7 @@ BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type) { const LLWearableDictionary *dict = LLWearableDictionary::getInstance(); const WearableEntry *entry = dict->lookup(type); + if (!entry) return FALSE; return entry->mAllowMultiwear; } -- cgit v1.2.3 From ebe0c8204df30a85b8228e81acbcf7945c15220c Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 15 Apr 2011 15:52:52 -0700 Subject: ER-710: Viewer effects. Added 'lookAt' command for LLAgent event host API. Also changed a bunch of parameters named 'event' to 'event_host' since VS highlights them as keywords. Reviewed by Kelly. --- indra/newview/llagentlistener.cpp | 102 ++++++++++++++++++++++++-------------- indra/newview/llagentlistener.h | 17 ++++--- 2 files changed, 75 insertions(+), 44 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index c1edcef4c0..2dc6764f51 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -41,6 +41,8 @@ #include "llsdutil.h" #include "llsdutil_math.h" #include "lltoolgrab.h" +#include "llhudeffectlookat.h" +#include "llagentcamera.h" LLAgentListener::LLAgentListener(LLAgent &agent) : LLEventAPI("LLAgent", @@ -119,7 +121,11 @@ LLAgentListener::LLAgentListener(LLAgent &agent) "Stop the autopilot system:\n" "[\"user_cancel\"] indicates whether or not to act as though user canceled autopilot [default: false]", &LLAgentListener::stopAutoPilot); - + add("lookAt", + "[\"type\"]: number to indicate the lookAt type, 0 to clear\n" + "[\"obj_uuid\"]: id of object to look at, use this or [\"position\"] to indicate the target\n" + "[\"position\"]: region position {x, y, z} where to find closest object or avatar to look at", + &LLAgentListener::lookAt); } void LLAgentListener::requestTeleport(LLSD const & event_data) const @@ -265,11 +271,11 @@ void LLAgentListener::requestTouch(LLSD const & event_data) const } -void LLAgentListener::resetAxes(const LLSD& event) const +void LLAgentListener::resetAxes(const LLSD& event_data) const { - if (event.has("lookat")) + if (event_data.has("lookat")) { - mAgent.resetAxes(ll_vector3_from_sd(event["lookat"])); + mAgent.resetAxes(ll_vector3_from_sd(event_data["lookat"])); } else { @@ -278,7 +284,7 @@ void LLAgentListener::resetAxes(const LLSD& event) const } } -void LLAgentListener::getAxes(const LLSD& event) const +void LLAgentListener::getAxes(const LLSD& event_data) const { LLQuaternion quat(mAgent.getQuat()); F32 roll, pitch, yaw; @@ -291,11 +297,11 @@ void LLAgentListener::getAxes(const LLSD& event) const reply["euler"]["roll"] = roll; reply["euler"]["pitch"] = pitch; reply["euler"]["yaw"] = yaw; - sendReply(reply, event); + sendReply(reply, event_data); } -void LLAgentListener::getPosition(const LLSD& event) const +void LLAgentListener::getPosition(const LLSD& event_data) const { F32 roll, pitch, yaw; LLQuaternion quat(mAgent.getQuat()); @@ -310,30 +316,30 @@ void LLAgentListener::getPosition(const LLSD& event) const reply["region"] = ll_sd_from_vector3(mAgent.getPositionAgent()); reply["global"] = ll_sd_from_vector3d(mAgent.getPositionGlobal()); - sendReply(reply, event); + sendReply(reply, event_data); } -void LLAgentListener::startAutoPilot(LLSD const & event) +void LLAgentListener::startAutoPilot(LLSD const & event_data) { LLQuaternion target_rotation_value; LLQuaternion* target_rotation = NULL; - if (event.has("target_rotation")) + if (event_data.has("target_rotation")) { - target_rotation_value = ll_quaternion_from_sd(event["target_rotation"]); + target_rotation_value = ll_quaternion_from_sd(event_data["target_rotation"]); target_rotation = &target_rotation_value; } // *TODO: Use callback_pump and callback_data F32 rotation_threshold = 0.03f; - if (event.has("rotation_threshold")) + if (event_data.has("rotation_threshold")) { - rotation_threshold = event["rotation_threshold"].asReal(); + rotation_threshold = event_data["rotation_threshold"].asReal(); } BOOL allow_flying = TRUE; - if (event.has("allow_flying")) + if (event_data.has("allow_flying")) { - allow_flying = (BOOL) event["allow_flying"].asBoolean(); + allow_flying = (BOOL) event_data["allow_flying"].asBoolean(); if (!allow_flying) { mAgent.setFlying(FALSE); @@ -341,16 +347,16 @@ void LLAgentListener::startAutoPilot(LLSD const & event) } F32 stop_distance = 0.f; - if (event.has("stop_distance")) + if (event_data.has("stop_distance")) { - stop_distance = event["stop_distance"].asReal(); + stop_distance = event_data["stop_distance"].asReal(); } // Clear follow target, this is doing a path mFollowTarget.setNull(); - mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event["target_global"]), - event["behavior_name"], + mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event_data["target_global"]), + event_data["behavior_name"], target_rotation, NULL, NULL, stop_distance, @@ -358,7 +364,7 @@ void LLAgentListener::startAutoPilot(LLSD const & event) allow_flying); } -void LLAgentListener::getAutoPilot(const LLSD& event) const +void LLAgentListener::getAutoPilot(const LLSD& event_data) const { LLSD reply = LLSD::emptyMap(); @@ -390,26 +396,26 @@ void LLAgentListener::getAutoPilot(const LLSD& event) const reply["behavior_name"] = mAgent.getAutoPilotBehaviorName(); reply["fly"] = (LLSD::Boolean) mAgent.getFlying(); - sendReply(reply, event); + sendReply(reply, event_data); } -void LLAgentListener::startFollowPilot(LLSD const & event) +void LLAgentListener::startFollowPilot(LLSD const & event_data) { LLUUID target_id; BOOL allow_flying = TRUE; - if (event.has("allow_flying")) + if (event_data.has("allow_flying")) { - allow_flying = (BOOL) event["allow_flying"].asBoolean(); + allow_flying = (BOOL) event_data["allow_flying"].asBoolean(); } - if (event.has("leader_id")) + if (event_data.has("leader_id")) { - target_id = event["leader_id"]; + target_id = event_data["leader_id"]; } - else if (event.has("avatar_name")) + else if (event_data.has("avatar_name")) { // Find the avatar with matching name - std::string target_name = event["avatar_name"].asString(); + std::string target_name = event_data["avatar_name"].asString(); if (target_name.length() > 0) { @@ -430,9 +436,9 @@ void LLAgentListener::startFollowPilot(LLSD const & event) } F32 stop_distance = 0.f; - if (event.has("stop_distance")) + if (event_data.has("stop_distance")) { - stop_distance = event["stop_distance"].asReal(); + stop_distance = event_data["stop_distance"].asReal(); } if (target_id.notNull()) @@ -447,22 +453,46 @@ void LLAgentListener::startFollowPilot(LLSD const & event) } } -void LLAgentListener::setAutoPilotTarget(LLSD const & event) const +void LLAgentListener::setAutoPilotTarget(LLSD const & event_data) const { - if (event.has("target_global")) + if (event_data.has("target_global")) { - LLVector3d target_global(ll_vector3d_from_sd(event["target_global"])); + LLVector3d target_global(ll_vector3d_from_sd(event_data["target_global"])); mAgent.setAutoPilotTargetGlobal(target_global); } } -void LLAgentListener::stopAutoPilot(LLSD const & event) const +void LLAgentListener::stopAutoPilot(LLSD const & event_data) const { BOOL user_cancel = FALSE; - if (event.has("user_cancel")) + if (event_data.has("user_cancel")) { - user_cancel = event["user_cancel"].asBoolean(); + user_cancel = event_data["user_cancel"].asBoolean(); } mAgent.stopAutoPilot(user_cancel); } +void LLAgentListener::lookAt(LLSD const & event_data) const +{ + LLViewerObject *object = NULL; + if (event_data.has("obj_uuid")) + { + object = gObjectList.findObject(event_data["obj_uuid"]); + } + else if (event_data.has("position")) + { + LLVector3 target_position = ll_vector3_from_sd(event_data["position"]); + object = findObjectClosestTo(target_position); + } + + S32 look_at_type = (S32) LOOKAT_TARGET_NONE; + if (event_data.has("type")) + { + look_at_type = event_data["type"].asInteger(); + } + if (look_at_type >= (S32) LOOKAT_TARGET_NONE && + look_at_type < (S32) LOOKAT_NUM_TARGETS) + { + gAgentCamera.setLookAt((ELookAtType) look_at_type, object); + } +} diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h index c917151b71..ab2b10abcb 100644 --- a/indra/newview/llagentlistener.h +++ b/indra/newview/llagentlistener.h @@ -47,14 +47,15 @@ private: void requestSit(LLSD const & event_data) const; void requestStand(LLSD const & event_data) const; void requestTouch(LLSD const & event_data) const; - void resetAxes(const LLSD& event) const; - void getAxes(const LLSD& event) const; - void getPosition(const LLSD& event) const; - void startAutoPilot(const LLSD& event); - void getAutoPilot(const LLSD& event) const; - void startFollowPilot(const LLSD& event); - void setAutoPilotTarget(const LLSD& event) const; - void stopAutoPilot(const LLSD& event) const; + void resetAxes(const LLSD& event_data) const; + void getAxes(const LLSD& event_data) const; + void getPosition(const LLSD& event_data) const; + void startAutoPilot(const LLSD& event_data); + void getAutoPilot(const LLSD& event_data) const; + void startFollowPilot(const LLSD& event_data); + void setAutoPilotTarget(const LLSD& event_data) const; + void stopAutoPilot(const LLSD& event_data) const; + void lookAt(LLSD const & event_data) const; LLViewerObject * findObjectClosestTo( const LLVector3 & position ) const; -- cgit v1.2.3 From 970b3a7f28c2f1a611410cb8738d17800949b1bd Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Thu, 21 Apr 2011 11:43:43 -0700 Subject: ER-785: Missing LSL tooltip strings for llRegionSayTo and llGetEnv. Tooltips are no longer missing. Reviewed by Kelly. --- indra/newview/skins/default/xui/en/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 27295150c5..8ac65cee91 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1830,6 +1830,15 @@ Requests single-word username of an avatar. When data is available the dataserv key llRequestDisplayName(key id) Requests name of an avatar. When data is available the dataserver event will be raised. + +llRegionSayTo(key target, integer channel, string msg) +Sends msg on channel (not DEBUG_CHANNEL) directly to prim or avatar target anywhere within the region + + +llGetEnv(string name) +Returns a string with the requested data about the region + + Not Away -- cgit v1.2.3 From 781af27e9cd500f6d62bc2d4658180f154af8816 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 9 May 2011 13:49:20 -0400 Subject: SH-1419 Sim complains about changing physical materials when Physics, Temporary, or Phantom is changed. --- indra/newview/llselectmgr.cpp | 10 +++++----- indra/newview/llviewerobject.cpp | 17 ++++++++++------- indra/newview/llviewerobject.h | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9b264b81c7..8fa4065fa6 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1997,7 +1997,7 @@ void LLSelectMgr::selectionSetPhysicsType(U8 type) if (object->permModify()) { object->setPhysicsShapeType(mType); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2016,7 +2016,7 @@ void LLSelectMgr::selectionSetFriction(F32 friction) if (object->permModify()) { object->setPhysicsFriction(mFriction); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2035,7 +2035,7 @@ void LLSelectMgr::selectionSetGravity(F32 gravity ) if (object->permModify()) { object->setPhysicsGravity(mGravity); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2054,7 +2054,7 @@ void LLSelectMgr::selectionSetDensity(F32 density ) if (object->permModify()) { object->setPhysicsDensity(mDensity); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2073,7 +2073,7 @@ void LLSelectMgr::selectionSetRestitution(F32 restitution) if (object->permModify()) { object->setPhysicsRestitution(mRestitution); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6d493bfcd5..f5fee662e6 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5282,7 +5282,7 @@ bool LLViewerObject::specialHoverCursor() const || (mClickAction != 0); } -void LLViewerObject::updateFlags() +void LLViewerObject::updateFlags(BOOL physics_changed) { LLViewerRegion* regionp = getRegion(); if(!regionp) return; @@ -5295,12 +5295,15 @@ void LLViewerObject::updateFlags() gMessageSystem->addBOOL("IsTemporary", flagTemporaryOnRez() ); gMessageSystem->addBOOL("IsPhantom", flagPhantom() ); gMessageSystem->addBOOL("CastsShadows", flagCastShadows() ); - gMessageSystem->nextBlock("ExtraPhysics"); - gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() ); - gMessageSystem->addF32("Density", getPhysicsDensity() ); - gMessageSystem->addF32("Friction", getPhysicsFriction() ); - gMessageSystem->addF32("Restitution", getPhysicsRestitution() ); - gMessageSystem->addF32("GravityMultiplier", getPhysicsGravity() ); + if (physics_changed) + { + gMessageSystem->nextBlock("ExtraPhysics"); + gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() ); + gMessageSystem->addF32("Density", getPhysicsDensity() ); + gMessageSystem->addF32("Friction", getPhysicsFriction() ); + gMessageSystem->addF32("Restitution", getPhysicsRestitution() ); + gMessageSystem->addF32("GravityMultiplier", getPhysicsGravity() ); + } gMessageSystem->sendReliable( regionp->getHost() ); } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index e417343bec..21198f7dd1 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -488,7 +488,7 @@ public: void setRegion(LLViewerRegion *regionp); virtual void updateRegion(LLViewerRegion *regionp); - void updateFlags(); + void updateFlags(BOOL physics_changed = FALSE); BOOL setFlags(U32 flag, BOOL state); void setPhysicsShapeType(U8 type); void setPhysicsGravity(F32 gravity); -- cgit v1.2.3 From 155d96000fdb319ee9ce03fd2e2d94c08f0c0a21 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 9 May 2011 13:50:07 -0400 Subject: SH-1444 "Allow mesh objects" setting is visible on a non-mesh region. --- indra/newview/llfloaterregioninfo.cpp | 5 +++++ indra/newview/skins/default/xui/en/panel_region_general.xml | 1 + 2 files changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 34fda49375..fc6976755f 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -590,6 +590,11 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region) getChildView("im_btn")->setEnabled(allow_modify); getChildView("manage_telehub_btn")->setEnabled(allow_modify); + const bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled") && + gAgent.getRegion() && + !gAgent.getRegion()->getCapability("GetMesh").empty(); + getChildView("mesh_rez_enabled_check")->setVisible(enable_mesh); + getChildView("mesh_rez_enabled_check")->setEnabled(getChildView("mesh_rez_enabled_check")->getEnabled() && enable_mesh); // Data gets filled in by processRegionInfo return LLPanelRegionInfo::refreshFromRegion(region); diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml index e0d9f3f714..3f9195d092 100644 --- a/indra/newview/skins/default/xui/en/panel_region_general.xml +++ b/indra/newview/skins/default/xui/en/panel_region_general.xml @@ -134,6 +134,7 @@ top="190" width="80" /> Date: Mon, 9 May 2011 18:00:10 -0400 Subject: SH-1343 Change wizard slider labels Changed "Performance" and "Accuracy" to "Higher Performance" and "Higher Accuracy" on physics page. --- indra/newview/skins/default/xui/en/floater_model_wizard.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml index 03af348a8d..fa4c56ffec 100644 --- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml @@ -571,9 +571,9 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se bg_opaque_color="DkGray2" background_visible="true" background_opaque="true"> - Performance + Higher Performance Faster rendering but less detailed; lowers Resource (prim) cost. - Accuracy + Higher Accuracy More detailed model but slower; increases Resource (prim) cost. Date: Fri, 13 May 2011 15:56:38 -0400 Subject: SH-769 FIXED Name field in upload model dialog allows 255 characters --- indra/newview/skins/default/xui/en/floater_model_preview.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index d08c3e7078..533e0c96f2 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -26,7 +26,7 @@ Name: - -- cgit v1.2.3 From c62ef53863bd01cb96de55e0250c8a8193b6c72b Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 13 May 2011 21:22:54 +0000 Subject: eventhost autopilot system should now set agent to flying when allow_flying= True --- indra/newview/llagentlistener.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 706851e7ff..591594d12c 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -339,10 +339,7 @@ void LLAgentListener::startAutoPilot(LLSD const & event_data) if (event_data.has("allow_flying")) { allow_flying = (BOOL) event_data["allow_flying"].asBoolean(); - if (!allow_flying) - { - mAgent.setFlying(FALSE); - } + mAgent.setFlying(allow_flying); } F32 stop_distance = 0.f; @@ -442,10 +439,7 @@ void LLAgentListener::startFollowPilot(LLSD const & event_data) if (target_id.notNull()) { - if (!allow_flying) - { - mAgent.setFlying(FALSE); - } + mAgent.setFlying(allow_flying); mFollowTarget = target_id; // Save follow target so we can report distance later mAgent.startFollowPilot(target_id, allow_flying, stop_distance); -- cgit v1.2.3 From b1453b1584788de8ba9be0b2d549ac8450669632 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 16 May 2011 12:34:25 -0400 Subject: SH-1506 "Upload Wizard" is missing from Inventory's add menu --- indra/newview/skins/default/xui/en/menu_inventory_add.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index 484af63097..b36b82ebd8 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -42,7 +42,7 @@ - @@ -54,6 +54,18 @@ + + + + + Date: Mon, 16 May 2011 12:56:18 -0400 Subject: sh-1491 WIP --- indra/newview/llfirstuse.cpp | 2 +- indra/newview/llmeshrepository.cpp | 43 +++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 2c4153688a..a9f52282a5 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -131,7 +131,7 @@ void LLFirstUse::notMoving(bool enable) // static void LLFirstUse::viewPopup(bool enable) { - firstUseNotification("FirstViewPopup", enable, "HintView", LLSD(), LLSD().with("target", "view_popup").with("direction", "right")); +// firstUseNotification("FirstViewPopup", enable, "HintView", LLSD(), LLSD().with("target", "view_popup").with("direction", "right")); } // static diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 2a68fbac8d..653fb46754 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -84,6 +84,8 @@ U32 LLMeshRepository::sPeakKbps = 0; const U32 MAX_TEXTURE_UPLOAD_RETRIES = 5; +void dumpLLSDToFile(LLSD& content, std::string filename); + std::string header_lod[] = { "lowest_lod", @@ -492,11 +494,18 @@ public: const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - assert_main_thread(); + //assert_main_thread(); llinfos << "completed" << llendl; mThread->mPendingUploads--; + + LLSD content; + LLBufferStream istr(channels, buffer.get()); + if (!LLSDSerialize::fromXML(content, istr)) + { + llinfos << "Failed to deserialize LLSD. " << " [" << status << "]: " << reason << llendl; + } + dumpLLSDToFile(content,"whole_model_response.xml"); } - }; LLMeshRepoThread::LLMeshRepoThread() @@ -1362,8 +1371,8 @@ void LLMeshUploadThread::run() } } -#if 0 -void dumpLLSDToFile(LLSD& content, std::string& filename) +#if 1 +void dumpLLSDToFile(LLSD& content, std::string filename) { std::ofstream of(filename); LLSDSerialize::toPrettyXML(content,of); @@ -1373,9 +1382,10 @@ void dumpLLSDToFile(LLSD& content, std::string& filename) void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) { // TODO where do textures go? - + LLSD result; + LLSD res; result["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT); result["asset_type"] = "mesh"; result["inventory_type"] = "object"; @@ -1384,9 +1394,9 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) // TODO "optional" fields from the spec - LLSD res; res["mesh_list"] = LLSD::emptyArray(); - res["texture_list"] = LLSD::emptyArray(); +// TODO Textures + //res["texture_list"] = LLSD::emptyArray(); S32 mesh_num = 0; S32 texture_num = 0; @@ -1432,10 +1442,15 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) LLQuaternion rot; LLMatrix4 transformation = instance.mTransform; decomposeMeshMatrix(transformation,pos,rot,scale); - + +#if 0 mesh_entry["childpos"] = ll_sd_from_vector3(pos); mesh_entry["childrot"] = ll_sd_from_quaternion(rot); mesh_entry["scale"] = ll_sd_from_vector3(scale); +#endif + mesh_entry["position"] = ll_sd_from_vector3(LLVector3()); + mesh_entry["rotation"] = ll_sd_from_quaternion(rot); + mesh_entry["scale"] = ll_sd_from_vector3(scale); // TODO should be binary. std::string str = ostr.str(); @@ -1479,9 +1494,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } result["asset_resources"] = res; -#if 0 - std::string name("whole_model.xml"); - dumpLLSDToFile(result,name); +#if 1 + dumpLLSDToFile(result,"whole_model.xml"); #endif dest = result; @@ -1540,9 +1554,14 @@ void LLMeshUploadThread::doWholeModelUpload() mPendingUploads++; LLCurlRequest::headers_t headers; - mCurlRequest->post(mWholeModelUploadCapability, headers, model_data.asString(), + mCurlRequest->post(mWholeModelUploadCapability, headers, model_data, new LLWholeModelFeeResponder(this)); + do + { + mCurlRequest->process(); + } while (mCurlRequest->getQueued() > 0); + // Currently a no-op. mFinished = true; } -- cgit v1.2.3 From e088eb82cf94872cd0dc5a673f0c0a3b3bda0703 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 16 May 2011 13:33:44 -0400 Subject: SH-1351 FIXED On the Edit Panel, remove the Override Material checkbox --- indra/newview/llpanelvolume.cpp | 1 - indra/newview/skins/default/xui/en/floater_tools.xml | 10 ---------- 2 files changed, 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index c443814c89..ff72ad0c14 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -467,7 +467,6 @@ void LLPanelVolume::refresh() getChildView("label physicsshapetype")->setVisible(enable_mesh); getChildView("Physics Shape Type Combo Ctrl")->setVisible(enable_mesh); getChildView("Physics Gravity")->setVisible(enable_mesh); - getChildView("Physics Material Override")->setVisible(enable_mesh); getChildView("Physics Friction")->setVisible(enable_mesh); getChildView("Physics Density")->setVisible(enable_mesh); getChildView("Physics Restitution")->setVisible(enable_mesh); diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 380eeae403..9178e30c8b 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2441,16 +2441,6 @@ even though the user gets a free copy. top_pad="10" width="132" /> - - Date: Mon, 16 May 2011 15:08:16 -0400 Subject: Use trial server for new search --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 33c5e533be..b36f43a638 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3908,7 +3908,7 @@ Type String Value - http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] + http://beta.search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] WebProfileURL -- cgit v1.2.3 From eb8221338e0276b9afe8d92738166f97782d48d6 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 16 May 2011 15:45:14 -0400 Subject: SH-1352 Move Material dropdown to Features tab, above Physics settings --- indra/newview/llpanelobject.cpp | 88 -------------------- indra/newview/llpanelobject.h | 5 -- indra/newview/llpanelvolume.cpp | 93 +++++++++++++++++++++- indra/newview/llpanelvolume.h | 6 +- .../newview/skins/default/xui/en/floater_tools.xml | 70 ++++++++-------- 5 files changed, 132 insertions(+), 130 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 64af6c2157..204c146f3c 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -33,11 +33,9 @@ #include "lleconomy.h" #include "llerror.h" #include "llfontgl.h" -#include "llmaterialtable.h" #include "llpermissionsflags.h" #include "llstring.h" #include "llvolume.h" -#include "material_codes.h" #include "m3math.h" // project includes @@ -57,7 +55,6 @@ #include "lltool.h" #include "lltoolcomp.h" #include "lltoolmgr.h" -#include "lltrans.h" #include "llui.h" #include "llviewerobject.h" #include "llviewerregion.h" @@ -101,17 +98,6 @@ BOOL LLPanelObject::postBuild() { setMouseOpaque(FALSE); - std::map material_name_map; - material_name_map["Stone"]= LLTrans::getString("Stone"); - material_name_map["Metal"]= LLTrans::getString("Metal"); - material_name_map["Glass"]= LLTrans::getString("Glass"); - material_name_map["Wood"]= LLTrans::getString("Wood"); - material_name_map["Flesh"]= LLTrans::getString("Flesh"); - material_name_map["Plastic"]= LLTrans::getString("Plastic"); - material_name_map["Rubber"]= LLTrans::getString("Rubber"); - material_name_map["Light"]= LLTrans::getString("Light"); - - LLMaterialTable::basic.initTableTransNames(material_name_map); //-------------------------------------------------------- // Top //-------------------------------------------------------- @@ -166,22 +152,6 @@ BOOL LLPanelObject::postBuild() //-------------------------------------------------------- - // material type popup - mComboMaterial = getChild("material"); - childSetCommitCallback("material",onCommitMaterial,this); - mComboMaterial->removeall(); - - for (LLMaterialTable::info_list_t::iterator iter = LLMaterialTable::basic.mMaterialInfoList.begin(); - iter != LLMaterialTable::basic.mMaterialInfoList.end(); ++iter) - { - LLMaterialInfo* minfop = *iter; - if (minfop->mMCode != LL_MCODE_LIGHT) - { - mComboMaterial->add(minfop->mName); - } - } - mComboMaterialItemCount = mComboMaterial->getItemCount(); - // Base Type mComboBaseType = getChild("comboBaseType"); childSetCommitCallback("comboBaseType",onCommitParametric,this); @@ -309,7 +279,6 @@ BOOL LLPanelObject::postBuild() LLPanelObject::LLPanelObject() : LLPanel(), - mComboMaterialItemCount(0), mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), @@ -527,43 +496,6 @@ void LLPanelObject::getState( ) mCheckCastShadows->setEnabled( roots_selected==1 && editable ); #endif - // Update material part - // slightly inefficient - materials are unique per object, not per TE - U8 material_code = 0; - struct f : public LLSelectedTEGetFunctor - { - U8 get(LLViewerObject* object, S32 te) - { - return object->getMaterial(); - } - } func; - bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code ); - std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); - if (editable && single_volume && material_same) - { - mComboMaterial->setEnabled( TRUE ); - if (material_code == LL_MCODE_LIGHT) - { - if (mComboMaterial->getItemCount() == mComboMaterialItemCount) - { - mComboMaterial->add(LEGACY_FULLBRIGHT_DESC); - } - mComboMaterial->setSimple(LEGACY_FULLBRIGHT_DESC); - } - else - { - if (mComboMaterial->getItemCount() != mComboMaterialItemCount) - { - mComboMaterial->remove(LEGACY_FULLBRIGHT_DESC); - } - - mComboMaterial->setSimple(std::string(LLMaterialTable::basic.getName(material_code))); - } - } - else - { - mComboMaterial->setEnabled( FALSE ); - } //---------------------------------------------------------------------------- S32 selected_item = MI_BOX; @@ -1244,25 +1176,6 @@ void LLPanelObject::sendCastShadows() } } -// static -void LLPanelObject::onCommitMaterial( LLUICtrl* ctrl, void* userdata ) -{ - //LLPanelObject* self = (LLPanelObject*) userdata; - LLComboBox* box = (LLComboBox*) ctrl; - - if (box) - { - // apply the currently selected material to the object - const std::string& material_name = box->getSimple(); - std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); - if (material_name != LEGACY_FULLBRIGHT_DESC) - { - U8 material_code = LLMaterialTable::basic.getMCode(material_name); - LLSelectMgr::getInstance()->selectionSetMaterial(material_code); - } - } -} - // static void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata ) { @@ -1937,7 +1850,6 @@ void LLPanelObject::clearCtrls() mCheckCastShadows->set(FALSE); mCheckCastShadows->setEnabled( FALSE ); #endif - mComboMaterial ->setEnabled( FALSE ); // Disable text labels mLabelPosition ->setEnabled( FALSE ); mLabelSize ->setEnabled( FALSE ); diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index e2f2a4400d..475dfdaedb 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -66,7 +66,6 @@ public: static void onCommitPhantom( LLUICtrl* ctrl, void* userdata); static void onCommitCastShadows( LLUICtrl* ctrl, void* userdata); static void onCommitPhysics( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterial( LLUICtrl* ctrl, void* userdata); static void onCommitParametric(LLUICtrl* ctrl, void* userdata); @@ -94,10 +93,6 @@ protected: void getVolumeParams(LLVolumeParams& volume_params); protected: - S32 mComboMaterialItemCount; - - LLComboBox* mComboMaterial; - // Per-object options LLComboBox* mComboBaseType; diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index ff72ad0c14..ebddaa90bc 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -59,6 +59,7 @@ #include "lltool.h" #include "lltoolcomp.h" #include "lltoolmgr.h" +#include "lltrans.h" #include "llui.h" #include "llviewerobject.h" #include "llviewerregion.h" @@ -156,6 +157,34 @@ BOOL LLPanelVolume::postBuild() mSpinPhysicsRestitution = getChild("Physics Restitution"); mSpinPhysicsRestitution->setCommitCallback(boost::bind(&LLPanelVolume::sendPhysicsRestitution, this, _1, mSpinPhysicsRestitution)); } + + std::map material_name_map; + material_name_map["Stone"]= LLTrans::getString("Stone"); + material_name_map["Metal"]= LLTrans::getString("Metal"); + material_name_map["Glass"]= LLTrans::getString("Glass"); + material_name_map["Wood"]= LLTrans::getString("Wood"); + material_name_map["Flesh"]= LLTrans::getString("Flesh"); + material_name_map["Plastic"]= LLTrans::getString("Plastic"); + material_name_map["Rubber"]= LLTrans::getString("Rubber"); + material_name_map["Light"]= LLTrans::getString("Light"); + + LLMaterialTable::basic.initTableTransNames(material_name_map); + + // material type popup + mComboMaterial = getChild("material"); + childSetCommitCallback("material",onCommitMaterial,this); + mComboMaterial->removeall(); + + for (LLMaterialTable::info_list_t::iterator iter = LLMaterialTable::basic.mMaterialInfoList.begin(); + iter != LLMaterialTable::basic.mMaterialInfoList.end(); ++iter) + { + LLMaterialInfo* minfop = *iter; + if (minfop->mMCode != LL_MCODE_LIGHT) + { + mComboMaterial->add(minfop->mName); + } + } + mComboMaterialItemCount = mComboMaterial->getItemCount(); // Start with everyone disabled clearCtrls(); @@ -164,7 +193,8 @@ BOOL LLPanelVolume::postBuild() } LLPanelVolume::LLPanelVolume() - : LLPanel() + : LLPanel(), + mComboMaterialItemCount(0) { setMouseOpaque(FALSE); @@ -379,6 +409,46 @@ void LLPanelVolume::getState( ) getChildView("FlexForceZ")->setEnabled(false); } + // Material properties + + // Update material part + // slightly inefficient - materials are unique per object, not per TE + U8 material_code = 0; + struct f : public LLSelectedTEGetFunctor + { + U8 get(LLViewerObject* object, S32 te) + { + return object->getMaterial(); + } + } func; + bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code ); + std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); + if (editable && single_volume && material_same) + { + mComboMaterial->setEnabled( TRUE ); + if (material_code == LL_MCODE_LIGHT) + { + if (mComboMaterial->getItemCount() == mComboMaterialItemCount) + { + mComboMaterial->add(LEGACY_FULLBRIGHT_DESC); + } + mComboMaterial->setSimple(LEGACY_FULLBRIGHT_DESC); + } + else + { + if (mComboMaterial->getItemCount() != mComboMaterialItemCount) + { + mComboMaterial->remove(LEGACY_FULLBRIGHT_DESC); + } + + mComboMaterial->setSimple(std::string(LLMaterialTable::basic.getName(material_code))); + } + } + else + { + mComboMaterial->setEnabled( FALSE ); + } + // Physics properties mSpinPhysicsGravity->set(objectp->getPhysicsGravity()); @@ -521,6 +591,8 @@ void LLPanelVolume::clearCtrls() mSpinPhysicsFriction->setEnabled(FALSE); mSpinPhysicsDensity->setEnabled(FALSE); mSpinPhysicsRestitution->setEnabled(FALSE); + + mComboMaterial->setEnabled( FALSE ); } // @@ -672,6 +744,25 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data) } } +// static +void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata ) +{ + //LLPanelObject* self = (LLPanelObject*) userdata; + LLComboBox* box = (LLComboBox*) ctrl; + + if (box) + { + // apply the currently selected material to the object + const std::string& material_name = box->getSimple(); + std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); + if (material_name != LEGACY_FULLBRIGHT_DESC) + { + U8 material_code = LLMaterialTable::basic.getMCode(material_name); + LLSelectMgr::getInstance()->selectionSetMaterial(material_code); + } + } +} + // static void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) { diff --git a/indra/newview/llpanelvolume.h b/indra/newview/llpanelvolume.h index 776a2c1f4a..0ef47db0d9 100644 --- a/indra/newview/llpanelvolume.h +++ b/indra/newview/llpanelvolume.h @@ -63,8 +63,8 @@ public: static void onCommitLight( LLUICtrl* ctrl, void* userdata); static void onCommitIsFlexible( LLUICtrl* ctrl, void* userdata); static void onCommitFlexible( LLUICtrl* ctrl, void* userdata); - static void onCommitPhysicsParam( LLUICtrl* ctrl, void* userdata); + static void onCommitMaterial( LLUICtrl* ctrl, void* userdata); void onLightCancelColor(const LLSD& data); void onLightSelectColor(const LLSD& data); @@ -104,6 +104,10 @@ protected: LLSpinCtrl* mSpinForce[3]; */ + S32 mComboMaterialItemCount; + LLComboBox* mComboMaterial; + + LLColor4 mLightSavedColor; LLUUID mLightSavedTexture; LLPointer mObject; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 9178e30c8b..501e93ead3 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1608,41 +1608,6 @@ even though the user gets a free copy. name="Sculpted" value="Sculpted" /> - - - - - - - - - + + + + + + + + + Date: Mon, 16 May 2011 17:39:42 -0400 Subject: sh-1491 WIP --- indra/newview/llmeshrepository.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 653fb46754..7d48416292 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -84,7 +84,7 @@ U32 LLMeshRepository::sPeakKbps = 0; const U32 MAX_TEXTURE_UPLOAD_RETRIES = 5; -void dumpLLSDToFile(LLSD& content, std::string filename); +void dumpLLSDToFile(const LLSD& content, std::string filename); std::string header_lod[] = { @@ -490,20 +490,13 @@ public: mThread(thread) { } - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) + virtual void completed(U32 status, + const std::string& reason, + const LLSD& content) { //assert_main_thread(); llinfos << "completed" << llendl; mThread->mPendingUploads--; - - LLSD content; - LLBufferStream istr(channels, buffer.get()); - if (!LLSDSerialize::fromXML(content, istr)) - { - llinfos << "Failed to deserialize LLSD. " << " [" << status << "]: " << reason << llendl; - } dumpLLSDToFile(content,"whole_model_response.xml"); } }; @@ -1372,7 +1365,7 @@ void LLMeshUploadThread::run() } #if 1 -void dumpLLSDToFile(LLSD& content, std::string filename) +void dumpLLSDToFile(const LLSD& content, std::string filename) { std::ofstream of(filename); LLSDSerialize::toPrettyXML(content,of); @@ -1562,6 +1555,9 @@ void LLMeshUploadThread::doWholeModelUpload() mCurlRequest->process(); } while (mCurlRequest->getQueued() > 0); + delete mCurlRequest; + mCurlRequest = NULL; + // Currently a no-op. mFinished = true; } -- cgit v1.2.3 From d2f138b4f348aac04d7940635b3ef44231291080 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 16 May 2011 18:11:55 -0500 Subject: SH-709 Fix for triangle limit value not updating when spinner is selected. --- indra/newview/llfloatermodelpreview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e8da1aa42c..44204e947b 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -4044,7 +4044,7 @@ void LLModelPreview::updateStatusMessages() LLSpinCtrl* limit = mFMP->getChild("lod_triangle_limit"); limit->setMaxValue(mMaxTriangleLimit); - limit->setValue(mRequestedTriangleCount[mPreviewLOD]); + limit->forceSetValue(mRequestedTriangleCount[mPreviewLOD]); if (lod_mode == 0) { -- cgit v1.2.3 From a2d8f0cb3308fed1cb2c8d5fa8fb74ec4cefa45b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 16 May 2011 19:51:16 -0500 Subject: SH-795 Cache and display LoD parameters etc for each lod. --- indra/newview/llfloatermodelpreview.cpp | 63 +++++++++++++++++----- indra/newview/llfloatermodelpreview.h | 9 +++- .../skins/default/xui/en/floater_model_preview.xml | 2 +- 3 files changed, 60 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 44204e947b..b7e9865228 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -2597,6 +2597,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) mLoading = false; mLoadState = LLModelLoader::STARTING; mGroup = 0; + mLODFrozen = false; mBuildShareTolerance = 0.f; mBuildQueueMode = GLOD_QUEUE_GREEDY; mBuildBorderMode = GLOD_BORDER_UNLOCK; @@ -2605,6 +2606,13 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) for (U32 i = 0; i < LLModel::NUM_LODS; ++i) { mRequestedTriangleCount[i] = 0; + mRequestedCreaseAngle[i] = -1.f; + mRequestedLoDMode[i] = 0; + mRequestedErrorThreshold[i] = 0.f; + mRequestedBuildOperator[i] = 0; + mRequestedQueueMode[i] = 0; + mRequestedBorderMode[i] = 0; + mRequestedShareTolerance[i] = 0.f; } mViewOption["show_textures"] = false; @@ -3247,6 +3255,8 @@ void LLModelPreview::generateNormals() F32 angle_cutoff = mFMP->childGetValue("crease_angle").asReal(); + mRequestedCreaseAngle[which_lod] = angle_cutoff; + angle_cutoff *= DEG_TO_RAD; if (which_lod == 3 && !mBaseModel.empty()) @@ -3266,7 +3276,7 @@ void LLModelPreview::generateNormals() mVertexBuffer[which_lod].clear(); refresh(); - + updateStatusMessages(); } void LLModelPreview::clearMaterials() @@ -3342,6 +3352,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim { lod_mode = iface->getFirstSelectedIndex(); } + mRequestedLoDMode[mPreviewLOD] = lod_mode; F32 lod_error_threshold = mFMP->childGetValue("lod_error_threshold").asReal(); @@ -3365,6 +3376,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim { build_operator = iface->getFirstSelectedIndex(); } + mRequestedBuildOperator[mPreviewLOD] = build_operator; if (build_operator == 0) { @@ -3381,6 +3393,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim { queue_mode = iface->getFirstSelectedIndex(); } + mRequestedQueueMode[mPreviewLOD] = queue_mode; if (queue_mode == 0) { @@ -3402,6 +3415,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim { border_mode = iface->getFirstSelectedIndex(); } + mRequestedBorderMode[mPreviewLOD] = border_mode; if (border_mode == 0) { @@ -3437,6 +3451,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim mBuildShareTolerance = share_tolerance; object_dirty = true; } + mRequestedShareTolerance[mPreviewLOD] = share_tolerance; if (mGroup == 0) { @@ -3545,6 +3560,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim U32 submeshes = 0; mRequestedTriangleCount[lod] = triangle_count; + mRequestedErrorThreshold[lod] = lod_error_threshold; glodGroupParameteri(mGroup, GLOD_ADAPT_MODE, lod_mode); stop_gloderror(); @@ -4021,6 +4037,9 @@ void LLModelPreview::updateStatusMessages() { // auto generate, also the default case for wizard which has no radio selection fmp->mLODMode[mPreviewLOD] = 1; + //don't actually regenerate lod when refreshing UI + mLODFrozen = true; + for (U32 i = 0; i < num_file_controls; ++i) { mFMP->childDisable(file_controls[i]); @@ -4033,20 +4052,21 @@ void LLModelPreview::updateStatusMessages() //if (threshold) { - U32 lod_mode = 0; - LLCtrlSelectionInterface* iface = mFMP->childGetSelectionInterface("lod_mode"); - if (iface) - { - lod_mode = iface->getFirstSelectedIndex(); - } - LLSpinCtrl* threshold = mFMP->getChild("lod_error_threshold"); LLSpinCtrl* limit = mFMP->getChild("lod_triangle_limit"); limit->setMaxValue(mMaxTriangleLimit); limit->forceSetValue(mRequestedTriangleCount[mPreviewLOD]); - if (lod_mode == 0) + threshold->forceSetValue(mRequestedErrorThreshold[mPreviewLOD]); + + mFMP->getChild("lod_mode")->selectNthItem(mRequestedLoDMode[mPreviewLOD]); + mFMP->getChild("build_operator")->selectNthItem(mRequestedBuildOperator[mPreviewLOD]); + mFMP->getChild("queue_mode")->selectNthItem(mRequestedQueueMode[mPreviewLOD]); + mFMP->getChild("border_mode")->selectNthItem(mRequestedBorderMode[mPreviewLOD]); + mFMP->getChild("share_tolerance")->setValue(mRequestedShareTolerance[mPreviewLOD]); + + if (mRequestedLoDMode[mPreviewLOD] == 0) { limit->setVisible(true); threshold->setVisible(false); @@ -4060,6 +4080,8 @@ void LLModelPreview::updateStatusMessages() threshold->setVisible(true); } } + + mLODFrozen = false; } } @@ -4075,6 +4097,20 @@ void LLModelPreview::updateStatusMessages() mFMP->childDisable("physics_file"); mFMP->childDisable("physics_browse"); } + + LLSpinCtrl* crease = mFMP->getChild("crease_angle"); + + if (mRequestedCreaseAngle[mPreviewLOD] == -1.f) + { + mFMP->childSetColor("crease_label", LLColor4::grey); + crease->forceSetValue(75.f); + } + else + { + mFMP->childSetColor("crease_label", LLColor4::white); + crease->forceSetValue(mRequestedCreaseAngle[mPreviewLOD]); + } + } void LLModelPreview::setPreviewTarget(F32 distance) @@ -4925,9 +4961,12 @@ void LLModelPreview::textureLoadedCallback( BOOL success, LLViewerFetchedTexture void LLModelPreview::onLODParamCommit(bool enforce_tri_limit) { - genLODs(mPreviewLOD, 3, enforce_tri_limit); - updateStatusMessages(); - refresh(); + if (!mLODFrozen) + { + genLODs(mPreviewLOD, 3, enforce_tri_limit); + updateStatusMessages(); + refresh(); + } } LLFloaterModelPreview::DecompRequest::DecompRequest(const std::string& stage, LLModel* mdl) diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 4d8b46807f..b54a72e555 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -373,13 +373,20 @@ public: std::map mViewOption; //GLOD object parameters (must rebuild object if these change) + bool mLODFrozen; F32 mBuildShareTolerance; U32 mBuildQueueMode; U32 mBuildOperator; U32 mBuildBorderMode; + U32 mRequestedLoDMode[LLModel::NUM_LODS]; S32 mRequestedTriangleCount[LLModel::NUM_LODS]; + F32 mRequestedErrorThreshold[LLModel::NUM_LODS]; + U32 mRequestedBuildOperator[LLModel::NUM_LODS]; + U32 mRequestedQueueMode[LLModel::NUM_LODS]; + U32 mRequestedBorderMode[LLModel::NUM_LODS]; + F32 mRequestedShareTolerance[LLModel::NUM_LODS]; + F32 mRequestedCreaseAngle[LLModel::NUM_LODS]; - LLModelLoader* mModelLoader; LLModelLoader::scene mScene[LLModel::NUM_LODS]; diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index d08c3e7078..374eeeb0de 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -219,7 +219,7 @@ Generate Normals - + Crease Angle: -- cgit v1.2.3 From 0e548921730eac8d4f4791362390993f2d20b99b Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 17 May 2011 10:55:35 -0400 Subject: SH-1352 FIXED Move Material dropdown to Features tab, above Physics settings --- indra/newview/llpanelobject.cpp | 88 -------------------- indra/newview/llpanelobject.h | 5 -- indra/newview/llpanelvolume.cpp | 93 +++++++++++++++++++++- indra/newview/llpanelvolume.h | 6 +- .../newview/skins/default/xui/en/floater_tools.xml | 70 ++++++++-------- 5 files changed, 132 insertions(+), 130 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 64af6c2157..204c146f3c 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -33,11 +33,9 @@ #include "lleconomy.h" #include "llerror.h" #include "llfontgl.h" -#include "llmaterialtable.h" #include "llpermissionsflags.h" #include "llstring.h" #include "llvolume.h" -#include "material_codes.h" #include "m3math.h" // project includes @@ -57,7 +55,6 @@ #include "lltool.h" #include "lltoolcomp.h" #include "lltoolmgr.h" -#include "lltrans.h" #include "llui.h" #include "llviewerobject.h" #include "llviewerregion.h" @@ -101,17 +98,6 @@ BOOL LLPanelObject::postBuild() { setMouseOpaque(FALSE); - std::map material_name_map; - material_name_map["Stone"]= LLTrans::getString("Stone"); - material_name_map["Metal"]= LLTrans::getString("Metal"); - material_name_map["Glass"]= LLTrans::getString("Glass"); - material_name_map["Wood"]= LLTrans::getString("Wood"); - material_name_map["Flesh"]= LLTrans::getString("Flesh"); - material_name_map["Plastic"]= LLTrans::getString("Plastic"); - material_name_map["Rubber"]= LLTrans::getString("Rubber"); - material_name_map["Light"]= LLTrans::getString("Light"); - - LLMaterialTable::basic.initTableTransNames(material_name_map); //-------------------------------------------------------- // Top //-------------------------------------------------------- @@ -166,22 +152,6 @@ BOOL LLPanelObject::postBuild() //-------------------------------------------------------- - // material type popup - mComboMaterial = getChild("material"); - childSetCommitCallback("material",onCommitMaterial,this); - mComboMaterial->removeall(); - - for (LLMaterialTable::info_list_t::iterator iter = LLMaterialTable::basic.mMaterialInfoList.begin(); - iter != LLMaterialTable::basic.mMaterialInfoList.end(); ++iter) - { - LLMaterialInfo* minfop = *iter; - if (minfop->mMCode != LL_MCODE_LIGHT) - { - mComboMaterial->add(minfop->mName); - } - } - mComboMaterialItemCount = mComboMaterial->getItemCount(); - // Base Type mComboBaseType = getChild("comboBaseType"); childSetCommitCallback("comboBaseType",onCommitParametric,this); @@ -309,7 +279,6 @@ BOOL LLPanelObject::postBuild() LLPanelObject::LLPanelObject() : LLPanel(), - mComboMaterialItemCount(0), mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), @@ -527,43 +496,6 @@ void LLPanelObject::getState( ) mCheckCastShadows->setEnabled( roots_selected==1 && editable ); #endif - // Update material part - // slightly inefficient - materials are unique per object, not per TE - U8 material_code = 0; - struct f : public LLSelectedTEGetFunctor - { - U8 get(LLViewerObject* object, S32 te) - { - return object->getMaterial(); - } - } func; - bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code ); - std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); - if (editable && single_volume && material_same) - { - mComboMaterial->setEnabled( TRUE ); - if (material_code == LL_MCODE_LIGHT) - { - if (mComboMaterial->getItemCount() == mComboMaterialItemCount) - { - mComboMaterial->add(LEGACY_FULLBRIGHT_DESC); - } - mComboMaterial->setSimple(LEGACY_FULLBRIGHT_DESC); - } - else - { - if (mComboMaterial->getItemCount() != mComboMaterialItemCount) - { - mComboMaterial->remove(LEGACY_FULLBRIGHT_DESC); - } - - mComboMaterial->setSimple(std::string(LLMaterialTable::basic.getName(material_code))); - } - } - else - { - mComboMaterial->setEnabled( FALSE ); - } //---------------------------------------------------------------------------- S32 selected_item = MI_BOX; @@ -1244,25 +1176,6 @@ void LLPanelObject::sendCastShadows() } } -// static -void LLPanelObject::onCommitMaterial( LLUICtrl* ctrl, void* userdata ) -{ - //LLPanelObject* self = (LLPanelObject*) userdata; - LLComboBox* box = (LLComboBox*) ctrl; - - if (box) - { - // apply the currently selected material to the object - const std::string& material_name = box->getSimple(); - std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); - if (material_name != LEGACY_FULLBRIGHT_DESC) - { - U8 material_code = LLMaterialTable::basic.getMCode(material_name); - LLSelectMgr::getInstance()->selectionSetMaterial(material_code); - } - } -} - // static void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata ) { @@ -1937,7 +1850,6 @@ void LLPanelObject::clearCtrls() mCheckCastShadows->set(FALSE); mCheckCastShadows->setEnabled( FALSE ); #endif - mComboMaterial ->setEnabled( FALSE ); // Disable text labels mLabelPosition ->setEnabled( FALSE ); mLabelSize ->setEnabled( FALSE ); diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index e2f2a4400d..475dfdaedb 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -66,7 +66,6 @@ public: static void onCommitPhantom( LLUICtrl* ctrl, void* userdata); static void onCommitCastShadows( LLUICtrl* ctrl, void* userdata); static void onCommitPhysics( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterial( LLUICtrl* ctrl, void* userdata); static void onCommitParametric(LLUICtrl* ctrl, void* userdata); @@ -94,10 +93,6 @@ protected: void getVolumeParams(LLVolumeParams& volume_params); protected: - S32 mComboMaterialItemCount; - - LLComboBox* mComboMaterial; - // Per-object options LLComboBox* mComboBaseType; diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index c443814c89..0803fea004 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -59,6 +59,7 @@ #include "lltool.h" #include "lltoolcomp.h" #include "lltoolmgr.h" +#include "lltrans.h" #include "llui.h" #include "llviewerobject.h" #include "llviewerregion.h" @@ -156,6 +157,34 @@ BOOL LLPanelVolume::postBuild() mSpinPhysicsRestitution = getChild("Physics Restitution"); mSpinPhysicsRestitution->setCommitCallback(boost::bind(&LLPanelVolume::sendPhysicsRestitution, this, _1, mSpinPhysicsRestitution)); } + + std::map material_name_map; + material_name_map["Stone"]= LLTrans::getString("Stone"); + material_name_map["Metal"]= LLTrans::getString("Metal"); + material_name_map["Glass"]= LLTrans::getString("Glass"); + material_name_map["Wood"]= LLTrans::getString("Wood"); + material_name_map["Flesh"]= LLTrans::getString("Flesh"); + material_name_map["Plastic"]= LLTrans::getString("Plastic"); + material_name_map["Rubber"]= LLTrans::getString("Rubber"); + material_name_map["Light"]= LLTrans::getString("Light"); + + LLMaterialTable::basic.initTableTransNames(material_name_map); + + // material type popup + mComboMaterial = getChild("material"); + childSetCommitCallback("material",onCommitMaterial,this); + mComboMaterial->removeall(); + + for (LLMaterialTable::info_list_t::iterator iter = LLMaterialTable::basic.mMaterialInfoList.begin(); + iter != LLMaterialTable::basic.mMaterialInfoList.end(); ++iter) + { + LLMaterialInfo* minfop = *iter; + if (minfop->mMCode != LL_MCODE_LIGHT) + { + mComboMaterial->add(minfop->mName); + } + } + mComboMaterialItemCount = mComboMaterial->getItemCount(); // Start with everyone disabled clearCtrls(); @@ -164,7 +193,8 @@ BOOL LLPanelVolume::postBuild() } LLPanelVolume::LLPanelVolume() - : LLPanel() + : LLPanel(), + mComboMaterialItemCount(0) { setMouseOpaque(FALSE); @@ -379,6 +409,46 @@ void LLPanelVolume::getState( ) getChildView("FlexForceZ")->setEnabled(false); } + // Material properties + + // Update material part + // slightly inefficient - materials are unique per object, not per TE + U8 material_code = 0; + struct f : public LLSelectedTEGetFunctor + { + U8 get(LLViewerObject* object, S32 te) + { + return object->getMaterial(); + } + } func; + bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code ); + std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); + if (editable && single_volume && material_same) + { + mComboMaterial->setEnabled( TRUE ); + if (material_code == LL_MCODE_LIGHT) + { + if (mComboMaterial->getItemCount() == mComboMaterialItemCount) + { + mComboMaterial->add(LEGACY_FULLBRIGHT_DESC); + } + mComboMaterial->setSimple(LEGACY_FULLBRIGHT_DESC); + } + else + { + if (mComboMaterial->getItemCount() != mComboMaterialItemCount) + { + mComboMaterial->remove(LEGACY_FULLBRIGHT_DESC); + } + + mComboMaterial->setSimple(std::string(LLMaterialTable::basic.getName(material_code))); + } + } + else + { + mComboMaterial->setEnabled( FALSE ); + } + // Physics properties mSpinPhysicsGravity->set(objectp->getPhysicsGravity()); @@ -522,6 +592,8 @@ void LLPanelVolume::clearCtrls() mSpinPhysicsFriction->setEnabled(FALSE); mSpinPhysicsDensity->setEnabled(FALSE); mSpinPhysicsRestitution->setEnabled(FALSE); + + mComboMaterial->setEnabled( FALSE ); } // @@ -673,6 +745,25 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data) } } +// static +void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata ) +{ + //LLPanelObject* self = (LLPanelObject*) userdata; + LLComboBox* box = (LLComboBox*) ctrl; + + if (box) + { + // apply the currently selected material to the object + const std::string& material_name = box->getSimple(); + std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); + if (material_name != LEGACY_FULLBRIGHT_DESC) + { + U8 material_code = LLMaterialTable::basic.getMCode(material_name); + LLSelectMgr::getInstance()->selectionSetMaterial(material_code); + } + } +} + // static void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) { diff --git a/indra/newview/llpanelvolume.h b/indra/newview/llpanelvolume.h index 776a2c1f4a..0ef47db0d9 100644 --- a/indra/newview/llpanelvolume.h +++ b/indra/newview/llpanelvolume.h @@ -63,8 +63,8 @@ public: static void onCommitLight( LLUICtrl* ctrl, void* userdata); static void onCommitIsFlexible( LLUICtrl* ctrl, void* userdata); static void onCommitFlexible( LLUICtrl* ctrl, void* userdata); - static void onCommitPhysicsParam( LLUICtrl* ctrl, void* userdata); + static void onCommitMaterial( LLUICtrl* ctrl, void* userdata); void onLightCancelColor(const LLSD& data); void onLightSelectColor(const LLSD& data); @@ -104,6 +104,10 @@ protected: LLSpinCtrl* mSpinForce[3]; */ + S32 mComboMaterialItemCount; + LLComboBox* mComboMaterial; + + LLColor4 mLightSavedColor; LLUUID mLightSavedTexture; LLPointer mObject; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 05d47506db..edc829cb9c 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1608,41 +1608,6 @@ even though the user gets a free copy. name="Sculpted" value="Sculpted" /> - - - - - - - - - + + + + + + + + + Date: Tue, 17 May 2011 10:56:40 -0400 Subject: SH-1343 FIXED Change wizard slider labels --- indra/newview/skins/default/xui/en/floater_model_wizard.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml index 92d57b20be..47b2e5fd79 100644 --- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml @@ -572,9 +572,9 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se bg_opaque_color="DkGray2" background_visible="true" background_opaque="true"> - Performance + Higher Performance Faster rendering but less detailed; lowers Resource (prim) cost. - Accuracy + Higher Accuracy More detailed model but slower; increases Resource (prim) cost. Date: Tue, 17 May 2011 10:57:19 -0400 Subject: SH-1351 FIXED On the Edit Panel, remove the Override Material checkbox --- indra/newview/llpanelvolume.cpp | 1 - indra/newview/skins/default/xui/en/floater_tools.xml | 10 ---------- 2 files changed, 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 0803fea004..ebddaa90bc 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -537,7 +537,6 @@ void LLPanelVolume::refresh() getChildView("label physicsshapetype")->setVisible(enable_mesh); getChildView("Physics Shape Type Combo Ctrl")->setVisible(enable_mesh); getChildView("Physics Gravity")->setVisible(enable_mesh); - getChildView("Physics Material Override")->setVisible(enable_mesh); getChildView("Physics Friction")->setVisible(enable_mesh); getChildView("Physics Density")->setVisible(enable_mesh); getChildView("Physics Restitution")->setVisible(enable_mesh); diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index edc829cb9c..40bf7bfed7 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2441,16 +2441,6 @@ even though the user gets a free copy. top_pad="10" width="132" /> - - Date: Tue, 17 May 2011 10:57:56 -0400 Subject: SH-1419 FIXED Sim complains about changing physical materials when Physics, Temporary, or Phantom is changed. --- indra/newview/llselectmgr.cpp | 10 +++++----- indra/newview/llviewerobject.cpp | 17 ++++++++++------- indra/newview/llviewerobject.h | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9b264b81c7..8fa4065fa6 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1997,7 +1997,7 @@ void LLSelectMgr::selectionSetPhysicsType(U8 type) if (object->permModify()) { object->setPhysicsShapeType(mType); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2016,7 +2016,7 @@ void LLSelectMgr::selectionSetFriction(F32 friction) if (object->permModify()) { object->setPhysicsFriction(mFriction); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2035,7 +2035,7 @@ void LLSelectMgr::selectionSetGravity(F32 gravity ) if (object->permModify()) { object->setPhysicsGravity(mGravity); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2054,7 +2054,7 @@ void LLSelectMgr::selectionSetDensity(F32 density ) if (object->permModify()) { object->setPhysicsDensity(mDensity); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2073,7 +2073,7 @@ void LLSelectMgr::selectionSetRestitution(F32 restitution) if (object->permModify()) { object->setPhysicsRestitution(mRestitution); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6d493bfcd5..f5fee662e6 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5282,7 +5282,7 @@ bool LLViewerObject::specialHoverCursor() const || (mClickAction != 0); } -void LLViewerObject::updateFlags() +void LLViewerObject::updateFlags(BOOL physics_changed) { LLViewerRegion* regionp = getRegion(); if(!regionp) return; @@ -5295,12 +5295,15 @@ void LLViewerObject::updateFlags() gMessageSystem->addBOOL("IsTemporary", flagTemporaryOnRez() ); gMessageSystem->addBOOL("IsPhantom", flagPhantom() ); gMessageSystem->addBOOL("CastsShadows", flagCastShadows() ); - gMessageSystem->nextBlock("ExtraPhysics"); - gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() ); - gMessageSystem->addF32("Density", getPhysicsDensity() ); - gMessageSystem->addF32("Friction", getPhysicsFriction() ); - gMessageSystem->addF32("Restitution", getPhysicsRestitution() ); - gMessageSystem->addF32("GravityMultiplier", getPhysicsGravity() ); + if (physics_changed) + { + gMessageSystem->nextBlock("ExtraPhysics"); + gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() ); + gMessageSystem->addF32("Density", getPhysicsDensity() ); + gMessageSystem->addF32("Friction", getPhysicsFriction() ); + gMessageSystem->addF32("Restitution", getPhysicsRestitution() ); + gMessageSystem->addF32("GravityMultiplier", getPhysicsGravity() ); + } gMessageSystem->sendReliable( regionp->getHost() ); } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index e417343bec..21198f7dd1 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -488,7 +488,7 @@ public: void setRegion(LLViewerRegion *regionp); virtual void updateRegion(LLViewerRegion *regionp); - void updateFlags(); + void updateFlags(BOOL physics_changed = FALSE); BOOL setFlags(U32 flag, BOOL state); void setPhysicsShapeType(U8 type); void setPhysicsGravity(F32 gravity); -- cgit v1.2.3 From 7e977d05f20a15e2ee17522a19624f061722580e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 17 May 2011 10:58:21 -0400 Subject: SH-1444 FIXED "Allow mesh objects" setting is visible on a non-mesh region. --- indra/newview/llfloaterregioninfo.cpp | 5 +++++ indra/newview/skins/default/xui/en/panel_region_general.xml | 1 + 2 files changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 34fda49375..fc6976755f 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -590,6 +590,11 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region) getChildView("im_btn")->setEnabled(allow_modify); getChildView("manage_telehub_btn")->setEnabled(allow_modify); + const bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled") && + gAgent.getRegion() && + !gAgent.getRegion()->getCapability("GetMesh").empty(); + getChildView("mesh_rez_enabled_check")->setVisible(enable_mesh); + getChildView("mesh_rez_enabled_check")->setEnabled(getChildView("mesh_rez_enabled_check")->getEnabled() && enable_mesh); // Data gets filled in by processRegionInfo return LLPanelRegionInfo::refreshFromRegion(region); diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml index e0d9f3f714..3f9195d092 100644 --- a/indra/newview/skins/default/xui/en/panel_region_general.xml +++ b/indra/newview/skins/default/xui/en/panel_region_general.xml @@ -134,6 +134,7 @@ top="190" width="80" /> Date: Tue, 17 May 2011 10:58:42 -0400 Subject: SH-1506 FIXED "Upload Wizard" is missing from Inventory's add menu --- indra/newview/skins/default/xui/en/menu_inventory_add.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index 484af63097..b36b82ebd8 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -42,7 +42,7 @@ - @@ -54,6 +54,18 @@ + + + + + Date: Tue, 17 May 2011 11:02:28 -0400 Subject: SH-769 FIXED Name field in upload model dialog allows 255 characters... --- indra/newview/skins/default/xui/en/floater_model_preview.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 374eeeb0de..85535c2078 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -23,7 +23,7 @@ Simplifying... - + Name: Date: Mon, 23 May 2011 12:49:19 -0700 Subject: changing URL to support SSL --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b36f43a638..95ae6df833 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3908,7 +3908,7 @@ Type String Value - http://beta.search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] + http://search-beta.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] WebProfileURL -- cgit v1.2.3 From d8183a71d40da61635c05b933368f43b7d4f2a80 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 17 May 2011 18:18:10 -0400 Subject: SH-1580 FIXED Disable mesh mirroring in build tools & on server --- indra/newview/llpanelobject.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 204c146f3c..34a92cd0ac 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -1027,12 +1027,9 @@ void LLPanelObject::getState( ) mCtrlSculptTexture->setVisible(sculpt_texture_visible); mLabelSculptType->setVisible(sculpt_texture_visible); mCtrlSculptType->setVisible(sculpt_texture_visible); - mCtrlSculptMirror->setVisible(sculpt_texture_visible); - mCtrlSculptInvert->setVisible(sculpt_texture_visible); // sculpt texture - if (selected_item == MI_SCULPT) { @@ -1077,7 +1074,7 @@ void LLPanelObject::getState( ) if (mCtrlSculptMirror) { mCtrlSculptMirror->set(sculpt_mirror); - mCtrlSculptMirror->setEnabled(editable); + mCtrlSculptMirror->setEnabled(editable && !isMesh); } if (mCtrlSculptInvert) @@ -1098,6 +1095,9 @@ void LLPanelObject::getState( ) mSculptTextureRevert = LLUUID::null; } + mCtrlSculptMirror->setVisible(sculpt_texture_visible && !isMesh); + mCtrlSculptInvert->setVisible(sculpt_texture_visible && !isMesh); + //---------------------------------------------------------------------------- mObject = objectp; -- cgit v1.2.3 From f9ac182865ac31eb03668a628e100d94c35eab53 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 17 May 2011 23:47:29 -0500 Subject: SH-1555 Disable upload button if a hull exists that has more than 256 vertices. --- indra/newview/llfloatermodelpreview.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index b7e9865228..241e908d8c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3848,6 +3848,18 @@ void LLModelPreview::updateStatusMessages() } } + + //make sure no hulls have more than 256 points in them + for (U32 i = 0; upload_ok && i < mModel[LLModel::LOD_PHYSICS].size(); ++i) + { + LLModel* mdl = mModel[LLModel::LOD_PHYSICS][i]; + + for (U32 j = 0; upload_ok && j < mdl->mPhysics.mHull.size(); ++j) + { + upload_ok = upload_ok && mdl->mPhysics.mHull[i].size() <= 256; + } + } + bool errorStateFromLoader = getLoadState() >= LLModelLoader::ERROR_PARSING ? true : false; bool skinAndRigOk = true; @@ -3871,6 +3883,10 @@ void LLModelPreview::updateStatusMessages() { mFMP->childEnable("ok_btn"); } + else + { + mFMP->childDisable("ok_btn"); + } //add up physics triangles etc S32 start = 0; -- cgit v1.2.3 From 4374f53e23c9d999206764b0b38473337720c1c3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 May 2011 02:02:52 -0500 Subject: SH-1586 Fix for bad camera behavior introduced by SH-1119 --- indra/newview/llagentcamera.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c6b5a0113f..80085dad9d 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -394,7 +394,9 @@ LLVector3 LLAgentCamera::calcFocusOffset(LLViewerObject *object, LLVector3 origi LLQuaternion inv_obj_rot = ~obj_rot; // get inverse of rotation LLVector3 object_extents; const LLVector4a* oe4 = object->mDrawable->getSpatialExtents(); - object_extents.set( oe4[1][0], oe4[1][1], oe4[1][2] ); + LLVector4a size; + size.setSub(oe4[1], oe4[0]); + object_extents.set( size[0], size[1], size[2] ); // make sure they object extents are non-zero object_extents.clamp(0.001f, F32_MAX); -- cgit v1.2.3 From 7a02501aae8a21f4bf552d47e0799c4abdcd4228 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 May 2011 09:47:58 -0400 Subject: SH-1492 WIP --- indra/newview/llmeshrepository.cpp | 32 ++++++++++++++++++++++++++++++-- indra/newview/llmeshrepository.h | 3 ++- 2 files changed, 32 insertions(+), 3 deletions(-) mode change 100644 => 100755 indra/newview/llmeshrepository.cpp mode change 100644 => 100755 indra/newview/llmeshrepository.h (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp old mode 100644 new mode 100755 index 922291c9e1..5305f3dbca --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -499,6 +499,27 @@ public: llinfos << "completed" << llendl; mThread->mPendingUploads--; dumpLLSDToFile(content,"whole_model_response.xml"); + + mThread->mWholeModelUploadURL = content["uploader"]; + } +}; + +class LLWholeModelUploadResponder: public LLCurl::Responder +{ + LLMeshUploadThread* mThread; +public: + LLWholeModelUploadResponder(LLMeshUploadThread* thread): + mThread(thread) + { + } + virtual void completed(U32 status, + const std::string& reason, + const LLSD& content) + { + //assert_main_thread(); + llinfos << "upload completed" << llendl; + mThread->mPendingUploads--; + dumpLLSDToFile(content,"whole_model_upload_response.xml"); } }; @@ -1263,7 +1284,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, mUploadObjectAssetCapability = gAgent.getRegion()->getCapability("UploadObjectAsset"); mNewInventoryCapability = gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice"); - mWholeModelUploadCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory"); + mWholeModelFeeCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory"); mOrigin += gAgent.getAtAxis() * scale.magVec(); } @@ -1548,7 +1569,7 @@ void LLMeshUploadThread::doWholeModelUpload() mPendingUploads++; LLCurlRequest::headers_t headers; - mCurlRequest->post(mWholeModelUploadCapability, headers, model_data, + mCurlRequest->post(mWholeModelFeeCapability, headers, model_data, new LLWholeModelFeeResponder(this)); do @@ -1556,6 +1577,13 @@ void LLMeshUploadThread::doWholeModelUpload() mCurlRequest->process(); } while (mCurlRequest->getQueued() > 0); + mCurlRequest->post(mWholeModelUploadURL, headers, model_data["asset_resources"], new LLWholeModelUploadResponder(this)); + + do + { + mCurlRequest->process(); + } while (mCurlRequest->getQueued() > 0); + delete mCurlRequest; mCurlRequest = NULL; diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h old mode 100644 new mode 100755 index 802e3e1aba..f859e29c07 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -387,7 +387,8 @@ public: LLHost mHost; std::string mUploadObjectAssetCapability; std::string mNewInventoryCapability; - std::string mWholeModelUploadCapability; + std::string mWholeModelFeeCapability; + std::string mWholeModelUploadURL; std::queue mUploadQ; std::queue mConfirmedQ; -- cgit v1.2.3 From 3990324e8f8391aee335ad74b33b22e0b1c849af Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 May 2011 11:33:28 -0400 Subject: trying to fix mac build complaints --- indra/newview/llmeshrepository.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 5305f3dbca..d9a58d56fe 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -500,7 +500,7 @@ public: mThread->mPendingUploads--; dumpLLSDToFile(content,"whole_model_response.xml"); - mThread->mWholeModelUploadURL = content["uploader"]; + mThread->mWholeModelUploadURL = content["uploader"].asString(); } }; @@ -1389,7 +1389,7 @@ void LLMeshUploadThread::run() #if 1 void dumpLLSDToFile(const LLSD& content, std::string filename) { - std::ofstream of(filename); + std::ofstream of(filename.c_str()); LLSDSerialize::toPrettyXML(content,of); } #endif -- cgit v1.2.3 From c84e84cfbf101deb0a920bd95b3a8a7b16806d04 Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 18 May 2011 15:56:24 -0400 Subject: Fix for sh-1227. Decoupled avatar in preview window from in world avatar. Code cleanup. --- indra/newview/llfloatermodelpreview.cpp | 103 +++++++++++--------------------- indra/newview/llfloatermodelpreview.h | 4 ++ 2 files changed, 38 insertions(+), 69 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 241e908d8c..9dd5269a6b 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -98,7 +98,8 @@ #include "llvfile.h" #include "llvfs.h" #include "llcallbacklist.h" - +#include "llviewerobjectlist.h" +#include "llanimationstates.h" #include "glod/glod.h" //static @@ -381,12 +382,6 @@ LLFloaterModelPreview::~LLFloaterModelPreview() { sInstance = NULL; - if ( mModelPreview && mModelPreview->getResetJointFlag() ) - { - gAgentAvatarp->resetJointPositions(); - } - - if ( mModelPreview ) { delete mModelPreview; @@ -1577,7 +1572,7 @@ bool LLModelLoader::doLoadModel() { //llinfos<<"joint "<getJoint( lookingForJoint ); + LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint ); if ( pJoint ) { pJoint->storeCurrentXform( jointTransform.getTranslation() ); @@ -2657,6 +2652,8 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) mMasterLegacyJointList.push_front("mHipLeft"); mMasterLegacyJointList.push_front("mKneeLeft"); mMasterLegacyJointList.push_front("mFootLeft"); + + createPreviewAvatar(); } LLModelPreview::~LLModelPreview() @@ -2710,7 +2707,7 @@ U32 LLModelPreview::calcResourceCost() if ( mFMP && mFMP->childGetValue("upload_joints").asBoolean() ) { - gAgentAvatarp->setPelvisOffset( mPelvisZOffset ); + getPreviewAvatar()->setPelvisOffset( mPelvisZOffset ); } F32 streaming_cost = 0.f; @@ -4293,42 +4290,6 @@ void LLModelPreview::update() } //----------------------------------------------------------------------------- -// changeAvatarsJointPositions() -//----------------------------------------------------------------------------- -void LLModelPreview::changeAvatarsJointPositions( LLModel* pModel ) -{ - if ( mMasterJointList.empty() ) - { - return; - } - - std::vector :: const_iterator jointListItBegin = pModel->mSkinInfo.mJointNames.begin(); - std::vector :: const_iterator jointListItEnd = pModel->mSkinInfo.mJointNames.end(); - - S32 index = 0; - for ( ; jointListItBegin!=jointListItEnd; ++jointListItBegin, ++index ) - { - std::string elem = *jointListItBegin; - //llinfos<<"joint "<mSkinInfo.mAlternateBindMatrix.size(); - if ( matrixCnt < 1 ) - { - llinfos<<"Total WTF moment :"<mSkinInfo.mAlternateBindMatrix[index]; - - LLJoint* pJoint = gAgentAvatarp->getJoint( elem ); - if ( pJoint ) - { - pJoint->storeCurrentXform( jointTransform.getTranslation() ); - } - } - } -} -//----------------------------------------------------------------------------- // getTranslationForJointOffset() //----------------------------------------------------------------------------- LLVector3 LLModelPreview::getTranslationForJointOffset( std::string joint ) @@ -4341,6 +4302,30 @@ LLVector3 LLModelPreview::getTranslationForJointOffset( std::string joint ) } return LLVector3(0.0f,0.0f,0.0f); } +//----------------------------------------------------------------------------- +// createPreviewAvatar +//----------------------------------------------------------------------------- +void LLModelPreview::createPreviewAvatar( void ) +{ + mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion() ); + if ( mPreviewAvatar ) + { + mPreviewAvatar->createDrawable( &gPipeline ); + mPreviewAvatar->mIsDummy = TRUE; + mPreviewAvatar->mSpecialRenderMode = 1; + mPreviewAvatar->setPositionAgent( LLVector3::zero ); + mPreviewAvatar->slamPosition(); + mPreviewAvatar->updateJointLODs(); + mPreviewAvatar->updateGeometry( mPreviewAvatar->mDrawable ); + mPreviewAvatar->startMotion( ANIM_AGENT_STAND ); + mPreviewAvatar->hideSkirt(); + } + else + { + llinfos<<"Failed to create preview avatar for upload model window"<childSetEnabled("upload_joints", upload_skin); - //poke at avatar when we upload custom joints - /* - if ( upload_joints ) - { - for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter) - { - for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter) - { - LLModelInstance& instance = *model_iter; - LLModel* model = instance.mModel; - if ( !model->mSkinWeights.empty() ) - { - changeAvatarsJointPositions( model ); - } - } - } - } - */ - F32 explode = mFMP->childGetValue("physics_explode").asReal(); glClear(GL_DEPTH_BUFFER_BIT); @@ -4493,7 +4459,7 @@ BOOL LLModelPreview::render() if (skin_weight) { - target_pos = gAgentAvatarp->getPositionAgent(); + target_pos = getPreviewAvatar()->getPositionAgent(); z_near = 0.01f; z_far = 1024.f; mCameraDistance = 16.f; @@ -4713,8 +4679,7 @@ BOOL LLModelPreview::render() } else { - LLVOAvatarSelf* avatar = gAgentAvatarp; - target_pos = avatar->getPositionAgent(); + target_pos = getPreviewAvatar()->getPositionAgent(); LLViewerCamera::getInstance()->setOriginAndLookAt( target_pos + ((LLVector3(mCameraDistance, 0.f, 0.f) + offset) * av_rot), // camera @@ -4723,7 +4688,7 @@ BOOL LLModelPreview::render() if (joint_positions) { - avatar->renderCollisionVolumes(); + getPreviewAvatar()->renderCollisionVolumes(); } for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter) @@ -4754,7 +4719,7 @@ BOOL LLModelPreview::render() LLMatrix4 mat[64]; for (U32 j = 0; j < model->mSkinInfo.mJointNames.size(); ++j) { - LLJoint* joint = avatar->getJoint(model->mSkinInfo.mJointNames[j]); + LLJoint* joint = getPreviewAvatar()->getJoint(model->mSkinInfo.mJointNames[j]); if (joint) { mat[j] = model->mSkinInfo.mInvBindMatrix[j]; diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index b54a72e555..f6d4a08d1f 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -341,6 +341,9 @@ public: LLVector3 getTranslationForJointOffset( std::string joint ); + void createPreviewAvatar( void ); + LLVOAvatar* getPreviewAvatar( void ) { return mPreviewAvatar; } + protected: friend class LLModelLoader; friend class LLFloaterModelPreview; @@ -422,6 +425,7 @@ public: std::deque mMasterLegacyJointList; std::deque mJointsFromNode; JointTransformMap mJointTransformMap; + LLPointer mPreviewAvatar; }; #endif // LL_LLFLOATERMODELPREVIEW_H -- cgit v1.2.3 From bd5801ef62882bbe58edf0a0fb6c0f5bf950efa1 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 19 May 2011 13:53:47 -0400 Subject: SH-769 FIXED Name field in model dialog allows 255 characters --- indra/newview/skins/default/xui/en/floater_model_preview.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 85535c2078..dce55dae12 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -23,10 +23,10 @@ Simplifying... - + Name: - -- cgit v1.2.3 From 19a06478d9863c451450b7c9e2f931ba587a3cec Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 19 May 2011 17:28:23 -0700 Subject: SH-1618 FIX -- Lighting and shadows crash ATI macs * Fixed ATI mac "lighting and shadows" related crash * Fixed up numerous GL errors on macs related to multiple color formats, the use of glEnable/glDisable on textures above the texture unit count and old ATI-specific code that was not appropriate for Mac. * Disabled SSAO for ATI macs due to it not working with shadows * Ongoing work to properly get shadows and SSAO functioning on ATI macs is required. Reviewed by davep --- .../shaders/class1/deferred/multiPointLightF.glsl | 61 ++++++++++++---------- indra/newview/featuretable_mac.txt | 3 ++ indra/newview/llfeaturemanager.cpp | 2 +- indra/newview/pipeline.cpp | 17 +++++- 4 files changed, 54 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index c5ddf31ac0..609fc4f14f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -23,8 +23,9 @@ uniform float sun_wash; uniform int light_count; -uniform vec4 light[16]; -uniform vec4 light_col[16]; +#define MAX_LIGHT_COUNT 16 +uniform vec4 light[MAX_LIGHT_COUNT]; +uniform vec4 light_col[MAX_LIGHT_COUNT]; varying vec4 vary_fragcoord; uniform vec2 screen_res; @@ -63,50 +64,56 @@ void main() float noise = texture2D(noiseMap, frag.xy/128.0).b; vec3 out_col = vec3(0,0,0); vec3 npos = normalize(-pos); - - for (int i = 0; i < light_count; ++i) + + // As of OSX 10.6.7 ATI Apple's crash when using a variable size loop + for (int i = 0; i < MAX_LIGHT_COUNT; ++i) { + bool light_contrib = (i < light_count); + vec3 lv = light[i].xyz-pos; float dist2 = dot(lv,lv); dist2 /= light[i].w; if (dist2 > 1.0) { - continue; + light_contrib = false; } float da = dot(norm, lv); if (da < 0.0) { - continue; + light_contrib = false; } - - lv = normalize(lv); - da = dot(norm, lv); - - float fa = light_col[i].a+1.0; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - dist_atten *= noise; - - float lit = da * dist_atten; - vec3 col = light_col[i].rgb*lit*diff; - //vec3 col = vec3(dist2, light_col[i].a, lit); - - if (spec.a > 0.0) + if (light_contrib) { - //vec3 ref = dot(pos+lv, norm); + lv = normalize(lv); + da = dot(norm, lv); + + float fa = light_col[i].a+1.0; + float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + dist_atten *= noise; + + float lit = da * dist_atten; - float sa = dot(normalize(lv+npos),norm); + vec3 col = light_col[i].rgb*lit*diff; + //vec3 col = vec3(dist2, light_col[i].a, lit); - if (sa > 0.0) + if (spec.a > 0.0) { - sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*light_col[i].rgb*spec.rgb; + //vec3 ref = dot(pos+lv, norm); + + float sa = dot(normalize(lv+npos),norm); + + if (sa > 0.0) + { + sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa *= noise; + col += da*sa*light_col[i].rgb*spec.rgb; + } } + + out_col += col; } - - out_col += col; } if (dot(out_col, out_col) <= 0.0) diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index c075c660f3..e2b979d9e9 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -281,6 +281,9 @@ RenderVBOEnable 1 0 list TexUnit8orLess RenderDeferredSSAO 0 0 +list ATI +RenderDeferredSSAO 0 0 + list Intel RenderAnisotropic 1 0 RenderLocalLights 1 0 diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 524d2d74ef..b7aabe2aeb 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -753,7 +753,7 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("OpenGLPre30"); } - if (gGLManager.mNumTextureUnits <= 8) + if (gGLManager.mNumTextureImageUnits <= 8) { maskFeatures("TexUnit8orLess"); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f64eb89866..845a87b8cf 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -625,8 +625,14 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); addDeferredAttachments(mDeferredScreen); - mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); + mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); + +#if LL_DARWIN + // As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO + mEdgeMap.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); +#else mEdgeMap.allocate(resX, resY, GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); +#endif if (shadow_detail > 0 || ssao) { //only need mDeferredLight[0] for shadows OR ssao @@ -651,7 +657,12 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) mDeferredLight[2].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE); for (U32 i = 0; i < 2; i++) { +#if LL_DARWIN + // As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO + mGIMapPost[i].allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE); +#else mGIMapPost[i].allocate(resX,resY, GL_RGB, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE); +#endif } } else @@ -666,8 +677,12 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) F32 scale = gSavedSettings.getF32("RenderShadowResolutionScale"); +#if LL_DARWIN + U32 shadow_fmt = 0; +#else //HACK: make alpha masking work on ATI depth shadows (work around for ATI driver bug) U32 shadow_fmt = gGLManager.mIsATI ? GL_ALPHA : 0; +#endif if (shadow_detail > 0) { //allocate 4 sun shadow maps -- cgit v1.2.3 From 0b612741d53a044a0179e1c32018bf8cd4213631 Mon Sep 17 00:00:00 2001 From: prep linden Date: Fri, 20 May 2011 14:26:05 -0400 Subject: SH-1252 and SH-1253 WIP. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llaccountingquotamanager.cpp | 264 +++++++++++++++++++++++++++++ indra/newview/llaccountingquotamanager.h | 60 +++++++ indra/newview/llfloatertools.cpp | 1 + indra/newview/llviewerobject.cpp | 8 + indra/newview/llviewerobject.h | 9 +- indra/newview/llviewerobjectlist.cpp | 9 + indra/newview/llviewerobjectlist.h | 3 + indra/newview/llviewerregion.cpp | 6 + indra/newview/llviewerregion.h | 1 + 10 files changed, 362 insertions(+), 1 deletion(-) create mode 100644 indra/newview/llaccountingquotamanager.cpp create mode 100644 indra/newview/llaccountingquotamanager.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index cbf22b75e8..769dcf8457 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -77,6 +77,7 @@ include_directories( set(viewer_SOURCE_FILES groupchatlistener.cpp + llaccountingquotamanager.cpp llagent.cpp llagentaccess.cpp llagentcamera.cpp @@ -626,6 +627,7 @@ set(viewer_HEADER_FILES CMakeLists.txt ViewerInstall.cmake groupchatlistener.h + llaccountingquotamanager.h llagent.h llagentaccess.h llagentcamera.h diff --git a/indra/newview/llaccountingquotamanager.cpp b/indra/newview/llaccountingquotamanager.cpp new file mode 100644 index 0000000000..ada74ea44c --- /dev/null +++ b/indra/newview/llaccountingquotamanager.cpp @@ -0,0 +1,264 @@ +/** + * @file LLAccountingQuotaManager.cpp + * @ Handles the setting and accessing for costs associated with mesh + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llaccountingquotamanager.h" +#include "llagent.h" +#include "llviewerregion.h" +#include "llviewerobject.h" +#include "llviewerobjectlist.h" +#include "llviewerparcelmgr.h" +#include "llparcel.h" + +//=============================================================================== +LLAccountingQuotaManager::LLAccountingQuotaManager() +{ +} +//=============================================================================== +class LLAccountingQuotaResponder : public LLCurl::Responder +{ +public: + LLAccountingQuotaResponder( const LLSD& objectIDs ) + : mObjectIDs( objectIDs ) + { + } + + void clearPendingRequests ( void ) + { + for ( LLSD::array_iterator iter = mObjectIDs.beginArray(); iter != mObjectIDs.endArray(); ++iter ) + { + LLAccountingQuotaManager::getInstance()->removePendingObjectQuota( iter->asUUID() ); + } + } + + void error( U32 statusNum, const std::string& reason ) + { + llwarns << "Transport error "<asUUID(); + + LLAccountingQuotaManager::getInstance()->removePendingObjectQuota( objectID ); + + if ( containsParcel ) + { + //Typically should be one + S32 dataCount = content["parcel"].size(); + for(S32 i = 0; i < dataCount; i++) + { + //prep#todo verify that this is safe, otherwise just add a bool + S32 parcelId = 0; + S32 parcelOwner = 0; + if ( content["parcel"][i].has("parcel_id") ) + { + parcelId = content["parcel"][i]["parcel_id"].asInteger(); + } + if ( content["parcel"][i].has("parcel_owner") ) + { + parcelOwner = content["parcel"][i]["parcel_owner"].asInteger(); + } + + F32 ownerRenderCost = 0; + F32 ownerPhysicsCost = 0; + F32 ownerNetworkCost = 0; + F32 ownerSimulationCost = 0; + + F32 groupRenderCost = 0; + F32 groupPhysicsCost = 0; + F32 groupNetworkCost = 0; + F32 groupSimulationCost = 0; + + F32 otherRenderCost = 0; + F32 otherPhysicsCost = 0; + F32 otherNetworkCost = 0; + F32 otherSimulationCost = 0; + + F32 totalRenderCost = 0; + F32 totalPhysicsCost = 0; + F32 totalNetworkCost = 0; + F32 totalSimulationCost = 0; + + if ( content["parcel"][i].has("owner") ) + { + ownerRenderCost = content["parcel"][i]["owner"]["render"].asReal(); + ownerPhysicsCost = content["parcel"][i]["owner"]["physics"].asReal(); + ownerNetworkCost = content["parcel"][i]["owner"]["network"].asReal(); + ownerSimulationCost = content["parcel"][i]["owner"]["simulation"].asReal(); + + } + if ( content["parcel"][i].has("group") ) + { + groupRenderCost = content["parcel"][i]["group"]["render"].asReal(); + groupPhysicsCost = content["parcel"][i]["group"]["physics"].asReal(); + groupNetworkCost = content["parcel"][i]["group"]["network"].asReal(); + groupSimulationCost = content["parcel"][i]["group"]["simulation"].asReal(); + + } + if ( content["parcel"][i].has("other") ) + { + otherRenderCost = content["parcel"][i]["other"]["render"].asReal(); + otherPhysicsCost = content["parcel"][i]["other"]["physics"].asReal(); + otherNetworkCost = content["parcel"][i]["other"]["network"].asReal(); + otherSimulationCost = content["parcel"][i]["other"]["simulation"].asReal(); + } + + if ( content["parcel"][i].has("total") ) + { + totalRenderCost = content["parcel"][i]["total"]["render"].asReal(); + totalPhysicsCost = content["parcel"][i]["total"]["physics"].asReal(); + totalNetworkCost = content["parcel"][i]["total"]["network"].asReal(); + totalSimulationCost = content["parcel"][i]["total"]["simulation"].asReal(); + + } + + ParcelQuota parcelQuota( ownerRenderCost, ownerPhysicsCost, ownerNetworkCost, ownerSimulationCost, + groupRenderCost, groupPhysicsCost, groupNetworkCost, groupSimulationCost, + otherRenderCost, otherPhysicsCost, otherNetworkCost, otherSimulationCost, + totalRenderCost, totalPhysicsCost, totalNetworkCost, totalSimulationCost ); + //Update the Parcel + LLParcel* pParcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); + if ( pParcel ) + { + pParcel->updateQuota( objectID, parcelQuota ); + } + } + } + else + if ( containsSelection ) + { + S32 dataCount = content["selected"].size(); + for(S32 i = 0; i < dataCount; i++) + { + + F32 renderCost = 0; + F32 physicsCost = 0; + F32 networkCost = 0; + F32 simulationCost = 0; + + S32 localId = 0; + + localId = content["selected"][i]["local_id"].asInteger(); + renderCost = content["selected"][i]["render"].asReal(); + physicsCost = content["selected"][i]["physics"].asReal(); + networkCost = content["selected"][i]["network"].asReal(); + simulationCost = content["selected"][i]["simulation"].asReal(); + + SelectionQuota selectionQuota( localId, renderCost, physicsCost, networkCost, simulationCost ); + + //Update the objects + //gObjectList.updateQuota( localId, selectionQuota ); + + } + } + else + { + //Nothing in string + LLAccountingQuotaManager::getInstance()->removePendingObjectQuota( objectID ); + } + } + } + +private: + //List of posted objects + LLSD mObjectIDs; +}; +//=============================================================================== +void LLAccountingQuotaManager::fetchQuotas( const std::string& url ) +{ + // Invoking system must have already determined capability availability + if ( !url.empty() ) + { + LLSD objectList; + U32 objectIndex = 0; + IDIt IDIter = mUpdateObjectQuota.begin(); + IDIt IDIterEnd = mUpdateObjectQuota.end(); + + for ( ; IDIter != IDIterEnd; ++IDIter ) + { + // Check to see if a request for this object has already been made. + if ( mPendingObjectQuota.find( *IDIter ) == mPendingObjectQuota.end() ) + { + mPendingObjectQuota.insert( *IDIter ); + objectList[objectIndex++] = *IDIter; + } + } + + mUpdateObjectQuota.clear(); + + //Post results + if ( objectList.size() > 0 ) + { + LLSD dataToPost = LLSD::emptyMap(); + dataToPost["object_ids"] = objectList; + LLHTTPClient::post( url, dataToPost, new LLAccountingQuotaResponder( objectList )); + } + } + else + { + //url was empty - warn & continue + llwarns<<"Supplied url is empty "< +{ +public: + //Ctor + LLAccountingQuotaManager(); + //Store an object that will be eventually fetched + void updateObjectCost( const LLUUID& objectID ); + //Request quotas for object list + void fetchQuotas( const std::string& url ); + //Delete a specific object from the pending list + void removePendingObjectQuota( const LLUUID& objectID ); + +private: + //Set of objects that need to update their cost + std::set mUpdateObjectQuota; + //During fetchQuota we move object into a the pending set to signify that + //a fetch has been instigated. + std::set mPendingObjectQuota; + typedef std::set::iterator IDIt; +}; +//=============================================================================== + +#endif \ No newline at end of file diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 73c1f99fa0..061a42ab57 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -85,6 +85,7 @@ #include "llviewerwindow.h" #include "llvovolume.h" #include "lluictrlfactory.h" +#include "llaccountingquotamanager.h" // Globals LLFloaterTools *gFloaterTools = NULL; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f5fee662e6..e7878d8adf 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -102,6 +102,7 @@ #include "lltrans.h" #include "llsdutil.h" #include "llmediaentry.h" +#include "llaccountingquota.h" //#define DEBUG_UPDATE_TYPE @@ -5702,3 +5703,10 @@ public: LLHTTPRegistration gHTTPRegistrationObjectPhysicsProperties("/message/ObjectPhysicsProperties"); + + +void LLViewerObject::updateQuota( const SelectionQuota& quota ) +{ + //update quotas + mSelectionQuota = quota; +} diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 21198f7dd1..a0ad52df6b 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -43,6 +43,7 @@ #include "v3dmath.h" #include "v3math.h" #include "llvertexbuffer.h" +#include "llaccountingquota.h" class LLAgent; // TODO: Get rid of this. class LLAudioSource; @@ -643,7 +644,11 @@ protected: void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id); void deleteParticleSource(); void setParticleSource(const LLPartSysData& particle_parameters, const LLUUID& owner_id); - + +public: + void updateQuota( const SelectionQuota& quota ); + const SelectionQuota& getQuota( void ) { return mSelectionQuota; } + private: void setNameValueList(const std::string& list); // clears nv pairs and then individually adds \n separated NV pairs from \0 terminated string void deleteTEImages(); // correctly deletes list of images @@ -705,6 +710,8 @@ protected: F32 mPhysicsCost; F32 mLinksetPhysicsCost; + SelectionQuota mSelectionQuota; + bool mCostStale; mutable bool mPhysicsShapeUnknown; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index ab2e07e4df..007b3416f1 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1418,6 +1418,15 @@ void LLViewerObjectList::onObjectCostFetchFailure(const LLUUID& object_id) mPendingObjectCost.erase(object_id); } +void LLViewerObjectList::updateQuotaCost( const LLUUID& objectId, const SelectionQuota& quota ) +{ + LLViewerObject* pVO = findObject( objectId ); + if ( pVO ) + { + //pVO->updateQuota( quota ); + } +} + void LLViewerObjectList::updatePhysicsFlags(const LLViewerObject* object) { mStalePhysicsFlags.insert(object->getID()); diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 65374bca70..8e211eaf73 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -36,6 +36,7 @@ // project includes #include "llviewerobject.h" +#include "llaccountingquota.h" class LLCamera; class LLNetMap; @@ -101,6 +102,8 @@ public: F32 restitution, F32 gravity_multiplier); + void updateQuotaCost( const LLUUID& objectId, const SelectionQuota& costs ); + void shiftObjects(const LLVector3 &offset); bool hasMapObjectInRegion(LLViewerRegion* regionp) ; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f835351c04..590c82856d 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1545,6 +1545,11 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("ViewerMetrics"); capabilityNames.append("ViewerStartAuction"); capabilityNames.append("ViewerStats"); + //prep# Finalize these!!!!!!!!! + //capabilityNames.append("AccountingVO"); + capabilityNames.append("AccountingParcel"); + capabilityNames.append("AccountingRegion"); + // Please add new capabilities alphabetically to reduce // merge conflicts. @@ -1658,3 +1663,4 @@ std::string LLViewerRegion::getDescription() const { return stringize(*this); } + diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 9c5b85b77f..a6e5c47b86 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -275,6 +275,7 @@ public: F32 getLandHeightRegion(const LLVector3& region_pos); void getInfo(LLSD& info); + typedef enum { -- cgit v1.2.3 From a0af5e972a4c293cb8b2aff5d6d98baa7015f864 Mon Sep 17 00:00:00 2001 From: eli_linden Date: Wed, 25 May 2011 11:53:02 -0700 Subject: FIX VWR-25039 en_xui_change --- indra/newview/skins/default/xui/de/panel_group_notices.xml | 2 +- indra/newview/skins/default/xui/en/panel_group_notices.xml | 10 +++++----- indra/newview/skins/default/xui/it/panel_group_notices.xml | 9 +++------ indra/newview/skins/default/xui/nl/panel_group_notices.xml | 9 +++------ indra/newview/skins/default/xui/pl/panel_group_notices.xml | 2 +- indra/newview/skins/default/xui/pt/panel_group_notices.xml | 9 +++------ 6 files changed, 16 insertions(+), 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/de/panel_group_notices.xml b/indra/newview/skins/default/xui/de/panel_group_notices.xml index 8c1df04ed8..df423cc69a 100644 --- a/indra/newview/skins/default/xui/de/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/de/panel_group_notices.xml @@ -49,7 +49,7 @@ Maximal 200 pro Gruppe täglich Archivierte Mitteilung - Um eine neue Mitteilung zu senden, klicken Sie die Schaltfläche + + Um eine neue Mitteilung zu senden, klicken Sie die + Neue Mitteilung Betreff: diff --git a/indra/newview/skins/default/xui/en/panel_group_notices.xml b/indra/newview/skins/default/xui/en/panel_group_notices.xml index 600b0e3b71..607e1bb213 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notices.xml @@ -84,7 +84,7 @@ Maximum 200 per group daily name="create_new_notice" tool_tip="Create a new notice" top_delta="0" - width="93" /> + width="127" /> - - - - - - - - - Upload Model - - - - This wizard will help you import mesh models to Second Life. First specify a file containing the model you wish to import. Second Life supports COLLADA (.dae) files. - - - - Filename: - - - - - Model Preview: - - - - - - Dimensions (meters): - - - X: Y: Z: - - - | | - - - - - - Note: - - -Advanced users familiar with 3d content creation tools may prefer to use the [secondlife:///app/floater/upload_model Advanced Mesh Import Window] . - - - - - - - - - Optimize - - - - This wizard has optimized your model to improve performance. You may adjust the results of the optimization process bellow or click Next to continue. - - - Generating Level of Detail - - - Generate Level of Detail: High - - Generate Level of Detail: Medium - - Generate Level of Detail: Low - - Generate Level of Detail: Lowest - - - - Model Preview: - - - - High - - - Medium - - - Low - - - Lowest - - - - - Higher Performance - Faster rendering but less detailed; lowers Resource (prim) cost. - Higher Accuracy - More detailed model but slower; increases Resource (prim) cost. - - - ' - - - - - - Resource Cost: [COST] - - Dimensions (meters): - - - X: Y: Z: - - - | | - - - - - - - - - - - Physics - - - - The wizard will create a physical shape, which determines how the object interacts with other objects and avatars. Set the slider to the detail level most appropriate for how your object will be used: - - - Performance - Faster rendering but less detailed; lowers Resource (prim) cost. - Accuracy - More detailed model but slower; increases Resource (prim) cost. - - - ' ' ' ' ' ' ' ' ' ' ' - Recommended for solid objects - Recommended for buildings - Recommended for vehicles - - - - - Resource Cost: [COST] - - - - - - - - Physics - - - - Preview the physics shape below then click Next to continue. To modify the physics shape, click the Back button. - - - - Model Preview: - - - - High - - - Medium - - - Low - - - Lowest - - - - - - Dimensions (meters): - - - X: Y: Z: - - - | | - - - - - Resource Cost: [COST] - - - - - - - Review - - - - Review the details below then click. Upload to upload your model. Your L$ balance will be charged when you click Upload. - - - - - Model Preview: - - - - High - - - Medium - - - Low - - - Lowest - - - - - - Dimensions (meters): - - - X: Y: Z: - - - | | - - - - - - Resource Cost: [COST] - This is the cost to your Region's prim/object limit, at default scale - Physics Cost: [COST] - This is the cost to your Region's prim/object limit, at default scale - Upload Fee: - This is the amount the upload will cost. - - I confirm that I have the appropriate rights to the material contained in this model. [secondlife:///app/floater/learn_more Learn more] - - - - - - - - - Upload Complete! - - - - Congratulations! Your model has been sucessfully uploaded. You will find the model in the Objects folder in your inventory. - - - - - - - + + + + + + + + + Upload Model + + + + This wizard will help you import mesh models to Second Life. First specify a file containing the model you wish to import. Second Life supports COLLADA (.dae) files. + + + + Filename: + + + + + Model Preview: + + + + + + Dimensions (meters): + + + X: Y: Z: + + + | | + + + + + + Note: + + +Advanced users familiar with 3d content creation tools may prefer to use the [secondlife:///app/floater/upload_model Advanced Mesh Import Window] . + + + + + + + + + Optimize + + + + This wizard has optimized your model to improve performance. You may adjust the results of the optimization process bellow or click Next to continue. + + + Generating Level of Detail + + + Generate Level of Detail: High + + Generate Level of Detail: Medium + + Generate Level of Detail: Low + + Generate Level of Detail: Lowest + + + + Model Preview: + + + + High + + + Medium + + + Low + + + Lowest + + + + + Higher Performance + Faster rendering but less detailed; lowers Resource (prim) cost. + Higher Accuracy + More detailed model but slower; increases Resource (prim) cost. + + + ' + + + + + + Resource Cost: [COST] + + Dimensions (meters): + + + X: Y: Z: + + + | | + + + + + + + + + + + Physics + + + + The wizard will create a physical shape, which determines how the object interacts with other objects and avatars. Set the slider to the detail level most appropriate for how your object will be used: + + + Higher Performance + Faster rendering but less detailed; lowers Resource (prim) cost. + Higher Accuracy + More detailed model but slower; increases Resource (prim) cost. + + + ' ' ' ' ' ' ' ' ' ' ' + Recommended for solid objects + Recommended for buildings + Recommended for vehicles + + + + + Resource Cost: [COST] + + + + + + + + Physics + + + + Preview the physics shape below then click Next to continue. To modify the physics shape, click the Back button. + + + + Model Preview: + + + + High + + + Medium + + + Low + + + Lowest + + + + + + Dimensions (meters): + + + X: Y: Z: + + + | | + + + + + Resource Cost: [COST] + + + + + + + Review + + + + Review the details below then click. Upload to upload your model. Your L$ balance will be charged when you click Upload. + + + + + Model Preview: + + + + High + + + Medium + + + Low + + + Lowest + + + + + + Dimensions (meters): + + + X: Y: Z: + + + | | + + + + + + Resource Cost: [COST] + This is the cost to your Region's prim/object limit, at default scale + Physics Cost: [COST] + This is the cost to your Region's prim/object limit, at default scale + Upload Fee: + This is the amount the upload will cost. + + I confirm that I have the appropriate rights to the material contained in this model. [secondlife:///app/floater/learn_more Learn more] + + + + + + + + + Upload Complete! + + + + Congratulations! Your model has been sucessfully uploaded. You will find the model in the Objects folder in your inventory. + + + + + + + - - - - - - Drag to move, shift-drag to copy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - þ: [COUNT] - - - - Stretch Both Sides - - - - - - - - - - - - - Objects: [COUNT] - - - Prims: [COUNT] - - - Linked Sets: [COUNT] - - - Cost: [COST] / [PHYSICS] - - - Objects: [COUNT] - - - Cost: [COST] / [PHYSICS] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Deed - - - Deed - - - You can modify this object - - - You can modify these objects - - - You can't modify this object - - - You can't modify these objects - - - You must select entire object to set permissions - - - Price: L$ - - - Total Price: L$ - - - Price Per: L$ - - - Mixed Price - - - Mixed Sale - - - Name: - - - - Description: - - - - Creator: - - - - TestString PleaseIgnore (please.ignore) - - - Owner: - - - - TestString PleaseIgnore (please.ignore) - - - Group: - - - - - - - - + + + + + + Drag to move, shift-drag to copy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + þ: [COUNT] + + + + Stretch Both Sides + + + + + + + + + + + + + Objects: [COUNT] + + + Prims: [COUNT] + + + Linked Sets: [COUNT] + + + Cost: [COST] / [PHYSICS] + + + Objects: [COUNT] + + + Cost: [COST] / [PHYSICS] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Deed + + + Deed + + + You can modify this object + + + You can modify these objects + + + You can't modify this object + + + You can't modify these objects + + + You must select entire object to set permissions + + + Price: L$ + + + Total Price: L$ + + + Price Per: L$ + + + Mixed Price + + + Mixed Sale + + + Name: + + + + Description: + + + + Creator: + + + + TestString PleaseIgnore (please.ignore) + + + Owner: + + + + TestString PleaseIgnore (please.ignore) + + + Group: + + + + + + + +