Picked up a few small changes from viewer-beta pertaining to pathfinding.

This commit is contained in:
Shyotl
2012-10-22 03:08:51 -05:00
parent 9ef10b1663
commit 7dea357f4c
2 changed files with 14 additions and 10 deletions

View File

@@ -5460,9 +5460,12 @@ BOOL LLViewerObject::setFlagsWithoutUpdate(U32 flags, BOOL state)
void LLViewerObject::setPhysicsShapeType(U8 type)
{
mPhysicsShapeUnknown = false;
if (type != mPhysicsShapeType)
{
mPhysicsShapeType = type;
mCostStale = true;
}
}
void LLViewerObject::setPhysicsGravity(F32 gravity)
{
@@ -5488,7 +5491,6 @@ U8 LLViewerObject::getPhysicsShapeType() const
{
if (mPhysicsShapeUnknown)
{
mPhysicsShapeUnknown = false;
gObjectList.updatePhysicsFlags(this);
}

View File

@@ -92,6 +92,8 @@ extern BOOL gAnimateTextures;
#include "importtracker.h"
extern ImportTracker gImportTracker;
#define MAX_CONCURRENT_PHYSICS_REQUESTS 256
void dialog_refresh_all();
#define CULL_VIS
@@ -1083,8 +1085,6 @@ void LLViewerObjectList::fetchObjectCosts()
LLSD id_list;
U32 object_index = 0;
U32 count = 0;
for (
std::set<LLUUID>::iterator iter = mStaleObjectCost.begin();
iter != mStaleObjectCost.end();
@@ -1101,7 +1101,7 @@ void LLViewerObjectList::fetchObjectCosts()
mStaleObjectCost.erase(iter++);
if (count++ >= 450)
if (object_index >= MAX_CONCURRENT_PHYSICS_REQUESTS)
{
break;
}
@@ -1146,7 +1146,7 @@ void LLViewerObjectList::fetchPhysicsFlags()
for (
std::set<LLUUID>::iterator iter = mStalePhysicsFlags.begin();
iter != mStalePhysicsFlags.end();
++iter)
)
{
// Check to see if a request for this object
// has already been made.
@@ -1156,12 +1156,14 @@ void LLViewerObjectList::fetchPhysicsFlags()
mPendingPhysicsFlags.insert(*iter);
id_list[object_index++] = *iter;
}
}
// id_list should now contain all
// requests in mStalePhysicsFlags before, so clear
// it now
mStalePhysicsFlags.clear();
mStalePhysicsFlags.erase(iter++);
if (object_index >= MAX_CONCURRENT_PHYSICS_REQUESTS)
{
break;
}
}
if ( id_list.size() > 0 )
{