From 827c1adc917d832b577b37e37b0eb3f26705c29d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 12:48:42 +0000 Subject: Backed out changeset d89b00b44ab6 --- indra/newview/llviewerobject.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 886f1d9ef5..4fdfc37d6c 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2001,6 +2001,9 @@ BOOL LLViewerObject::isActive() const BOOL LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { + static LLFastTimer::DeclareTimer ftm("Viewer Object"); + LLFastTimer t(ftm); + if (mDead) { // It's dead. Don't update it. -- cgit v1.2.3 From 1ceceecf7501076fa92fa7c9eb5cdf1aa8d5191e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 25 Feb 2010 15:19:44 -0600 Subject: LOD tweaking (sort of) works again in importer. Got rid of another spot that was loading meshes as textures. --- indra/newview/llviewerobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b5642d07a5..8dea60cc87 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2932,7 +2932,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(); -- cgit v1.2.3 From 92257b55a405f3625cbbcf07357b3ca929a04882 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Fri, 26 Mar 2010 18:23:05 -0700 Subject: 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. --- indra/newview/llviewerobject.cpp | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 8dea60cc87..1ee30b49bf 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -189,6 +189,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mGLName(0), mbCanSelect(TRUE), mFlags(0), + mPhysicsRep(0), mDrawable(), mCreateSelected(FALSE), mRenderMedia(FALSE), @@ -4952,7 +4953,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) @@ -4984,6 +4992,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 @@ -5194,4 +5208,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 + gHTTPRegistrationObjectPhysicsProperties("/message/ObjectPhysicsProperties"); -- cgit v1.2.3 From b2381a039de7e0edbd643d198b85ba8e00524b6b Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Wed, 31 Mar 2010 17:35:26 -0700 Subject: DEV-47845 Cleaned up names. --- indra/newview/llviewerobject.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') 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); } } -- cgit v1.2.3 From 19c83c67c42305e41bff4b651975671d34a22b55 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Thu, 1 Apr 2010 11:30:43 -0700 Subject: DEV-47845 More cleanup. Fixed a bug where the physics shape type wouldn't get displayed properly until you re-selected an object. --- indra/newview/llviewerobject.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b7139b9647..5b778cc816 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5249,6 +5249,7 @@ public: } } + dialog_refresh_all(); }; }; -- cgit v1.2.3 From 17d5a40f8a6681151f0530c342174c5321d664eb Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Thu, 1 Apr 2010 11:34:05 -0700 Subject: Fixed line ending --- indra/newview/llviewerobject.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a8212ade91..7532102378 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5234,15 +5234,15 @@ public: 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 ); - } + // 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); -- cgit v1.2.3 From f324787a70b8fccc7a8ea202805bf726fba765a7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 1 May 2010 00:45:44 -0500 Subject: Rigged attachment integration WIP. --- indra/newview/llviewerobject.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6bd3ceb8a8..3aecd0175d 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5219,6 +5219,25 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif return ; } +//virtual +LLVOAvatar* LLViewerObject::getAvatar() const +{ + if (isAttachment()) + { + LLViewerObject* vobj = (LLViewerObject*) getParent(); + + while (vobj && !vobj->asAvatar()) + { + vobj = (LLViewerObject*) vobj->getParent(); + } + + return (LLVOAvatar*) vobj; + } + + return NULL; +} + + class ObjectPhysicsProperties : public LLHTTPNode { public: -- cgit v1.2.3