summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-05-30 20:05:57 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-05-30 20:05:57 -0700
commitd00192c9cbeaace7c1b7c09bfb86a5b5d8dff458 (patch)
tree01d01a1297154b68f8c31dba310058f389170cae
parent3352a1eac15f752535b636866eeb966ec3900c62 (diff)
Pulling in the new character fields from the CharacterProperties service.
-rw-r--r--indra/newview/llpathfindingcharacter.cpp57
-rw-r--r--indra/newview/llpathfindingcharacter.h18
2 files changed, 70 insertions, 5 deletions
diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp
index 61c2e39d63..0696783bf7 100644
--- a/indra/newview/llpathfindingcharacter.cpp
+++ b/indra/newview/llpathfindingcharacter.cpp
@@ -32,7 +32,10 @@
#include "llpathfindingobject.h"
#include "llsd.h"
-#define CHARACTER_CPU_TIME_FIELD "cpu_time"
+#define CHARACTER_CPU_TIME_FIELD "cpu_time"
+#define CHARACTER_HORIZONTAL_FIELD "horizontal"
+#define CHARACTER_LENGTH_FIELD "length"
+#define CHARACTER_RADIUS_FIELD "radius"
//---------------------------------------------------------------------------
// LLPathfindingCharacter
@@ -40,14 +43,26 @@
LLPathfindingCharacter::LLPathfindingCharacter(const std::string &pUUID, const LLSD& pCharacterData)
: LLPathfindingObject(pUUID, pCharacterData),
- mCPUTime(0U)
+ mCPUTime(0U),
+#ifndef SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ mHasShapeData(false),
+#endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ mIsHorizontal(FALSE),
+ mLength(0.0f),
+ mRadius(0.0f)
{
parseCharacterData(pCharacterData);
}
LLPathfindingCharacter::LLPathfindingCharacter(const LLPathfindingCharacter& pOther)
: LLPathfindingObject(pOther),
- mCPUTime(pOther.mCPUTime)
+ mCPUTime(pOther.mCPUTime),
+#ifndef SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ mHasShapeData(pOther.mHasShapeData),
+#endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ mIsHorizontal(pOther.mIsHorizontal),
+ mLength(pOther.mLength),
+ mRadius(pOther.mRadius)
{
}
@@ -60,6 +75,12 @@ LLPathfindingCharacter& LLPathfindingCharacter::operator =(const LLPathfindingCh
dynamic_cast<LLPathfindingObject &>(*this) = pOther;
mCPUTime = pOther.mCPUTime;
+#ifndef SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ mHasShapeData = pOther.mHasShapeData;
+#endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ mIsHorizontal = pOther.mIsHorizontal;
+ mLength = pOther.mLength;
+ mRadius = pOther.mRadius;
return *this;
}
@@ -69,4 +90,34 @@ void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData)
llassert(pCharacterData.has(CHARACTER_CPU_TIME_FIELD));
llassert(pCharacterData.get(CHARACTER_CPU_TIME_FIELD).isReal());
mCPUTime = pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal();
+
+#ifndef SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ mHasShapeData = pCharacterData.has(CHARACTER_HORIZONTAL_FIELD);
+ if (mHasShapeData)
+ {
+ llassert(pCharacterData.has(CHARACTER_HORIZONTAL_FIELD));
+ llassert(pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).isBoolean());
+ mIsHorizontal = pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).asBoolean();
+
+ llassert(pCharacterData.has(CHARACTER_LENGTH_FIELD));
+ llassert(pCharacterData.get(CHARACTER_LENGTH_FIELD).isReal());
+ mLength = pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal();
+
+ llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD));
+ llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal());
+ mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal();
+ }
+#else // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ llassert(pCharacterData.has(CHARACTER_HORIZONTAL_FIELD));
+ llassert(pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).isBoolean());
+ mIsHorizontal = pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).asBoolean();
+
+ llassert(pCharacterData.has(CHARACTER_LENGTH_FIELD));
+ llassert(pCharacterData.get(CHARACTER_LENGTH_FIELD).isReal());
+ mLength = pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal();
+
+ llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD));
+ llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal());
+ mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal();
+#endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
}
diff --git a/indra/newview/llpathfindingcharacter.h b/indra/newview/llpathfindingcharacter.h
index b030959274..6887a99886 100644
--- a/indra/newview/llpathfindingcharacter.h
+++ b/indra/newview/llpathfindingcharacter.h
@@ -41,14 +41,28 @@ public:
LLPathfindingCharacter& operator =(const LLPathfindingCharacter& pOther);
- inline F32 getCPUTime() const {return mCPUTime;};
+ inline F32 getCPUTime() const {return mCPUTime;};
+
+#ifndef SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ inline bool hasShapeData() const {return mHasShapeData;};
+#endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ inline BOOL isHorizontal() const {return mIsHorizontal;};
+ inline F32 getLength() const {return mLength;};
+ inline F32 getRadius() const {return mRadius;};
protected:
private:
void parseCharacterData(const LLSD &pCharacterData);
- F32 mCPUTime;
+ F32 mCPUTime;
+
+#ifndef SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ bool mHasShapeData;
+#endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
+ BOOL mIsHorizontal;
+ F32 mLength;
+ F32 mRadius;
};
#endif // LL_LLPATHFINDINGCHARACTER_H