summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorMatthew Breindel (Falcon) <falcon@lindenlab.com>2010-03-26 18:23:05 -0700
committerMatthew Breindel (Falcon) <falcon@lindenlab.com>2010-03-26 18:23:05 -0700
commit006e15495515e6e4c233412a4deed0f34e7b0f12 (patch)
treee5dfe03e2d932606bc9bfb3de899555c112860a5 /indra/newview/llviewerobject.cpp
parent7ee4c5e6ffef66df30c44fd9eb662632f1b4f709 (diff)
DEV-47845 Fix to work with TCP/LLSD message. This checkin is experimental, so if it breaks a build, just revert to the previous changeset.
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index bb7933c10e..f18fee3ede 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -199,6 +199,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mGLName(0),
mbCanSelect(TRUE),
mFlags(0),
+ mPhysicsRep(0),
mDrawable(),
mCreateSelected(FALSE),
mRenderMedia(FALSE),
@@ -4961,7 +4962,14 @@ void LLViewerObject::updateFlags()
gMessageSystem->addBOOL("IsTemporary", flagTemporaryOnRez() );
gMessageSystem->addBOOL("IsPhantom", flagPhantom() );
gMessageSystem->addBOOL("CastsShadows", flagCastShadows() );
+ gMessageSystem->nextBlock("ExtraPhysics");
+ gMessageSystem->addU8("PhysicsRep", getPhysicsRep() );
gMessageSystem->sendReliable( regionp->getHost() );
+
+ if (getPhysicsRep() != 0)
+ {
+ llwarns << "sent non default physics rep" << llendl;
+ }
}
BOOL LLViewerObject::setFlags(U32 flags, BOOL state)
@@ -4993,6 +5001,12 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state)
return setit;
}
+void LLViewerObject::setPhysicsRep(U8 rep)
+{
+ mPhysicsRep = rep;
+ updateFlags();
+}
+
void LLViewerObject::applyAngularVelocity(F32 dt)
{
//do target omega here
@@ -5203,4 +5217,50 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif
return ;
}
+#include "../llcommon/llsdserialize.h"
+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++ )
+ {
+ U32 localID = objectData[i]["LocalID"].asInteger();
+
+ std::ostringstream string;
+ LLSDSerialize::serialize( input, string, LLSDSerialize::LLSD_XML, LLSDFormatter::OPTIONS_PRETTY);
+ llinfos << string.str() << llendl;
+
+ // 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);
+
+ U8 physicsRepSpec = (U8)objectData[i]["PhysicsRepSpec"].asInteger();
+
+ if (node)
+ {
+ node->getObject()->setPhysicsRep(physicsRepSpec);
+ }
+ }
+
+ };
+};
+
+LLHTTPRegistration<ObjectPhysicsProperties>
+ gHTTPRegistrationObjectPhysicsProperties("/message/ObjectPhysicsProperties");