summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-06 14:47:43 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-06 14:47:43 +0100
commit3c47d1faf1abb38ad05036de65bea3b7e21f683f (patch)
tree2a33d4ee90d0287436c63a5f8fa90cf8fd1d6ef6 /indra/newview/llviewerobject.cpp
parent20c660569df71f677065b5f5f66477ebbd6b35b6 (diff)
parenta63c59be9e7df57143ddd04e44263c232f420a21 (diff)
another hairy merge from viewer-trunk :(
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp62
1 files changed, 61 insertions, 1 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index e6d14079c9..318adfb302 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),
@@ -2940,7 +2942,7 @@ void LLViewerObject::boostTexturePriority(BOOL boost_children /* = TRUE */)
getTEImage(i)->setBoostLevel(LLViewerTexture::BOOST_SELECTED);
}
- if (isSculpted())
+ if (isSculpted() && !isMesh())
{
LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
LLUUID sculpt_id = sculpt_params->getSculptTexture();
@@ -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");
+