diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/CMakeLists.txt | 6 | ||||
-rw-r--r-- | indra/newview/llpanelobject.cpp | 67 | ||||
-rw-r--r-- | indra/newview/llpanelobject.h | 14 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 30 | ||||
-rw-r--r-- | indra/newview/llselectmgr.h | 3 | ||||
-rw-r--r-- | indra/newview/llspatialpartition.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 55 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_tools.xml | 78 | ||||
-rwxr-xr-x | indra/newview/viewer_manifest.py | 4 |
10 files changed, 225 insertions, 49 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f0b58b385c..45291e60f9 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -16,7 +16,7 @@ include(FindOpenGL) include(LLAudio) include(LLCharacter) include(LLCommon) -include(LLConvexDecompInter) +include(LLConvexDecomposition) include(LLImage) include(LLImageJ2COJ) include(LLInventory) @@ -50,7 +50,7 @@ include_directories( ${LLAUDIO_INCLUDE_DIRS} ${LLCHARACTER_INCLUDE_DIRS} ${LLCOMMON_INCLUDE_DIRS} - ${LLCONVEXDECOMPINTER_INCLUDE_DIRS} + ${LLCONVEXDECOMP_INCLUDE_DIRS} ${LLIMAGE_INCLUDE_DIRS} ${LLINVENTORY_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS} @@ -1682,7 +1682,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${CRYPTO_LIBRARIES} ${LLLOGIN_LIBRARIES} ${GOOGLE_PERFTOOLS_LIBRARIES} - ${LLCONVEXDECOMPINTER_LIBRARIES} + ${LLCONVEXDECOMP_LIBRARY} ) build_version(viewer) diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 77f3984ecb..55e73731c1 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -140,7 +140,24 @@ BOOL LLPanelObject::postBuild() // PhysicsShapeType combobox mComboPhysicsShapeType = getChild<LLComboBox>("Physics Shape Type Combo Ctrl"); - childSetCommitCallback("Physics Shape Type Combo Ctrl", onCommitPhysicsShapeType,this); + childSetCommitCallback("Physics Shape Type Combo Ctrl", onCommitPhysicsParam, this); + + // PhysicsGravity + mSpinPhysicsGravity = getChild<LLSpinCtrl>("Physics Gravity"); + childSetCommitCallback("Physics Gravity", onCommitPhysicsParam, this); + + // PhysicsFriction + mSpinPhysicsFriction = getChild<LLSpinCtrl>("Physics Friction"); + childSetCommitCallback("Physics Friction", onCommitPhysicsParam, this); + + // PhysicsDensity + mSpinPhysicsDensity = getChild<LLSpinCtrl>("Physics Density"); + childSetCommitCallback("Physics Density", onCommitPhysicsParam, this); + + // PhysicsRestitution + mSpinPhysicsRestitution = getChild<LLSpinCtrl>("Physics Restitution"); + childSetCommitCallback("Physics Restitution", onCommitPhysicsParam, this); + // Position mLabelPosition = getChild<LLTextBox>("label position"); @@ -324,7 +341,6 @@ LLPanelObject::LLPanelObject() mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), - mPhysicsShapeType(0), mCastShadows(TRUE), mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), @@ -532,9 +548,20 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); - mPhysicsShapeType = objectp->getPhysicsShapeType(); - mComboPhysicsShapeType->setCurrentByIndex(mPhysicsShapeType); + mComboPhysicsShapeType->setCurrentByIndex(objectp->getPhysicsShapeType()); mComboPhysicsShapeType->setEnabled(editable); + + mSpinPhysicsGravity->set(objectp->getPhysicsGravity()); + mSpinPhysicsGravity->setEnabled(editable); + + mSpinPhysicsFriction->set(objectp->getPhysicsFriction()); + mSpinPhysicsFriction->setEnabled(editable); + + mSpinPhysicsDensity->set(objectp->getPhysicsDensity()); + mSpinPhysicsDensity->setEnabled(editable); + + mSpinPhysicsRestitution->set(objectp->getPhysicsRestitution()); + mSpinPhysicsRestitution->setEnabled(editable); #if 0 // 1.9.2 mCastShadows = root_objectp->flagCastShadows(); @@ -1251,20 +1278,16 @@ public: U32 mID; }; -void LLPanelObject::sendPhysicsShapeType() +void LLPanelObject::sendPhysicsParam() { - U8 value = (U8)mComboPhysicsShapeType->getCurrentIndex(); - if (mPhysicsShapeType != value) - { - LLSelectMgr::getInstance()->selectionUpdatePhysicsShapeType(value); - mPhysicsShapeType = value; - - llinfos << "update physics shape type sent" << llendl; - } - else - { - llinfos << "update physics shape type not changed" << llendl; - } + U8 type = (U8)mComboPhysicsShapeType->getCurrentIndex(); + F32 gravity = mSpinPhysicsGravity->get(); + F32 friction = mSpinPhysicsFriction->get(); + F32 density = mSpinPhysicsDensity->get(); + F32 restitution = mSpinPhysicsRestitution->get(); + + LLSelectMgr::getInstance()->selectionUpdatePhysicsParam(type, gravity, friction, + density, restitution); std::string url = gAgent.getRegion()->getCapability("GetObjectCost"); LLSD body = LLSD::emptyArray(); @@ -1947,8 +1970,14 @@ void LLPanelObject::clearCtrls() mCheckTemporary ->setEnabled( FALSE ); mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); + mComboPhysicsShapeType->setCurrentByIndex(0); mComboPhysicsShapeType->setEnabled(FALSE); + mSpinPhysicsGravity->setEnabled(FALSE); + mSpinPhysicsFriction->setEnabled(FALSE); + mSpinPhysicsDensity->setEnabled(FALSE); + mSpinPhysicsRestitution->setEnabled(FALSE); + #if 0 // 1.9.2 mCheckCastShadows->set(FALSE); mCheckCastShadows->setEnabled( FALSE ); @@ -2044,10 +2073,10 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata ) } // static -void LLPanelObject::onCommitPhysicsShapeType(LLUICtrl* ctrl, void* userdata ) +void LLPanelObject::onCommitPhysicsParam(LLUICtrl* ctrl, void* userdata ) { LLPanelObject* self = (LLPanelObject*) userdata; - self->sendPhysicsShapeType(); + self->sendPhysicsParam(); } // static diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 7f368c38c7..ca6316f54e 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -71,7 +71,7 @@ public: 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 onCommitPhysicsParam( 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 sendPhysicsShapeType(); + void sendPhysicsParam(); void sendCastShadows(); void sendSculpt(); @@ -167,9 +167,14 @@ protected: LLCheckBoxCtrl *mCheckPhysics; LLCheckBoxCtrl *mCheckTemporary; LLCheckBoxCtrl *mCheckPhantom; - LLComboBox *mComboPhysicsShapeType; LLCheckBoxCtrl *mCheckCastShadows; - + + LLComboBox* mComboPhysicsShapeType; + LLSpinCtrl* mSpinPhysicsGravity; + LLSpinCtrl* mSpinPhysicsFriction; + LLSpinCtrl* mSpinPhysicsDensity; + LLSpinCtrl* mSpinPhysicsRestitution; + LLTextureCtrl *mCtrlSculptTexture; LLTextBox *mLabelSculptType; LLComboBox *mCtrlSculptType; @@ -180,7 +185,6 @@ 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 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 559c802f51..c11a6f289b 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3937,15 +3937,30 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } -struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor -{ - LLSelectMgrApplyPhysicsShapeType(U8 value) : mValue(value) {} - U8 mValue; +struct LLSelectMgrApplyPhysicsParam : public LLSelectedObjectFunctor +{ + LLSelectMgrApplyPhysicsParam(U8 type, F32 gravity, F32 friction, + F32 density, F32 restitution) : + mType(type), + mGravity(gravity), + mFriction(friction), + mDensity(density), + mRestitution(restitution) + {} + U8 mType; + F32 mGravity; + F32 mFriction; + F32 mDensity; + F32 mRestitution; virtual bool apply(LLViewerObject* object) { if ( object->permModify() ) // preemptive permissions check { - object->setPhysicsShapeType( mValue ); + object->setPhysicsShapeType( mType ); + object->setPhysicsGravity(mGravity); + object->setPhysicsFriction(mFriction); + object->setPhysicsDensity(mDensity); + object->setPhysicsRestitution(mRestitution); object->updateFlags(); } return true; @@ -3953,10 +3968,11 @@ struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor }; -void LLSelectMgr::selectionUpdatePhysicsShapeType(U8 type) +void LLSelectMgr::selectionUpdatePhysicsParam(U8 type, F32 gravity, F32 friction, + F32 density, F32 restitution) { llwarns << "physics shape type ->" << (U32)type << llendl; - LLSelectMgrApplyPhysicsShapeType func(type); + LLSelectMgrApplyPhysicsParam func(type, gravity, friction, density, restitution); getSelection()->applyToObjects(&func); } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 5302cfae68..54b9b39a8e 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -485,9 +485,10 @@ public: void saveSelectedObjectTextures(); void selectionUpdatePhysics(BOOL use_physics); + void selectionUpdatePhysicsParam(U8 type, F32 gravity, F32 friction, + F32 density, F32 restitution); void selectionUpdateTemporary(BOOL is_temporary); void selectionUpdatePhantom(BOOL is_ghost); - void selectionUpdatePhysicsShapeType(U8 type); void selectionUpdateCastShadows(BOOL cast_shadows); void selectionDump(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index dc193dc600..9951cf0193 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2791,6 +2791,7 @@ void renderPhysicsShape(LLDrawable* drawable) U32 data_mask = LLVertexBuffer::MAP_VERTEX; +#if LL_MESH_ENABLED if (volume->isMesh()) { LLUUID mesh_id = volume->getVolume()->getParams().getSculptID(); @@ -2827,7 +2828,8 @@ void renderPhysicsShape(LLDrawable* drawable) return; } } - +#endif //LL_MESH_ENABLED + //push faces glColor3fv(color.mV); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 03e524268d..80d645ca80 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -201,6 +201,10 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mbCanSelect(TRUE), mFlags(0), mPhysicsShapeType(0), + mPhysicsGravity(0), + mPhysicsFriction(0), + mPhysicsDensity(0), + mPhysicsRestitution(0), mDrawable(), mCreateSelected(FALSE), mRenderMedia(FALSE), @@ -5022,6 +5026,10 @@ void LLViewerObject::updateFlags() 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() ); gMessageSystem->sendReliable( regionp->getHost() ); if (getPhysicsShapeType() != 0) @@ -5062,7 +5070,26 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state) void LLViewerObject::setPhysicsShapeType(U8 type) { mPhysicsShapeType = type; - updateFlags(); +} + +void LLViewerObject::setPhysicsGravity(F32 gravity) +{ + mPhysicsGravity = gravity; +} + +void LLViewerObject::setPhysicsFriction(F32 friction) +{ + mPhysicsFriction = friction; +} + +void LLViewerObject::setPhysicsDensity(F32 density) +{ + mPhysicsDensity = density; +} + +void LLViewerObject::setPhysicsRestitution(F32 restitution) +{ + mPhysicsRestitution = restitution; } void LLViewerObject::applyAngularVelocity(F32 dt) @@ -5303,13 +5330,13 @@ public: const LLSD& context, const LLSD& input) const { - LLSD objectData = input["body"]["ObjectData"]; - S32 numEntries = objectData.size(); + LLSD object_data = input["body"]["ObjectData"]; + S32 num_entries = object_data.size(); - for ( S32 i = 0; i < numEntries; i++ ) + for ( S32 i = 0; i < num_entries; i++ ) { - LLSD& currObjectData = objectData[i]; - U32 localID = currObjectData["LocalID"].asInteger(); + LLSD& curr_object_data = object_data[i]; + U32 local_id = curr_object_data["LocalID"].asInteger(); // Iterate through nodes at end, since it can be on both the regular AND hover list struct f : public LLSelectedNodeFunctor @@ -5320,16 +5347,24 @@ public: { return (node->getObject() && node->getObject()->mLocalID == mID ); } - } func(localID); + } func(local_id); LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func); if (node) { // 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); + U8 type = (U8)curr_object_data["PhysicsShapeType"].asInteger(); + F32 density = (F32)curr_object_data["Density"].asReal(); + F32 friction = (F32)curr_object_data["Friction"].asReal(); + F32 restitution = (F32)curr_object_data["Restitution"].asReal(); + F32 gravity = (F32)curr_object_data["GravityMultiplier"].asReal(); + + node->getObject()->setPhysicsShapeType(type); + node->getObject()->setPhysicsGravity(gravity); + node->getObject()->setPhysicsFriction(friction); + node->getObject()->setPhysicsDensity(density); + node->getObject()->setPhysicsRestitution(restitution); } } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 092d8fdc82..70bc916acb 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -468,6 +468,10 @@ public: inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); } inline U8 getPhysicsShapeType() const { return mPhysicsShapeType; } + inline F32 getPhysicsGravity() const { return mPhysicsGravity; } + inline F32 getPhysicsFriction() const { return mPhysicsFriction; } + inline F32 getPhysicsDensity() const { return mPhysicsDensity; } + inline F32 getPhysicsRestitution() const { return mPhysicsRestitution; } bool getIncludeInSearch() const; void setIncludeInSearch(bool include_in_search); @@ -485,6 +489,10 @@ public: void updateFlags(); BOOL setFlags(U32 flag, BOOL state); void setPhysicsShapeType(U8 type); + void setPhysicsGravity(F32 gravity); + void setPhysicsFriction(F32 friction); + void setPhysicsDensity(F32 density); + void setPhysicsRestitution(F32 restitution); virtual void dump() const; static U32 getNumZombieObjects() { return sNumZombieObjects; } @@ -566,6 +574,11 @@ public: // Sent to sim in UPDATE_FLAGS, received in ObjectPhysicsProperties U8 mPhysicsShapeType; + F32 mPhysicsGravity; + F32 mPhysicsFriction; + F32 mPhysicsDensity; + F32 mPhysicsRestitution; + // 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 b83ac3282b..808ba22dbb 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2,7 +2,7 @@ <floater legacy_header_height="18" follows="left|top|right" - height="580" + height="780" layout="topleft" bg_opaque_image="Window_NoTitle_Foreground" bg_alpha_image="Window_NoTitle_Background" @@ -751,7 +751,7 @@ </text> <tab_container follows="left|top" - height="410" + height="610" halign="center" left="0" name="Object Info Tabs" @@ -1217,7 +1217,7 @@ even though the user gets a free copy. <panel border="false" follows="all" - height="367" + height="567" label="Object" layout="topleft" left_delta="0" @@ -1466,6 +1466,78 @@ even though the user gets a free copy. value="Convex Hull" /> </combo_box> + <spinner + follows="left|top" + height="19" + increment="1" + initial_value="1" + label="Gravity" + label_width="70" + layout="topleft" + left="10" + min_val="-1" + max_val="10" + name="Physics Gravity" + top_pad="10" + width="128" /> + + <check_box + height="19" + label="Override material" + layout="topleft" + left_delta="0" + name="Physics Material Override" + tool_tip="Override Material" + top_pad="10" + width="121" /> + + <spinner + follows="left|top" + height="19" + increment="0.1" + initial_value="0" + label="Friction" + label_width="70" + layout="topleft" + left_delta="0" + max_val="255" + min_val="0" + name="Physics Friction" + top_pad="4" + width="128" /> + + <spinner + follows="left|top" + height="19" + increment="0.1" + initial_value="0" + label="Density" + label_width="70" + layout="topleft" + left_delta="0" + max_val="10" + min_val="0" + name="Physics Density" + top_pad="4" + width="128" /> + + <spinner + follows="left|top" + height="19" + increment="0.01" + initial_value="0" + label="Restitution" + label_width="70" + layout="topleft" + left_delta="0" + max_val="1" + min_val="0" + name="Physics Restitution" + top_pad="4" + width="128" /> + + + <!-- <text type="string" length="1" diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 06050db627..bb091731db 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -568,6 +568,10 @@ class WindowsManifest(ViewerManifest): class DarwinManifest(ViewerManifest): + def is_packaging_viewer(self): + # darwin requires full app bundle packaging even for debugging. + return True + def construct(self): # copy over the build result (this is a no-op if run within the xcode script) self.path(self.args['configuration'] + "/Second Life.app", dst="") |