From 2a6a783d6a219cc5d25fe230218b931fcd568586 Mon Sep 17 00:00:00 2001 From: CharleyLevenque Date: Wed, 1 Sep 2010 18:04:08 -0400 Subject: [PATCH] Show crosshair at build root, build pivoting, avatar offsets, improved Pose Stand --- indra/newview/llagent.cpp | 7 +- indra/newview/llmanip.cpp | 92 ++++++++++++++++++- indra/newview/llmanip.h | 12 +++ indra/newview/llviewermenu.cpp | 10 +- .../skins/default/xui/en-us/menu_viewer.xml | 7 ++ 5 files changed, 122 insertions(+), 6 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8411021a7..5dfd927c0 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -7429,7 +7429,12 @@ void LLAgent::sendAgentSetAppearance() // NOTE -- when we start correcting all of the other Havok geometry // to compensate for the COLLISION_TOLERANCE ugliness we will have // to tweak this number again - const LLVector3 body_size = mAvatarObject->mBodySize; + LLVector3 body_size = mAvatarObject->mBodySize; + + body_size.mV[VX] = body_size.mV[VX] + gSavedSettings.getF32("AscentAvatarXModifier"); + body_size.mV[VY] = body_size.mV[VY] + gSavedSettings.getF32("AscentAvatarYModifier"); + body_size.mV[VZ] = body_size.mV[VZ] + gSavedSettings.getF32("AscentAvatarZModifier"); + msg->addVector3Fast(_PREHASH_Size, body_size); // To guard against out of order packets diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 53c74aaec..501c4a9bf 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -69,7 +69,11 @@ S32 LLManip::sMaxTimesShowHelpText = 5; F32 LLManip::sGridMaxSubdivisionLevel = 32.f; F32 LLManip::sGridMinSubdivisionLevel = 1.f; LLVector2 LLManip::sTickLabelSpacing(60.f, 25.f); - +bool LLManip::sActualRoot = false;// going to set these up in the main entry +bool LLManip::sPivotPerc = false; +F32 LLManip::sPivotX = 0.f; +F32 LLManip::sPivotY = 0.f; +F32 LLManip::sPivotZ = 0.f; //static void LLManip::rebuild(LLViewerObject* vobj) @@ -100,6 +104,53 @@ LLManip::LLManip( const std::string& name, LLToolComposite* composite ) mHighlightedPart(LL_NO_PART), mManipPart(LL_NO_PART) { + initPivot(); + + gSavedSettings.getControl("AscentBuildPrefs_ActualRoot")->getSignal()->connect(boost::bind(&updateActualRoot)); + gSavedSettings.getControl("AscentBuildPrefs_PivotIsPercent")->getSignal()->connect(boost::bind(&updatePivotIsPercent)); + gSavedSettings.getControl("AscentBuildPrefs_PivotX")->getSignal()->connect(boost::bind(&updatePivotX)); + gSavedSettings.getControl("AscentBuildPrefs_PivotY")->getSignal()->connect(boost::bind(&updatePivotY)); + gSavedSettings.getControl("AscentBuildPrefs_PivotZ")->getSignal()->connect(boost::bind(&updatePivotZ)); +} +//static +void LLManip::initPivot() +{ + sActualRoot = (bool)gSavedSettings.getBOOL("AscentBuildPrefs_ActualRoot"); + sPivotPerc = (bool)gSavedSettings.getBOOL("AscentBuildPrefs_PivotIsPercent"); + sPivotX = gSavedSettings.getF32("AscentBuildPrefs_PivotX"); + sPivotY = gSavedSettings.getF32("AscentBuildPrefs_PivotY"); + sPivotZ = gSavedSettings.getF32("AscentBuildPrefs_PivotZ"); +} +//static +bool LLManip::updateActualRoot() +{ + //sActualRoot = (bool)data.asBoolean(); + sActualRoot = gSavedSettings.getBOOL("AscentBuildPrefs_ActualRoot"); + return true; +} +//static +bool LLManip::updatePivotIsPercent() +{ + sPivotPerc = gSavedSettings.getBOOL("AscentBuildPrefs_PivotIsPercent"); + return true; +} +//static +bool LLManip::updatePivotX() +{ + sPivotX = gSavedSettings.getF32("AscentBuildPrefs_PivotX"); + return true; +} +//static +bool LLManip::updatePivotY() +{ + sPivotY = gSavedSettings.getF32("AscentBuildPrefs_PivotY"); + return true; +} +//static +bool LLManip::updatePivotZ() +{ + sPivotZ = gSavedSettings.getF32("AscentBuildPrefs_PivotZ"); + return true; } void LLManip::getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal) @@ -351,14 +402,47 @@ LLVector3 LLManip::getSavedPivotPoint() const LLVector3 LLManip::getPivotPoint() { - if (mObjectSelection->getFirstObject() && mObjectSelection->getObjectCount() == 1 && mObjectSelection->getSelectType() != SELECT_TYPE_HUD) + LLVector3 pos; + LLVector3 scale; + LLQuaternion rot;// = mObjectSelection->getFirstObject()->getRotation(); + if (mObjectSelection->getFirstRootObject(TRUE) && (mObjectSelection->getObjectCount() == 1 || sActualRoot) && mObjectSelection->getSelectType() != SELECT_TYPE_HUD) { - return mObjectSelection->getFirstObject()->getPivotPositionAgent(); + pos = mObjectSelection->getFirstRootObject(TRUE)->getPivotPositionAgent(); + scale = mObjectSelection->getFirstRootObject(TRUE)->getScale(); + rot = mObjectSelection->getFirstRootObject(TRUE)->getRotation(); + }else + { + pos = LLSelectMgr::getInstance()->getBBoxOfSelection().getCenterAgent(); + scale = LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal(); + rot = LLSelectMgr::getInstance()->getBBoxOfSelection().getRotation(); } - return LLSelectMgr::getInstance()->getBBoxOfSelection().getCenterAgent(); + if(sPivotPerc) + { + + LLVector3 add( + (-scale[VX]*0.5) + (scale[VX]*(sPivotX*0.01)), + (-scale[VY]*0.5) + (scale[VY]*(sPivotY*0.01)), + (-scale[VZ]*0.5) + (scale[VZ]*(sPivotZ*0.01))); + add = add * rot; + pos = pos + add; + }else + { + //pos[VX] = pos[VX] + gSavedSettings.getF32("EmeraldBuildPrefs_PivotX"); + //pos[VY] = pos[VY] + gSavedSettings.getF32("EmeraldBuildPrefs_PivotY"); + //pos[VZ] = pos[VZ] + gSavedSettings.getF32("EmeraldBuildPrefs_PivotZ"); + LLVector3 add( + sPivotX, + sPivotY, + sPivotZ); + add = add * rot; + pos = pos + add; + } + //pos = pos * rot; + return pos; } + void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) { LLVector3 grid_origin; diff --git a/indra/newview/llmanip.h b/indra/newview/llmanip.h index cdf6a3657..9577412ed 100644 --- a/indra/newview/llmanip.h +++ b/indra/newview/llmanip.h @@ -151,6 +151,13 @@ protected: BOOL getMousePointOnPlaneAgent(LLVector3& point, S32 x, S32 y, LLVector3 origin, LLVector3 normal); BOOL nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, const LLVector3& b2, F32 &a_param, F32 &b_param ); LLColor4 setupSnapGuideRenderPass(S32 pass); +private: + static void initPivot(); + static bool updateActualRoot(); + static bool updatePivotIsPercent(); + static bool updatePivotX(); + static bool updatePivotY(); + static bool updatePivotZ(); protected: LLFrameTimer mHelpTextTimer; BOOL mInSnapRegime; @@ -165,6 +172,11 @@ protected: static F32 sGridMaxSubdivisionLevel; static F32 sGridMinSubdivisionLevel; static LLVector2 sTickLabelSpacing; + static bool sActualRoot; + static bool sPivotPerc; + static F32 sPivotX; + static F32 sPivotY; + static F32 sPivotZ; }; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index deeb78f6e..8cdbb9ef6 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3442,42 +3442,49 @@ void handle_close_all_notifications(void*) // this code, please supply your own animations. void handle_pose_stand_ltao(void*) { + gSavedSettings.setF32("AscentAvatarZModifier", 5.0); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose.set("6c082c7b-f70e-9da0-0451-54793f869ff4"); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_START); } void handle_pose_stand_ltah(void*) { + gSavedSettings.setF32("AscentAvatarZModifier", 5.0); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose.set("45e59c14-913b-c58c-2a55-c0a5c1eeef53"); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_START); } void handle_pose_stand_ltad(void*) { + gSavedSettings.setF32("AscentAvatarZModifier", 5.0); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose.set("421d6bb4-94a9-3c42-4593-f2bc1f6a26e6"); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_START); } void handle_pose_stand_loau(void*) { + gSavedSettings.setF32("AscentAvatarZModifier", 5.0); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose.set("8b3bb239-d610-1c0f-4d1a-69d29bc17e2c"); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_START); } void handle_pose_stand_loao(void*) { + gSavedSettings.setF32("AscentAvatarZModifier", 5.0); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose.set("4d70e328-48b6-dc6a-0be1-85dd6b333e81"); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_START); } void handle_pose_stand_lhao(void*) { + gSavedSettings.setF32("AscentAvatarZModifier", 5.0); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose.set("f088eaf0-f1c9-8cf1-99c8-09df96bb13ae"); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_START); } void handle_pose_stand_stop(void*) { + gSavedSettings.setF32("AscentAvatarZModifier", 0.0); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose = LLUUID::null; } @@ -9744,7 +9751,8 @@ void initialize_menus() // addMenu(new LLToolsSaveToObjectInventory(), "Tools.SaveToObjectInventory"); addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction"); - + addMenu(new LLScriptDelete(), "Tools.ScriptDelete"); + addMenu(new LLObjectEnableScriptDelete(), "Tools.EnableScriptDelete"); addMenu(new LLToolsEnableToolNotPie(), "Tools.EnableToolNotPie"); addMenu(new LLToolsEnableSelectNextPart(), "Tools.EnableSelectNextPart"); addMenu(new LLToolsEnableLink(), "Tools.EnableLink"); diff --git a/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/indra/newview/skins/default/xui/en-us/menu_viewer.xml index db62c1684..7e659d6ef 100644 --- a/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -874,6 +874,13 @@ + + + +