diff options
-rw-r--r-- | indra/newview/llpanelobject.cpp | 36 | ||||
-rw-r--r-- | indra/newview/llpanelobject.h | 22 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llselectmgr.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_tools.xml | 18 | ||||
-rw-r--r-- | scripts/messages/message_template.msg | 2 |
8 files changed, 62 insertions, 63 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 991e97b767..669ff3ffd6 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -138,9 +138,9 @@ BOOL LLPanelObject::postBuild() mCheckPhantom = getChild<LLCheckBoxCtrl>("Phantom Checkbox Ctrl"); childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); - // PhysicsRep combobox - mComboPhysicsRep = getChild<LLComboBox>("Physics Rep Combo Ctrl"); - childSetCommitCallback("Physics Rep Combo Ctrl", onCommitPhysicsRep,this); + // PhysicsShapeType combobox + mComboPhysicsShapeType = getChild<LLComboBox>("Physics Shape Type Combo Ctrl"); + childSetCommitCallback("Physics Shape Type Combo Ctrl", onCommitPhysicsShapeType,this); // Position mLabelPosition = getChild<LLTextBox>("label position"); @@ -324,7 +324,7 @@ LLPanelObject::LLPanelObject() mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), - mPhysicsRep(0), + mPhysicsShapeType(0), mCastShadows(TRUE), mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), @@ -532,9 +532,9 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); - mPhysicsRep = objectp->getPhysicsRep(); - mComboPhysicsRep->setCurrentByIndex(mPhysicsRep); - mComboPhysicsRep->setEnabled(editable); + mPhysicsShapeType = objectp->getPhysicsShapeType(); + mComboPhysicsShapeType->setCurrentByIndex(mPhysicsShapeType); + mComboPhysicsShapeType->setEnabled(editable); #if 0 // 1.9.2 mCastShadows = root_objectp->flagCastShadows(); @@ -1241,19 +1241,19 @@ void LLPanelObject::sendIsPhantom() } } -void LLPanelObject::sendPhysicsRep() +void LLPanelObject::sendPhysicsShapeType() { - U8 value = (U8)mComboPhysicsRep->getCurrentIndex(); - if (mPhysicsRep != value) + U8 value = (U8)mComboPhysicsShapeType->getCurrentIndex(); + if (mPhysicsShapeType != value) { - LLSelectMgr::getInstance()->selectionUpdatePhysicsRep(value); - mPhysicsRep = value; + LLSelectMgr::getInstance()->selectionUpdatePhysicsShapeType(value); + mPhysicsShapeType = value; - llinfos << "update physicsrep sent" << llendl; + llinfos << "update physics shape type sent" << llendl; } else { - llinfos << "update physicstep not changed" << llendl; + llinfos << "update physics shape type not changed" << llendl; } } @@ -1930,8 +1930,8 @@ void LLPanelObject::clearCtrls() mCheckTemporary ->setEnabled( FALSE ); mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); - mComboPhysicsRep->setCurrentByIndex(0); - mComboPhysicsRep->setEnabled(FALSE); + mComboPhysicsShapeType->setCurrentByIndex(0); + mComboPhysicsShapeType->setEnabled(FALSE); #if 0 // 1.9.2 mCheckCastShadows->set(FALSE); mCheckCastShadows->setEnabled( FALSE ); @@ -2027,10 +2027,10 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata ) } // static -void LLPanelObject::onCommitPhysicsRep(LLUICtrl* ctrl, void* userdata ) +void LLPanelObject::onCommitPhysicsShapeType(LLUICtrl* ctrl, void* userdata ) { LLPanelObject* self = (LLPanelObject*) userdata; - self->sendPhysicsRep(); + self->sendPhysicsShapeType(); } // static diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index fbc0902141..7f368c38c7 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -65,14 +65,14 @@ public: static bool precommitValidate(const LLSD& data); static void onCommitLock(LLUICtrl *ctrl, void *data); - static void onCommitPosition( LLUICtrl* ctrl, void* userdata); - static void onCommitScale( LLUICtrl* ctrl, void* userdata); - static void onCommitRotation( LLUICtrl* ctrl, void* userdata); - static void onCommitPhysics( LLUICtrl* ctrl, void* userdata); - static void onCommitTemporary( LLUICtrl* ctrl, void* userdata); - static void onCommitPhantom( LLUICtrl* ctrl, void* userdata); - static void onCommitPhysicsRep( LLUICtrl* ctrl, void* userdata); - static void onCommitCastShadows( LLUICtrl* ctrl, void* userdata); + static void onCommitPosition( LLUICtrl* ctrl, void* userdata); + static void onCommitScale( LLUICtrl* ctrl, void* userdata); + static void onCommitRotation( LLUICtrl* ctrl, void* userdata); + static void onCommitPhysics( LLUICtrl* ctrl, void* userdata); + static void onCommitTemporary( LLUICtrl* ctrl, void* userdata); + static void onCommitPhantom( LLUICtrl* ctrl, void* userdata); + static void onCommitPhysicsShapeType( LLUICtrl* ctrl, void* userdata); + static void onCommitCastShadows( LLUICtrl* ctrl, void* userdata); static void onCommitParametric(LLUICtrl* ctrl, void* userdata); @@ -94,7 +94,7 @@ protected: void sendIsPhysical(); void sendIsTemporary(); void sendIsPhantom(); - void sendPhysicsRep(); + void sendPhysicsShapeType(); void sendCastShadows(); void sendSculpt(); @@ -167,7 +167,7 @@ protected: LLCheckBoxCtrl *mCheckPhysics; LLCheckBoxCtrl *mCheckTemporary; LLCheckBoxCtrl *mCheckPhantom; - LLComboBox *mComboPhysicsRep; + LLComboBox *mComboPhysicsShapeType; LLCheckBoxCtrl *mCheckCastShadows; LLTextureCtrl *mCtrlSculptTexture; @@ -180,7 +180,7 @@ protected: BOOL mIsPhysical; // to avoid sending "physical" when not changed BOOL mIsTemporary; // to avoid sending "temporary" when not changed BOOL mIsPhantom; // to avoid sending "phantom" when not changed - U8 mPhysicsRep; // to avoid sending "physics rep spec" when not changed + U8 mPhysicsShapeType; // to avoid sending "physics shape type" when not changed BOOL mCastShadows; // to avoid sending "cast shadows" when not changed S32 mSelectedType; // So we know what selected type we last were diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9d1893b68a..89fb6bf4df 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3930,15 +3930,15 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } -struct LLSelectMgrApplyPhysicsRep : public LLSelectedObjectFunctor +struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor { - LLSelectMgrApplyPhysicsRep(U8 value) : mValue(value) {} + LLSelectMgrApplyPhysicsShapeType(U8 value) : mValue(value) {} U8 mValue; virtual bool apply(LLViewerObject* object) { if ( object->permModify() ) // preemptive permissions check { - object->setPhysicsRep( mValue ); + object->setPhysicsShapeType( mValue ); object->updateFlags(); } return true; @@ -3946,10 +3946,10 @@ struct LLSelectMgrApplyPhysicsRep : public LLSelectedObjectFunctor }; -void LLSelectMgr::selectionUpdatePhysicsRep(U8 rep) +void LLSelectMgr::selectionUpdatePhysicsShapeType(U8 type) { - llwarns << "physics rep ->" << (U32)rep << llendl; - LLSelectMgrApplyPhysicsRep func(rep); + llwarns << "physics shape type ->" << (U32)type << llendl; + LLSelectMgrApplyPhysicsShapeType func(type); getSelection()->applyToObjects(&func); } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index f14136c275..7db0adb31e 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -484,7 +484,7 @@ public: void selectionUpdatePhysics(BOOL use_physics); void selectionUpdateTemporary(BOOL is_temporary); void selectionUpdatePhantom(BOOL is_ghost); - void selectionUpdatePhysicsRep(U8 rep); + void selectionUpdatePhysicsShapeType(U8 type); void selectionUpdateCastShadows(BOOL cast_shadows); void selectionDump(); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1ee30b49bf..fb48f3311b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -52,6 +52,7 @@ #include "llprimitive.h" #include "llquantize.h" #include "llregionhandle.h" +#include "llsdserialize.h" #include "lltree_common.h" #include "llxfermanager.h" #include "message.h" @@ -189,7 +190,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mGLName(0), mbCanSelect(TRUE), mFlags(0), - mPhysicsRep(0), + mPhysicsShapeType(0), mDrawable(), mCreateSelected(FALSE), mRenderMedia(FALSE), @@ -4954,10 +4955,10 @@ void LLViewerObject::updateFlags() gMessageSystem->addBOOL("IsPhantom", flagPhantom() ); gMessageSystem->addBOOL("CastsShadows", flagCastShadows() ); gMessageSystem->nextBlock("ExtraPhysics"); - gMessageSystem->addU8("PhysicsRep", getPhysicsRep() ); + gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() ); gMessageSystem->sendReliable( regionp->getHost() ); - if (getPhysicsRep() != 0) + if (getPhysicsShapeType() != 0) { llwarns << "sent non default physics rep" << llendl; } @@ -4992,9 +4993,9 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state) return setit; } -void LLViewerObject::setPhysicsRep(U8 rep) +void LLViewerObject::setPhysicsShapeType(U8 type) { - mPhysicsRep = rep; + mPhysicsShapeType = type; updateFlags(); } @@ -5208,7 +5209,7 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif return ; } -#include "../llcommon/llsdserialize.h" + class ObjectPhysicsProperties : public LLHTTPNode { public: @@ -5222,11 +5223,8 @@ public: for ( S32 i = 0; i < numEntries; i++ ) { - U32 localID = objectData[i]["LocalID"].asInteger(); - - std::ostringstream string; - LLSDSerialize::serialize( input, string, LLSDSerialize::LLSD_XML, LLSDFormatter::OPTIONS_PRETTY); - llinfos << string.str() << llendl; + LLSD& currObjectData = objectData[i]; + U32 localID = currObjectData["LocalID"].asInteger(); // Iterate through nodes at end, since it can be on both the regular AND hover list
struct f : public LLSelectedNodeFunctor
@@ -5241,11 +5239,12 @@ public: LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func); - U8 physicsRepSpec = (U8)objectData[i]["PhysicsRepSpec"].asInteger(); - if (node) { - node->getObject()->setPhysicsRep(physicsRepSpec); + // The LLSD message builder doesn't know how to handle U8, so we need to send as S8 and cast + U8 physicsShapeType = (U8)currObjectData["PhysicsShapeType"].asInteger(); + + node->getObject()->setPhysicsShapeType(physicsShapeType); } } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index da7e4002f5..8b542af773 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -460,7 +460,7 @@ public: inline BOOL flagCameraDecoupled() const { return ((mFlags & FLAGS_CAMERA_DECOUPLED) != 0); } inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); } - inline U8 getPhysicsRep() const { return mPhysicsRep; } + inline U8 getPhysicsShapeType() const { return mPhysicsShapeType; } bool getIncludeInSearch() const; void setIncludeInSearch(bool include_in_search); @@ -477,7 +477,7 @@ public: void updateFlags(); BOOL setFlags(U32 flag, BOOL state); - void setPhysicsRep(U8 rep); + void setPhysicsShapeType(U8 type); virtual void dump() const; static U32 getNumZombieObjects() { return sNumZombieObjects; } @@ -558,7 +558,7 @@ public: U32 mFlags; // Sent to sim in UPDATE_FLAGS, received in ObjectPhysicsProperties - U8 mPhysicsRep; + U8 mPhysicsShapeType; // Pipeline classes LLPointer<LLDrawable> mDrawable; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 26c08bdf7c..fd6a5127d8 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1426,7 +1426,7 @@ even though the user gets a free copy. height="10" layout="topleft" left_delta="0" - name="label physicsrep" + name="label physicsshapetype" top_pad="10" width="121"> Physics Rep: @@ -1435,18 +1435,18 @@ even though the user gets a free copy. height="23" layout="topleft" follows="left|top" - name="Physics Rep Combo Ctrl" - tool_tip="Choose the physics representation" + name="Physics Shape Type Combo Ctrl" + tool_tip="Choose the physics shape type" left_pad="0" width="108"> <combo_box.item - label="Default" - name="Default" - value="Default" /> + label="Prim" + name="Prim" + value="Prim" /> <combo_box.item - label="No Shape" - name="No Shape" - value="No Shape" /> + label="None" + name="None" + value="None" /> <combo_box.item label="Convex Hull" name="Convex Hull" diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index 7813bfba83..6043542877 100644 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -2063,7 +2063,7 @@ version 2.0 } { ExtraPhysics Variable - { PhysicsRep U8 } + { PhysicsShapeType U8 } } } |