diff options
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpathfindinglinksets.cpp | 72 | ||||
-rw-r--r-- | indra/newview/llpathfindinglinksets.h | 46 |
3 files changed, 29 insertions, 91 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index ed3b06e6de..433e3c9866 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -751,7 +751,7 @@ void LLFloaterPathfindingLinksets::updateLinksetsList() columns[2]["font"] = "SANSSERIF";
columns[3]["column"] = "dist_from_you";
- columns[3]["value"] = llformat("%1.0f m", dist_vec(avatarPosition, linkset.getPositionAgent()));
+ columns[3]["value"] = llformat("%1.0f m", dist_vec(avatarPosition, linkset.getLocation()));
columns[3]["font"] = "SANSSERIF";
columns[4]["column"] = "path_state";
diff --git a/indra/newview/llpathfindinglinksets.cpp b/indra/newview/llpathfindinglinksets.cpp index 0d9abb289f..57623e0e43 100644 --- a/indra/newview/llpathfindinglinksets.cpp +++ b/indra/newview/llpathfindinglinksets.cpp @@ -199,40 +199,6 @@ LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkse return *this;
}
-const LLUUID& LLPathfindingLinkset::getUUID() const
-{
- return mUUID;
-}
-
-const std::string& LLPathfindingLinkset::getName() const
-{
- return mName;
-}
-
-const std::string& LLPathfindingLinkset::getDescription() const
-{
- return mDescription;
-}
-
-U32 LLPathfindingLinkset::getLandImpact() const
-{
- return mLandImpact;
-}
-
-const LLVector3& LLPathfindingLinkset::getPositionAgent() const
-{
- return mLocation;
-}
-
-LLPathfindingLinkset::EPathState LLPathfindingLinkset::getPathState() const
-{
- return mPathState;
-}
-
-void LLPathfindingLinkset::setPathState(EPathState pPathState)
-{
- mPathState = pPathState;
-}
LLPathfindingLinkset::EPathState LLPathfindingLinkset::getPathState(bool pIsPermanent, bool pIsWalkable)
{
@@ -283,54 +249,24 @@ BOOL LLPathfindingLinkset::isWalkable(EPathState pPathState) return retVal;
}
-BOOL LLPathfindingLinkset::isPhantom() const
-{
- return mIsPhantom;
-}
-
-void LLPathfindingLinkset::setPhantom(BOOL pIsPhantom)
-{
- mIsPhantom = pIsPhantom;
-}
-
-S32 LLPathfindingLinkset::getWalkabilityCoefficientA() const
-{
- return mWalkabilityCoefficientA;
-}
-
void LLPathfindingLinkset::setWalkabilityCoefficientA(S32 pA)
{
- mWalkabilityCoefficientA = pA;
-}
-
-S32 LLPathfindingLinkset::getWalkabilityCoefficientB() const
-{
- return mWalkabilityCoefficientB;
+ mWalkabilityCoefficientA = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
}
void LLPathfindingLinkset::setWalkabilityCoefficientB(S32 pB)
{
- mWalkabilityCoefficientB = pB;
-}
-
-S32 LLPathfindingLinkset::getWalkabilityCoefficientC() const
-{
- return mWalkabilityCoefficientC;
+ mWalkabilityCoefficientB = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
}
void LLPathfindingLinkset::setWalkabilityCoefficientC(S32 pC)
{
- mWalkabilityCoefficientC = pC;
-}
-
-S32 LLPathfindingLinkset::getWalkabilityCoefficientD() const
-{
- return mWalkabilityCoefficientD;
+ mWalkabilityCoefficientC = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
}
void LLPathfindingLinkset::setWalkabilityCoefficientD(S32 pD)
{
- mWalkabilityCoefficientD = pD;
+ mWalkabilityCoefficientD = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
}
LLSD LLPathfindingLinkset::getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const
diff --git a/indra/newview/llpathfindinglinksets.h b/indra/newview/llpathfindinglinksets.h index 42f19b5872..e632be5257 100644 --- a/indra/newview/llpathfindinglinksets.h +++ b/indra/newview/llpathfindinglinksets.h @@ -28,7 +28,6 @@ #ifndef LL_LLPATHFINDINGLINKSETS_H
#define LL_LLPATHFINDINGLINKSETS_H
-#include "llsd.h"
#include "v3math.h"
#include "lluuid.h"
@@ -36,6 +35,8 @@ // walkability coefficients from F32 to S32 representing the percentage from 0-100.
#define XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE
+class LLSD;
+
class LLPathfindingLinkset
{
public:
@@ -52,34 +53,35 @@ public: LLPathfindingLinkset& operator = (const LLPathfindingLinkset& pOther);
- const LLUUID& getUUID() const;
- const std::string& getName() const;
- const std::string& getDescription() const;
- U32 getLandImpact() const;
- const LLVector3& getPositionAgent() const;
+ inline const LLUUID& getUUID() const {return mUUID;};
+ inline const std::string& getName() const {return mName;};
+ inline const std::string& getDescription() const {return mDescription;};
+ inline U32 getLandImpact() const {return mLandImpact;};
+ inline const LLVector3& getLocation() const {return mLocation;};
+
+ inline EPathState getPathState() const {return mPathState;};
+ inline void setPathState(EPathState pPathState) {mPathState = pPathState;};
- EPathState getPathState() const;
- void setPathState(EPathState pPathState);
- static EPathState getPathState(bool pIsPermanent, bool pIsWalkable);
- static BOOL isPermanent(EPathState pPathState);
- static BOOL isWalkable(EPathState pPathState);
+ static EPathState getPathState(bool pIsPermanent, bool pIsWalkable);
+ static BOOL isPermanent(EPathState pPathState);
+ static BOOL isWalkable(EPathState pPathState);
- BOOL isPhantom() const;
- void setPhantom(BOOL pIsPhantom);
+ inline BOOL isPhantom() const {return mIsPhantom;};
+ inline void setPhantom(BOOL pIsPhantom) {mIsPhantom = pIsPhantom;};
- S32 getWalkabilityCoefficientA() const;
- void setWalkabilityCoefficientA(S32 pA);
+ inline S32 getWalkabilityCoefficientA() const {return mWalkabilityCoefficientA;};
+ void setWalkabilityCoefficientA(S32 pA);
- S32 getWalkabilityCoefficientB() const;
- void setWalkabilityCoefficientB(S32 pB);
+ inline S32 getWalkabilityCoefficientB() const {return mWalkabilityCoefficientB;};
+ void setWalkabilityCoefficientB(S32 pB);
- S32 getWalkabilityCoefficientC() const;
- void setWalkabilityCoefficientC(S32 pC);
+ inline S32 getWalkabilityCoefficientC() const {return mWalkabilityCoefficientC;};
+ void setWalkabilityCoefficientC(S32 pC);
- S32 getWalkabilityCoefficientD() const;
- void setWalkabilityCoefficientD(S32 pD);
+ inline S32 getWalkabilityCoefficientD() const {return mWalkabilityCoefficientD;};
+ void setWalkabilityCoefficientD(S32 pD);
- LLSD getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const;
+ LLSD getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const;
protected:
|