summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.h
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-01-08 14:50:31 -0700
committerXiaohong Bao <bao@lindenlab.com>2013-01-08 14:50:31 -0700
commit8315e9745398c1c3215ffe1b3bfbfb6c7d16291d (patch)
tree6e894381a62c0fb8656d2e0720b62d1beda3c06e /indra/newview/lldrawable.h
parent68413515029f50713c70e4adec3ce6fd1022d59f (diff)
parent1fbd45672fcb1e5bfc194712fc7d0d4847a651cd (diff)
Merge
Diffstat (limited to 'indra/newview/lldrawable.h')
-rw-r--r--indra/newview/lldrawable.h77
1 files changed, 29 insertions, 48 deletions
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index abfdea2699..9521287a45 100644
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -42,6 +42,7 @@
#include "llviewerobject.h"
#include "llrect.h"
#include "llappviewer.h" // for gFrameTimeSeconds
+#include "llvieweroctree.h"
class LLCamera;
class LLDrawPool;
@@ -59,12 +60,10 @@ const U32 SILHOUETTE_HIGHLIGHT = 0;
// All data for new renderer goes into this class.
LL_ALIGN_PREFIX(16)
-class LLDrawable
-: public LLRefCount,
- public LLTrace::MemTrackable<LLDrawable>
+class LLDrawable : public LLViewerOctreeEntryData, public LLTrace::MemTrackable<LLDrawable>
{
public:
- LLDrawable(const LLDrawable& rhs)
+ LLDrawable(const LLDrawable& rhs) : LLViewerOctreeEntryData(rhs)
{
*this = rhs;
}
@@ -87,19 +86,17 @@ public:
ll_aligned_free_16(ptr);
}
- LLDrawable() { init(); }
+ LLDrawable(LLViewerObject *vobj, bool new_entry = false);
void markDead(); // Mark this drawable as dead
BOOL isDead() const { return isState(DEAD); }
BOOL isNew() const { return !isState(BUILT); }
BOOL isLight() const;
-
- BOOL isVisible() const;
- BOOL isRecentlyVisible() const;
+
virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE);
-
+ LLSpatialGroup* getSpatialGroup()const {return (LLSpatialGroup*)getGroup();}
LLViewerRegion* getRegion() const { return mVObjp->getRegion(); }
const LLTextureEntry* getTextureEntry(U8 which) const { return mVObjp->getTE(which); }
LLPointer<LLViewerObject>& getVObj() { return mVObjp; }
@@ -112,17 +109,13 @@ public:
const LLVector3& getPosition() const { return mXform.getPosition(); }
const LLVector3& getWorldPosition() const { return mXform.getPositionW(); }
const LLVector3 getPositionAgent() const;
- const LLVector4a& getPositionGroup() const { return mPositionGroup; }
const LLVector3& getScale() const { return mCurrentScale; }
void setScale(const LLVector3& scale) { mCurrentScale = scale; }
const LLQuaternion& getWorldRotation() const { return mXform.getWorldRotation(); }
const LLQuaternion& getRotation() const { return mXform.getRotation(); }
F32 getIntensity() const { return llmin(mXform.getScale().mV[0], 4.f); }
S32 getLOD() const { return mVObjp ? mVObjp->getLOD() : 1; }
- F32 getBinRadius() const { return mBinRadius; }
- S32 getBinIndex() const { return mBinIndex; }
- void setBinIndex(S32 index) const { mBinIndex = index; }
-
+
void getMinMax(LLVector3& min,LLVector3& max) const { mXform.getMinMax(min,max); }
LLXformMatrix* getXform() { return &mXform; }
@@ -152,7 +145,7 @@ public:
void setNumFacesFast(const S32 numFaces, LLFacePool *poolp, LLViewerTexture *texturep);
void mergeFaces(LLDrawable* src);
- void init();
+ void init(bool new_entry);
void destroy();
void update();
@@ -183,8 +176,12 @@ public:
BOOL getLit() const { return isState(UNLIT) ? FALSE : TRUE; }
void setLit(BOOL lit) { lit ? clearState(UNLIT) : setState(UNLIT); }
+ bool isVisible() const;
+ bool isRecentlyVisible() const;
+
virtual void cleanupReferences();
+ void setGroup(LLviewerOctreeGroup* group);
void setRadius(const F32 radius);
F32 getRadius() const { return mRadius; }
F32 getVisibilityRadius() const;
@@ -194,11 +191,6 @@ public:
const LLVector3& getBounds(LLVector3& min, LLVector3& max) const;
virtual void updateSpatialExtents();
virtual void updateBinRadius();
- const LLVector4a* getSpatialExtents() const;
- void setSpatialExtents(const LLVector3& min, const LLVector3& max);
- void setSpatialExtents(const LLVector4a& min, const LLVector4a& max);
-
- void setPositionGroup(const LLVector4a& pos);
void setRenderType(S32 type) { mRenderType = type; }
BOOL isRenderType(S32 type) { return mRenderType == type; }
@@ -207,10 +199,14 @@ public:
// Debugging methods
S32 findReferences(LLDrawable *drawablep); // Not const because of @#$! iterators...
- void setSpatialGroup(LLSpatialGroup *groupp);
- LLSpatialGroup *getSpatialGroup() const;
LLSpatialPartition* getSpatialPartition();
+ virtual S32 getMinVisFrameRange()const;
+ void removeFromOctree();
+
+ void setSpatialBridge(LLSpatialBridge* bridge) { mSpatialBridge = (LLDrawable*) bridge; }
+ LLSpatialBridge* getSpatialBridge() { return (LLSpatialBridge*) (LLDrawable*) mSpatialBridge; }
+
// Statics
static void incrementVisible();
static void cleanupDeadDrawables();
@@ -294,10 +290,6 @@ public:
ANIMATED_CHILD = 0x20000000,
ACTIVE_CHILD = 0x40000000,
} EDrawableFlags;
-
-private: //aligned members
- LL_ALIGN_16(LLVector4a mExtents[2]);
- LL_ALIGN_16(LLVector4a mPositionGroup);
public:
LLXformMatrix mXform;
@@ -305,13 +297,7 @@ public:
// vis data
LLPointer<LLDrawable> mParent;
- F32 mDistanceWRTCamera;
-
- static S32 getCurrentFrame() { return sCurVisible; }
- static S32 getMinVisFrameRange();
-
- void setSpatialBridge(LLSpatialBridge* bridge) { mSpatialBridge = (LLDrawable*) bridge; }
- LLSpatialBridge* getSpatialBridge() { return (LLSpatialBridge*) (LLDrawable*) mSpatialBridge; }
+ F32 mDistanceWRTCamera;
static F32 sCurPixelAngle; //current pixels per radian
static LLTrace::MemStat sMemStat;
@@ -319,23 +305,18 @@ public:
private:
typedef std::vector<LLFace*> face_list_t;
- U32 mState;
- S32 mRenderType;
- LLPointer<LLViewerObject> mVObjp;
- face_list_t mFaces;
- LLSpatialGroup* mSpatialGroupp;
- LLPointer<LLDrawable> mSpatialBridge;
+ U32 mState;
+ S32 mRenderType;
+ LLPointer<LLViewerObject> mVObjp;
+ face_list_t mFaces;
+ LLPointer<LLDrawable> mSpatialBridge;
+
+ F32 mRadius;
+ S32 mGeneration;
- mutable U32 mVisible;
- F32 mRadius;
- F32 mBinRadius;
- mutable S32 mBinIndex;
- S32 mGeneration;
+ LLVector3 mCurrentScale;
- LLVector3 mCurrentScale;
-
- static U32 sCurVisible; // Counter for what value of mVisible means currently visible
- static U32 sNumZombieDrawables;
+ static U32 sNumZombieDrawables;
static LLDynamicArrayPtr<LLPointer<LLDrawable> > sDeadList;
} LL_ALIGN_POSTFIX(16);