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 006e15495515e6e4c233412a4deed0f34e7b0f12 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 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 + 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 9226d42d12b9edb792d65b28254c633d0dc64edc Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 22 Apr 2010 21:40:38 +0100 Subject: Backed out changeset 78dddb3a1dd3 --- indra/newview/llviewerobject.cpp | 60 ---------------------------------------- 1 file changed, 60 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f18fee3ede..bb7933c10e 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -199,7 +199,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mGLName(0), mbCanSelect(TRUE), mFlags(0), - mPhysicsRep(0), mDrawable(), mCreateSelected(FALSE), mRenderMedia(FALSE), @@ -4962,14 +4961,7 @@ 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) @@ -5001,12 +4993,6 @@ 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 @@ -5217,50 +5203,4 @@ 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 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 From d334a9e645ab14c2822f35ee67d2c1e0f2a646a6 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 13 May 2010 14:54:56 -0500 Subject: Vis that works and first pass at fetching prim cost. --- 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 3aecd0175d..38a29ba432 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -232,6 +232,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mState(0), mMedia(NULL), mClickAction(0), + mObjectCost(-1), mAttachmentItemID(LLUUID::null) { if (!is_global) -- cgit v1.2.3 From 246dd9c168550bfe4b1b71bba75f5af9456e86dd Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 15 May 2010 02:45:58 -0500 Subject: Highlight for object cost and proper retrieval/display of prim object cost and linkset cost. --- indra/newview/llviewerobject.cpp | 44 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 38a29ba432..ff5d7e9c17 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -232,7 +232,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mState(0), mMedia(NULL), mClickAction(0), - mObjectCost(-1), + mObjectCost(0.f), + mLinksetCost(0.f), + mCostStale(true), mAttachmentItemID(LLUUID::null) { if (!is_global) @@ -829,6 +831,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, #ifdef DEBUG_UPDATE_TYPE llinfos << "Full:" << getID() << llendl; #endif + //clear cost and linkset cost + mCostStale = true; + LLUUID audio_uuid; LLUUID owner_id; // only valid if audio_uuid or particle system is not null F32 gain; @@ -1394,6 +1399,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, #ifdef DEBUG_UPDATE_TYPE llinfos << "CompFull:" << getID() << llendl; #endif + mCostStale = true; + dp->unpackU32(crc, "CRC"); mTotalCRC = crc; dp->unpackU8(material, "Material"); @@ -2864,6 +2871,39 @@ void LLViewerObject::setScale(const LLVector3 &scale, BOOL damped) } } +void LLViewerObject::setObjectCost(F32 cost) +{ + mObjectCost = cost; + mCostStale = false; +} + +void LLViewerObject::setLinksetCost(F32 cost) +{ + mLinksetCost = cost; + mCostStale = false; +} + + +F32 LLViewerObject::getObjectCost() +{ + if (mCostStale) + { + gObjectList.updateObjectCost(this); + } + + return mObjectCost; +} + +F32 LLViewerObject::getLinksetCost() +{ + if (mCostStale) + { + gObjectList.updateObjectCost(this); + } + + return mLinksetCost; +} + void LLViewerObject::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax) { LLVector3 center = getRenderPosition(); @@ -4970,7 +5010,7 @@ void LLViewerObject::updateFlags() if (getPhysicsShapeType() != 0) { - llwarns << "sent non default physics rep" << llendl; + llwarns << "sent non default physics rep " << (S32) getPhysicsShapeType() << llendl; } } -- cgit v1.2.3 From 26ba00b5554d20ee958693ced87b36fa7f6e3d99 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 3 Jun 2010 12:52:28 -0500 Subject: Vectorized octree and much of llspatialpartition and lldrawable. Octree driven raycast. --- indra/newview/llviewerobject.cpp | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3aecd0175d..0ed2d1da09 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2863,21 +2863,26 @@ void LLViewerObject::setScale(const LLVector3 &scale, BOOL damped) } } -void LLViewerObject::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax) -{ - LLVector3 center = getRenderPosition(); - LLVector3 size = getScale(); - newMin.setVec(center-size); - newMax.setVec(center+size); - mDrawable->setPositionGroup((newMin + newMax) * 0.5f); +void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) +{ + LLVector4a center; + center.load3(getRenderPosition().mV); + LLVector4a size; + size.load3(getScale().mV); + newMin.setSub(center, size); + newMax.setAdd(center, size); + + mDrawable->setPositionGroup(center); } F32 LLViewerObject::getBinRadius() { if (mDrawable.notNull()) { - const LLVector3* ext = mDrawable->getSpatialExtents(); - return (ext[1]-ext[0]).magVec(); + const LLVector4a* ext = mDrawable->getSpatialExtents(); + LLVector4a diff; + diff.setSub(ext[1], ext[0]); + return diff.length3(); } return getScale().magVec(); @@ -3469,12 +3474,21 @@ BOOL LLViewerObject::lineSegmentBoundingBox(const LLVector3& start, const LLVect return FALSE; } - const LLVector3* ext = mDrawable->getSpatialExtents(); + const LLVector4a* ext = mDrawable->getSpatialExtents(); + + //VECTORIZE THIS + LLVector4a center; + center.setAdd(ext[1], ext[0]); + center.mul(0.5f); + LLVector4a size; + size.setSub(ext[1], ext[0]); + size.mul(0.5f); - LLVector3 center = (ext[1]+ext[0])*0.5f; - LLVector3 size = (ext[1]-ext[0])*0.5f; + LLVector4a starta, enda; + starta.load3(start.mV); + enda.load3(end.mV); - return LLLineSegmentBoxIntersect(start, end, center, size); + return LLLineSegmentBoxIntersect(starta, enda, center, size); } U8 LLViewerObject::getMediaType() const -- cgit v1.2.3 From 2530b057bb18550ed2825c14988a807ab90d460f Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" Date: Thu, 1 Jul 2010 17:18:55 -0500 Subject: added new physics parameters to prims --- indra/newview/llviewerobject.cpp | 64 +++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 10 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 03e524268d..82147dd339 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -201,6 +201,11 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mbCanSelect(TRUE), mFlags(0), mPhysicsShapeType(0), + mPhysicsGravity(0), + mPhysicsMaterialOverride(FALSE), + mPhysicsFriction(0), + mPhysicsDensity(0), + mPhysicsRestitution(0), mDrawable(), mCreateSelected(FALSE), mRenderMedia(FALSE), @@ -5022,6 +5027,11 @@ void LLViewerObject::updateFlags() gMessageSystem->addBOOL("CastsShadows", flagCastShadows() ); gMessageSystem->nextBlock("ExtraPhysics"); gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() ); + gMessageSystem->addF32("PhysicsGravity", getPhysicsGravity() ); + gMessageSystem->addBOOL("PhysicsMaterialOverride", getPhysicsMaterialOverride() ); + gMessageSystem->addF32("PhysicsFriction", getPhysicsFriction() ); + gMessageSystem->addF32("PhysicsDensity", getPhysicsDensity() ); + gMessageSystem->addF32("PhysicsRestitution", getPhysicsRestitution() ); gMessageSystem->sendReliable( regionp->getHost() ); if (getPhysicsShapeType() != 0) @@ -5062,7 +5072,31 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state) void LLViewerObject::setPhysicsShapeType(U8 type) { mPhysicsShapeType = type; - updateFlags(); +} + +void LLViewerObject::setPhysicsGravity(F32 gravity) +{ + mPhysicsGravity = gravity; +} + +void LLViewerObject::setPhysicsMaterialOverride(BOOL material_override) +{ + mPhysicsMaterialOverride = material_override; +} + +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 +5337,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 +5354,26 @@ 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 gravity = (F32)curr_object_data["PhysicsGravity"].asReal(); + BOOL material_override = curr_object_data["PhysicsMaterialOverride"].asBoolean(); + F32 friction = (F32)curr_object_data["PhysicsFriction"].asReal(); + F32 density = (F32)curr_object_data["PhysicsDensity"].asReal(); + F32 restitution = (F32)curr_object_data["PhysicsRestitution"].asReal(); + + node->getObject()->setPhysicsShapeType(type); + node->getObject()->setPhysicsGravity(gravity); + node->getObject()->setPhysicsMaterialOverride(material_override); + node->getObject()->setPhysicsFriction(friction); + node->getObject()->setPhysicsDensity(density); + node->getObject()->setPhysicsRestitution(restitution); } } -- cgit v1.2.3 From 3733337011c781b6dabe978181d8ae4c5c96188b Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Fri, 9 Jul 2010 17:47:58 -0700 Subject: Gravity, Friction, Restitution, Density now work with simulator. --- indra/newview/llviewerobject.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 82147dd339..80d645ca80 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -202,7 +202,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mFlags(0), mPhysicsShapeType(0), mPhysicsGravity(0), - mPhysicsMaterialOverride(FALSE), mPhysicsFriction(0), mPhysicsDensity(0), mPhysicsRestitution(0), @@ -5027,11 +5026,10 @@ void LLViewerObject::updateFlags() gMessageSystem->addBOOL("CastsShadows", flagCastShadows() ); gMessageSystem->nextBlock("ExtraPhysics"); gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() ); - gMessageSystem->addF32("PhysicsGravity", getPhysicsGravity() ); - gMessageSystem->addBOOL("PhysicsMaterialOverride", getPhysicsMaterialOverride() ); - gMessageSystem->addF32("PhysicsFriction", getPhysicsFriction() ); - gMessageSystem->addF32("PhysicsDensity", getPhysicsDensity() ); - gMessageSystem->addF32("PhysicsRestitution", getPhysicsRestitution() ); + gMessageSystem->addF32("Density", getPhysicsDensity() ); + gMessageSystem->addF32("Friction", getPhysicsFriction() ); + gMessageSystem->addF32("Restitution", getPhysicsRestitution() ); + gMessageSystem->addF32("GravityMultiplier", getPhysicsGravity() ); gMessageSystem->sendReliable( regionp->getHost() ); if (getPhysicsShapeType() != 0) @@ -5079,11 +5077,6 @@ void LLViewerObject::setPhysicsGravity(F32 gravity) mPhysicsGravity = gravity; } -void LLViewerObject::setPhysicsMaterialOverride(BOOL material_override) -{ - mPhysicsMaterialOverride = material_override; -} - void LLViewerObject::setPhysicsFriction(F32 friction) { mPhysicsFriction = friction; @@ -5362,15 +5355,13 @@ public: { // The LLSD message builder doesn't know how to handle U8, so we need to send as S8 and cast U8 type = (U8)curr_object_data["PhysicsShapeType"].asInteger(); - F32 gravity = (F32)curr_object_data["PhysicsGravity"].asReal(); - BOOL material_override = curr_object_data["PhysicsMaterialOverride"].asBoolean(); - F32 friction = (F32)curr_object_data["PhysicsFriction"].asReal(); - F32 density = (F32)curr_object_data["PhysicsDensity"].asReal(); - F32 restitution = (F32)curr_object_data["PhysicsRestitution"].asReal(); + 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()->setPhysicsMaterialOverride(material_override); node->getObject()->setPhysicsFriction(friction); node->getObject()->setPhysicsDensity(density); node->getObject()->setPhysicsRestitution(restitution); -- cgit v1.2.3 From e4c81b920f0fe8efec4047b86fb683fcd8bc2318 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 15 Jul 2010 17:06:26 -0500 Subject: Make tools floater update automatically when object cost received. --- indra/newview/llviewerobject.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 862359005e..2b89deaa53 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -69,6 +69,7 @@ #include "lldrawable.h" #include "llface.h" #include "llfloaterproperties.h" +#include "llfloatertools.h" #include "llfollowcam.h" #include "llselectmgr.h" #include "llrendersphere.h" @@ -855,6 +856,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, #endif //clear cost and linkset cost mCostStale = true; + if (isSelected()) + { + gFloaterTools->dirty(); + } LLUUID audio_uuid; LLUUID owner_id; // only valid if audio_uuid or particle system is not null @@ -1423,6 +1428,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, #endif mCostStale = true; + if (isSelected()) + { + gFloaterTools->dirty(); + } + dp->unpackU32(crc, "CRC"); mTotalCRC = crc; dp->unpackU8(material, "Material"); @@ -2903,12 +2913,22 @@ void LLViewerObject::setObjectCost(F32 cost) { mObjectCost = cost; mCostStale = false; + + if (isSelected()) + { + gFloaterTools->dirty(); + } } void LLViewerObject::setLinksetCost(F32 cost) { mLinksetCost = cost; mCostStale = false; + + if (isSelected()) + { + gFloaterTools->dirty(); + } } -- cgit v1.2.3 From 2fea1d5d33ec1b41a3cfa4307a1bfa58d8014f88 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 19 Aug 2010 12:25:15 -0500 Subject: Integrate SIMD API from oreh/server-trunk-oreh --- 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 2b89deaa53..9587fbafb1 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2973,7 +2973,7 @@ F32 LLViewerObject::getBinRadius() const LLVector4a* ext = mDrawable->getSpatialExtents(); LLVector4a diff; diff.setSub(ext[1], ext[0]); - return diff.length3(); + return diff.getLength3().getF32(); } return getScale().magVec(); -- cgit v1.2.3 From 90da6d6fdc33343be72252101aed1be641e822b5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sun, 19 Sep 2010 23:07:15 -0500 Subject: Raycasting for rigged attachments now works for your own attachments while in edit mode. --- indra/newview/llviewerobject.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index fd2212f25d..4c1a1958e8 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3279,6 +3279,15 @@ const LLVector3 LLViewerObject::getPositionEdit() const const LLVector3 LLViewerObject::getRenderPosition() const { + if (mDrawable.notNull() && mDrawable->isState(LLDrawable::RIGGED)) + { + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + return avatar->getPositionAgent(); + } + } + if (mDrawable.isNull() || mDrawable->getGeneration() < 0) { return getPositionAgent(); @@ -3297,6 +3306,11 @@ const LLVector3 LLViewerObject::getPivotPositionAgent() const const LLQuaternion LLViewerObject::getRenderRotation() const { LLQuaternion ret; + if (mDrawable.notNull() && mDrawable->isState(LLDrawable::RIGGED)) + { + return ret; + } + if (mDrawable.isNull() || mDrawable->isStatic()) { ret = getRotationEdit(); -- cgit v1.2.3 From 90e3d83a5cb35e98a02a3017dd79ebc272bbfe85 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Sep 2010 13:26:52 -0400 Subject: Fix for build failures - disabling tcmalloc for now --- indra/newview/llviewerobject.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/llviewerobject.cpp (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp old mode 100644 new mode 100755 -- cgit v1.2.3 From 0c93da0501ab1debd6fa11af29a215be81f7b803 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 29 Sep 2010 16:09:21 -0500 Subject: SH-224 Add new streaming cost algorithm debug displays to viewer. Add the ability to clear LOD slots. Make triangle count UI more responsive to Generate LOD button. Add triangle count debug display for current selection. Reviewed by Nyx --- indra/newview/llviewerobject.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b21597349f..9b3f81e193 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2942,6 +2942,16 @@ F32 LLViewerObject::getObjectCost() return mObjectCost; } +F32 LLViewerObject::getStreamingCost() +{ + return 0.f; +} + +U32 LLViewerObject::getTriangleCount() +{ + return 0; +} + F32 LLViewerObject::getLinksetCost() { if (mCostStale) -- cgit v1.2.3 From b70ccfe8e31cd253069a6e0ae0ec03e301d26578 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 7 Oct 2010 14:00:43 -0500 Subject: Add pure physics cost to UI --- indra/newview/llviewerobject.cpp | 54 +++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9b3f81e193..dcd208fea5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -240,6 +240,8 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mClickAction(0), mObjectCost(0.f), mLinksetCost(0.f), + mPhysicsCost(0.f), + mLinksetPhysicsCost(0.f), mCostStale(true), mAttachmentItemID(LLUUID::null) { @@ -2931,6 +2933,28 @@ void LLViewerObject::setLinksetCost(F32 cost) } } +void LLViewerObject::setPhysicsCost(F32 cost) +{ + mPhysicsCost = cost; + mCostStale = false; + + if (isSelected()) + { + gFloaterTools->dirty(); + } +} + +void LLViewerObject::setLinksetPhysicsCost(F32 cost) +{ + mLinksetPhysicsCost = cost; + mCostStale = false; + + if (isSelected()) + { + gFloaterTools->dirty(); + } +} + F32 LLViewerObject::getObjectCost() { @@ -2942,27 +2966,45 @@ F32 LLViewerObject::getObjectCost() return mObjectCost; } -F32 LLViewerObject::getStreamingCost() +F32 LLViewerObject::getLinksetCost() { - return 0.f; + if (mCostStale) + { + gObjectList.updateObjectCost(this); + } + + return mLinksetCost; } -U32 LLViewerObject::getTriangleCount() +F32 LLViewerObject::getPhysicsCost() { - return 0; + if (mCostStale) + { + gObjectList.updateObjectCost(this); + } + + return mPhysicsCost; } -F32 LLViewerObject::getLinksetCost() +F32 LLViewerObject::getLinksetPhysicsCost() { if (mCostStale) { gObjectList.updateObjectCost(this); } - return mLinksetCost; + return mLinksetPhysicsCost; } +F32 LLViewerObject::getStreamingCost() +{ + return 0.f; +} +U32 LLViewerObject::getTriangleCount() +{ + return 0; +} void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) { -- cgit v1.2.3 From a5619d16f74863168f45b04b37cc6383e1a92263 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Oct 2010 07:24:37 -0400 Subject: correct licenses (fix problem with license change merge) --- indra/newview/llviewerobject.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index dcd208fea5..ee8e2cebbf 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2,31 +2,25 @@ * @file llviewerobject.cpp * @brief Base class for viewer objects * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 30b44b238ba6ff8ff6dc29161f3ff6ee85a27f06 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 19 Oct 2010 23:19:55 -0500 Subject: First stab at using GetObjectPhysicsData --- indra/newview/llviewerobject.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index ee8e2cebbf..e0b56767cd 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -237,6 +237,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mPhysicsCost(0.f), mLinksetPhysicsCost(0.f), mCostStale(true), + mPhysicsShapeUnknown(true), mAttachmentItemID(LLUUID::null) { if (!is_global) @@ -5185,6 +5186,7 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state) void LLViewerObject::setPhysicsShapeType(U8 type) { + mPhysicsShapeUnknown = false; mPhysicsShapeType = type; } @@ -5208,6 +5210,17 @@ void LLViewerObject::setPhysicsRestitution(F32 restitution) mPhysicsRestitution = restitution; } +U8 LLViewerObject::getPhysicsShapeType() const +{ + if (mPhysicsShapeUnknown) + { + mPhysicsShapeUnknown = false; + gObjectList.updatePhysicsFlags(this); + } + + return mPhysicsShapeType; +} + void LLViewerObject::applyAngularVelocity(F32 dt) { //do target omega here -- cgit v1.2.3 From 5364bb5a11aaae33127db3866f7a9bba6404773d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 14 Jan 2011 15:16:17 -0500 Subject: Mesh-development work in progress --- indra/newview/llviewerobject.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f380d4b183..bf550e9c70 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5600,6 +5600,26 @@ void LLViewerObject::setAttachmentItemID(const LLUUID &id) mAttachmentItemID = id; } +EObjectUpdateType LLViewerObject::getLastUpdateType() const +{ + return mLastUpdateType; +} + +void LLViewerObject::setLastUpdateType(EObjectUpdateType last_update_type) +{ + mLastUpdateType = last_update_type; +} + +BOOL LLViewerObject::getLastUpdateCached() const +{ + return mLastUpdateCached; +} + +void LLViewerObject::setLastUpdateCached(BOOL last_update_cached) +{ + mLastUpdateCached = last_update_cached; +} + const LLUUID &LLViewerObject::extractAttachmentItemID() { LLUUID item_id = LLUUID::null; @@ -5616,16 +5636,6 @@ const LLUUID &LLViewerObject::extractAttachmentItemID() return getAttachmentItemID(); } -EObjectUpdateType LLViewerObject::getLastUpdateType() const -{ - return mLastUpdateType; -} - -void LLViewerObject::setLastUpdateType(EObjectUpdateType last_update_type) -{ - mLastUpdateType = last_update_type; -} - //virtual LLVOAvatar* LLViewerObject::getAvatar() const { -- cgit v1.2.3 From c1db849c418d2cef8c321199ad1421b183aff9bf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 20 Jan 2011 15:50:03 -0600 Subject: SH-635 Fix for changing one physics parameter changing all physics parameters. --- indra/newview/llviewerobject.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index bf550e9c70..244de7fed3 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5306,11 +5306,6 @@ void LLViewerObject::updateFlags() gMessageSystem->addF32("Restitution", getPhysicsRestitution() ); gMessageSystem->addF32("GravityMultiplier", getPhysicsGravity() ); gMessageSystem->sendReliable( regionp->getHost() ); - - if (getPhysicsShapeType() != 0) - { - llwarns << "sent non default physics rep " << (S32) getPhysicsShapeType() << llendl; - } } BOOL LLViewerObject::setFlags(U32 flags, BOOL state) @@ -5346,6 +5341,7 @@ void LLViewerObject::setPhysicsShapeType(U8 type) { mPhysicsShapeUnknown = false; mPhysicsShapeType = type; + mCostStale = true; } void LLViewerObject::setPhysicsGravity(F32 gravity) -- cgit v1.2.3 From 6b9a2d24cce8efaa72c2fd60655998844394312d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 30 Mar 2011 18:38:22 -0500 Subject: SH-477 Better mesh streaming cost estimation. --- 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 bcdc774c5e..70b1809033 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3134,7 +3134,7 @@ F32 LLViewerObject::getLinksetPhysicsCost() return mLinksetPhysicsCost; } -F32 LLViewerObject::getStreamingCost() +F32 LLViewerObject::getStreamingCost(S32* bytes, S32* visible_bytes) { return 0.f; } -- cgit v1.2.3 From 844c3ec724c0183c6158ca742404018ad8deb9b5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 4 Apr 2011 12:19:14 -0500 Subject: SH-477 Scene stats console work in progress. --- indra/newview/llviewerobject.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 70b1809033..207e15ff1a 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3144,6 +3144,11 @@ U32 LLViewerObject::getTriangleCount() return 0; } +U32 LLViewerObject::getHighLODTriangleCount() +{ + return 0; +} + void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) { LLVector4a center; -- cgit v1.2.3 From feccb5b84c7ffcfe98a9afd042c7ca44b8717aaf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 7 Apr 2011 19:18:02 -0500 Subject: SH-1292 Add streaming and physics cost to stats console. --- 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 207e15ff1a..a5b59e8281 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -240,6 +240,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mState(0), mMedia(NULL), mClickAction(0), + mObjectCost(0), + mLinksetCost(0), + mPhysicsCost(0), mLinksetPhysicsCost(0.f), mCostStale(true), mPhysicsShapeUnknown(true), -- cgit v1.2.3