diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-08-09 12:06:09 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-08-09 12:06:09 -0700 |
commit | 9488baada3c0aec7cfa4256708fdda82861cd502 (patch) | |
tree | 1f71293b54161733269a6f340574ec4960623d0f /indra/llmath/llvolumeoctree.h | |
parent | de08d74dc6da594c20aed3673114cbc0ef6d3305 (diff) | |
parent | 1869a399beb2cb3fa52d21f9c288f4c3b6ab4deb (diff) |
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-beta.
Diffstat (limited to 'indra/llmath/llvolumeoctree.h')
-rw-r--r-- | indra/llmath/llvolumeoctree.h | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h index 688d91dc40..9ae34a0c4e 100644 --- a/indra/llmath/llvolumeoctree.h +++ b/indra/llmath/llvolumeoctree.h @@ -37,9 +37,19 @@ class LLVolumeTriangle : public LLRefCount { public: + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + LLVolumeTriangle() { - + mBinIndex = -1; } LLVolumeTriangle(const LLVolumeTriangle& rhs) @@ -58,21 +68,38 @@ public: } - LLVector4a mPositionGroup; + LL_ALIGN_16(LLVector4a mPositionGroup); const LLVector4a* mV[3]; U16 mIndex[3]; F32 mRadius; + mutable S32 mBinIndex; + virtual const LLVector4a& getPositionGroup() const; virtual const F32& getBinRadius() const; + + S32 getBinIndex() const { return mBinIndex; } + void setBinIndex(S32 idx) const { mBinIndex = idx; } + + }; class LLVolumeOctreeListener : public LLOctreeListener<LLVolumeTriangle> { public: + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + LLVolumeOctreeListener(LLOctreeNode<LLVolumeTriangle>* node); ~LLVolumeOctreeListener(); @@ -99,8 +126,8 @@ public: public: - LLVector4a mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects) - LLVector4a mExtents[2]; // extents (min, max) of this node and all its children + LL_ALIGN_16(LLVector4a mBounds[2]); // bounding box (center, size) of this node and all its children (tight fit to objects) + LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children }; class LLOctreeTriangleRayIntersect : public LLOctreeTraveler<LLVolumeTriangle> |