summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-01 19:45:19 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-01 19:45:19 +0100
commit9bdbc10aba78d7c6fec832ee4c411b483f05c441 (patch)
tree815b58b072d2f3e5dbead85e954b3e4e8c2575d5 /indra
parente562a200b69c39f60540019ef0ec7423ace04bef (diff)
parent17d5a40f8a6681151f0530c342174c5321d664eb (diff)
merge
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelobject.cpp34
-rw-r--r--indra/newview/llpanelobject.h20
-rw-r--r--indra/newview/llselectmgr.cpp23
-rw-r--r--indra/newview/llselectmgr.h1
-rw-r--r--indra/newview/llviewerobject.cpp60
-rw-r--r--indra/newview/llviewerobject.h6
-rw-r--r--indra/newview/skins/default/xui/en/floater_tools.xml33
7 files changed, 168 insertions, 9 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 30221da12a..669ff3ffd6 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -137,6 +137,10 @@ BOOL LLPanelObject::postBuild()
// Phantom checkbox
mCheckPhantom = getChild<LLCheckBoxCtrl>("Phantom Checkbox Ctrl");
childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,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");
@@ -320,6 +324,7 @@ LLPanelObject::LLPanelObject()
mIsPhysical(FALSE),
mIsTemporary(FALSE),
mIsPhantom(FALSE),
+ mPhysicsShapeType(0),
mCastShadows(TRUE),
mSelectedType(MI_BOX),
mSculptTextureRevert(LLUUID::null),
@@ -527,6 +532,10 @@ void LLPanelObject::getState( )
mCheckPhantom->set( mIsPhantom );
mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible );
+ mPhysicsShapeType = objectp->getPhysicsShapeType();
+ mComboPhysicsShapeType->setCurrentByIndex(mPhysicsShapeType);
+ mComboPhysicsShapeType->setEnabled(editable);
+
#if 0 // 1.9.2
mCastShadows = root_objectp->flagCastShadows();
mCheckCastShadows->set( mCastShadows );
@@ -1232,6 +1241,22 @@ void LLPanelObject::sendIsPhantom()
}
}
+void LLPanelObject::sendPhysicsShapeType()
+{
+ 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;
+ }
+}
+
void LLPanelObject::sendCastShadows()
{
BOOL value = mCheckCastShadows->get();
@@ -1905,6 +1930,8 @@ void LLPanelObject::clearCtrls()
mCheckTemporary ->setEnabled( FALSE );
mCheckPhantom ->set(FALSE);
mCheckPhantom ->setEnabled( FALSE );
+ mComboPhysicsShapeType->setCurrentByIndex(0);
+ mComboPhysicsShapeType->setEnabled(FALSE);
#if 0 // 1.9.2
mCheckCastShadows->set(FALSE);
mCheckCastShadows->setEnabled( FALSE );
@@ -2000,6 +2027,13 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata )
}
// static
+void LLPanelObject::onCommitPhysicsShapeType(LLUICtrl* ctrl, void* userdata )
+{
+ LLPanelObject* self = (LLPanelObject*) userdata;
+ self->sendPhysicsShapeType();
+}
+
+// static
void LLPanelObject::onCommitCastShadows( LLUICtrl* ctrl, void* userdata )
{
LLPanelObject* self = (LLPanelObject*) userdata;
diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h
index 58d9fe9b76..7f368c38c7 100644
--- a/indra/newview/llpanelobject.h
+++ b/indra/newview/llpanelobject.h
@@ -65,13 +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 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);
@@ -93,6 +94,7 @@ protected:
void sendIsPhysical();
void sendIsTemporary();
void sendIsPhantom();
+ void sendPhysicsShapeType();
void sendCastShadows();
void sendSculpt();
@@ -165,8 +167,9 @@ protected:
LLCheckBoxCtrl *mCheckPhysics;
LLCheckBoxCtrl *mCheckTemporary;
LLCheckBoxCtrl *mCheckPhantom;
+ LLComboBox *mComboPhysicsShapeType;
LLCheckBoxCtrl *mCheckCastShadows;
-
+
LLTextureCtrl *mCtrlSculptTexture;
LLTextBox *mLabelSculptType;
LLComboBox *mCtrlSculptType;
@@ -177,6 +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 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 f0c4559ad2..cfa05987ab 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -3931,6 +3931,28 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows)
getSelection()->applyToObjects(&func);
}
+struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor
+{
+ LLSelectMgrApplyPhysicsShapeType(U8 value) : mValue(value) {}
+ U8 mValue;
+ virtual bool apply(LLViewerObject* object)
+ {
+ if ( object->permModify() ) // preemptive permissions check
+ {
+ object->setPhysicsShapeType( mValue );
+ object->updateFlags();
+ }
+ return true;
+ }
+};
+
+
+void LLSelectMgr::selectionUpdatePhysicsShapeType(U8 type)
+{
+ llwarns << "physics shape type ->" << (U32)type << llendl;
+ LLSelectMgrApplyPhysicsShapeType func(type);
+ getSelection()->applyToObjects(&func);
+}
//----------------------------------------------------------------------
// Helpful packing functions for sendObjectMessage()
@@ -4620,7 +4642,6 @@ void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**)
LLSelectMgr::getInstance()->highlightObjectAndFamily(objects);
}
-
extern LLGLdouble gGLModelView[16];
void LLSelectMgr::updateSilhouettes()
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 78b94a8efe..34f2082b82 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -484,6 +484,7 @@ public:
void selectionUpdatePhysics(BOOL use_physics);
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/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 6820ad42cd..7532102378 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"
@@ -198,6 +199,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mGLName(0),
mbCanSelect(TRUE),
mFlags(0),
+ mPhysicsShapeType(0),
mDrawable(),
mCreateSelected(FALSE),
mRenderMedia(FALSE),
@@ -4960,7 +4962,14 @@ void LLViewerObject::updateFlags()
gMessageSystem->addBOOL("IsTemporary", flagTemporaryOnRez() );
gMessageSystem->addBOOL("IsPhantom", flagPhantom() );
gMessageSystem->addBOOL("CastsShadows", flagCastShadows() );
+ gMessageSystem->nextBlock("ExtraPhysics");
+ gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() );
gMessageSystem->sendReliable( regionp->getHost() );
+
+ if (getPhysicsShapeType() != 0)
+ {
+ llwarns << "sent non default physics rep" << llendl;
+ }
}
BOOL LLViewerObject::setFlags(U32 flags, BOOL state)
@@ -4992,6 +5001,12 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state)
return setit;
}
+void LLViewerObject::setPhysicsShapeType(U8 type)
+{
+ mPhysicsShapeType = type;
+ updateFlags();
+}
+
void LLViewerObject::applyAngularVelocity(F32 dt)
{
//do target omega here
@@ -5203,3 +5218,48 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif
return ;
}
+class ObjectPhysicsProperties : public LLHTTPNode
+{
+public:
+ virtual void post(
+ ResponsePtr responder,
+ const LLSD& context,
+ const LLSD& input) const
+ {
+ LLSD objectData = input["body"]["ObjectData"];
+ S32 numEntries = objectData.size();
+
+ for ( S32 i = 0; i < numEntries; i++ )
+ {
+ 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
+ {
+ U32 mID;
+ f(const U32& id) : mID(id) {}
+ virtual bool apply(LLSelectNode* node)
+ {
+ return (node->getObject() && node->getObject()->mLocalID == mID );
+ }
+ } func(localID);
+
+ 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);
+ }
+ }
+
+ dialog_refresh_all();
+ };
+};
+
+LLHTTPRegistration<ObjectPhysicsProperties>
+ gHTTPRegistrationObjectPhysicsProperties("/message/ObjectPhysicsProperties");
+
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index bf5e0b6656..8b542af773 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -460,6 +460,8 @@ public:
inline BOOL flagCameraDecoupled() const { return ((mFlags & FLAGS_CAMERA_DECOUPLED) != 0); }
inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); }
+ inline U8 getPhysicsShapeType() const { return mPhysicsShapeType; }
+
bool getIncludeInSearch() const;
void setIncludeInSearch(bool include_in_search);
@@ -475,6 +477,7 @@ public:
void updateFlags();
BOOL setFlags(U32 flag, BOOL state);
+ void setPhysicsShapeType(U8 type);
virtual void dump() const;
static U32 getNumZombieObjects() { return sNumZombieObjects; }
@@ -554,6 +557,9 @@ public:
// Grabbed from UPDATE_FLAGS
U32 mFlags;
+ // Sent to sim in UPDATE_FLAGS, received in ObjectPhysicsProperties
+ 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 c594448df7..37dbd8a670 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -1418,6 +1418,39 @@ even though the user gets a free copy.
text_enabled_color="1 1 1 1"
top_pad="3"
width="87" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_delta="0"
+ name="label physicsshapetype"
+ top_pad="10"
+ width="121">
+ Physics Shape Type:
+ </text>
+ <combo_box
+ height="23"
+ layout="topleft"
+ follows="left|top"
+ name="Physics Shape Type Combo Ctrl"
+ tool_tip="Choose the physics shape type"
+ left_pad="0"
+ width="108">
+ <combo_box.item
+ label="Prim"
+ name="Prim"
+ value="Prim" />
+ <combo_box.item
+ label="None"
+ name="None"
+ value="None" />
+ <combo_box.item
+ label="Convex Hull"
+ name="Convex Hull"
+ value="Convex Hull" />
+ </combo_box>
<!-- <text
type="string"