#include "llviewerprecompiledheaders.h"
#include "llspatialpartition.h"
#include "llviewerwindow.h"
#include "llviewerobjectlist.h"
#include "llvovolume.h"
#include "llviewercamera.h"
#include "llface.h"
#include "llviewercontrol.h"
#include "llagent.h"
#include "llviewerregion.h"
#include "llcamera.h"
#include "pipeline.h"
#include "llglimmediate.h"
#include "lloctree.h"
Go to the source code of this file.
Copyright (c) 2003-2008, Linden Research, Inc.
Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$
Definition in file llspatialpartition.cpp.
#define assert_octree_valid | ( | x | ) |
Definition at line 56 of file llspatialpartition.cpp.
Referenced by LLSpatialPartition::move(), LLSpatialPartition::put(), and LLSpatialPartition::remove().
#define assert_states_valid | ( | x | ) |
Definition at line 57 of file llspatialpartition.cpp.
Referenced by LLSpatialGroup::checkOcclusion(), LLSpatialGroup::doOcclusion(), and LLSpatialGroup::handleChildAddition().
#define SG_DISCARD_TOLERANCE 0.01f |
Definition at line 50 of file llspatialpartition.cpp.
#define validate_drawable | ( | x | ) |
Definition at line 112 of file llspatialpartition.cpp.
Referenced by LLSpatialGroup::addObject(), LLSpatialPartition::put(), and LLSpatialGroup::updateInGroup().
enum eLoveTheBits |
Definition at line 151 of file llspatialpartition.cpp.
S32 AABBSphereIntersect | ( | const LLVector3 & | min, | |
const LLVector3 & | max, | |||
const LLVector3 & | origin, | |||
const F32 & | rad | |||
) |
Definition at line 116 of file llspatialpartition.cpp.
References d, i, LLVector3::mV, and r.
Referenced by LLOctreeCull::frustumCheck(), LLOctreeCull::frustumCheckObjects(), and LLSpatialBridge::setVisible().
Definition at line 1647 of file llspatialpartition.cpp.
References LLGLImmediate::begin(), LLGLImmediate::end(), gGL, LLVector3::scaledVec(), LLVertexBuffer::TRIANGLE_STRIP, and LLGLImmediate::vertex3fv().
Referenced by renderOctree(), and renderTexturePriority().
Definition at line 1684 of file llspatialpartition.cpp.
References LLGLImmediate::begin(), LLGLImmediate::end(), gGL, LLVertexBuffer::LINES, LLVector3::scaledVec(), and LLGLImmediate::vertex3fv().
Referenced by renderBoundingBox(), renderLights(), and renderOctree().
BOOL earlyFail | ( | LLCamera * | camera, | |
LLSpatialGroup * | group | |||
) |
Definition at line 1807 of file llspatialpartition.cpp.
References FALSE, LLStat::getCurrent(), LLSingleton< LLViewerCamera >::getInstance(), LLCoordFrame::getOrigin(), LLViewerCamera::getVelocityStat(), j, LLVector3::magVecSquared(), LLSpatialGroup::mBounds, LLVector3::mV, r, SG_OCCLUSION_FUDGE, and TRUE.
Referenced by LLSpatialGroup::doOcclusion(), and LLOctreeCull::traverse().
Definition at line 186 of file llspatialpartition.cpp.
References b001, b010, b100, d, LLCoordFrame::getOrigin(), and LLVector3::mV.
Referenced by LLSpatialGroup::doOcclusion(), and renderVisibility().
BOOL LLLineSegmentAABB | ( | const LLVector3 & | start, | |
const LLVector3 & | end, | |||
const LLVector3 & | center, | |||
const LLVector3 & | size | |||
) |
Definition at line 245 of file llspatialpartition.cpp.
References i, and LLVector3::mV.
Referenced by LLOctreePick::check(), and LLVOVolume::lineSegmentIntersect().
void pushBufferVerts | ( | LLSpatialGroup * | group, | |
U32 | mask | |||
) |
Definition at line 1952 of file llspatialpartition.cpp.
References LLRenderPass::applyModelMatrix(), i, j, LLSpatialGroup::mBufferMap, LLSpatialGroup::mDrawMap, LLSpatialGroup::mVertexBuffer, and pushBufferVerts().
void pushBufferVerts | ( | LLVertexBuffer * | buffer, | |
U32 | mask | |||
) |
Definition at line 1943 of file llspatialpartition.cpp.
References LLVertexBuffer::drawRange(), LLVertexBuffer::getRequestedIndices(), LLVertexBuffer::getRequestedVerts(), LLVertexBuffer::setBuffer(), and LLVertexBuffer::TRIANGLES.
Referenced by pushBufferVerts(), and renderVisibility().
Definition at line 1927 of file llspatialpartition.cpp.
References LLVertexBuffer::drawRange(), LLFace::getGeomCount(), LLFace::getGeomStart(), LLFace::getIndicesCount(), LLFace::getIndicesStart(), LLFace::mVertexBuffer, LLVertexBuffer::setBuffer(), and LLVertexBuffer::TRIANGLES.
void pushVerts | ( | LLSpatialGroup * | group, | |
U32 | mask | |||
) |
Definition at line 1913 of file llspatialpartition.cpp.
References i, j, LLSpatialGroup::mDrawMap, NULL, and pushVerts().
void pushVerts | ( | LLDrawInfo * | params, | |
U32 | mask | |||
) |
Definition at line 1905 of file llspatialpartition.cpp.
References LLRenderPass::applyModelMatrix(), LLDrawInfo::mCount, LLDrawInfo::mEnd, LLDrawInfo::mOffset, LLDrawInfo::mParticle, LLDrawInfo::mStart, LLDrawInfo::mVertexBuffer, LLVertexBuffer::POINTS, and LLVertexBuffer::TRIANGLES.
Referenced by pushVerts(), renderBatchSize(), renderLights(), and renderTextureAnim().
void pushVertsColorCoded | ( | LLSpatialGroup * | group, | |
U32 | mask | |||
) |
Definition at line 1971 of file llspatialpartition.cpp.
References LLRenderPass::applyModelMatrix(), LLColor4::green, LLColor4::green1, LLColor4::green2, LLColor4::green3, LLColor4::green4, LLColor4::green5, LLColor4::green6, i, j, LLDrawInfo::mCount, LLSpatialGroup::mDrawMap, LLDrawInfo::mEnd, LLDrawInfo::mOffset, LLDrawInfo::mParticle, LLDrawInfo::mStart, LLDrawInfo::mVertexBuffer, NULL, LLVertexBuffer::POINTS, and LLVertexBuffer::TRIANGLES.
void renderBatchSize | ( | LLDrawInfo * | params | ) |
Definition at line 2339 of file llspatialpartition.cpp.
References LLVertexBuffer::MAP_VERTEX, LLDrawInfo::mDebugColor, and pushVerts().
Referenced by LLOctreeRenderNonOccluded::visit().
void renderBoundingBox | ( | LLDrawable * | drawable | ) |
Definition at line 2170 of file llspatialpartition.cpp.
References LLGLImmediate::color4f(), drawBoxOutline(), LLGLImmediate::flush(), LLDrawable::getFace(), LLDrawable::getNumFaces(), LLDrawable::getSpatialExtents(), LLDrawable::getVObj(), LLDrawable::getVOVolume(), gFrameTimeSeconds, gGL, i, LLDrawable::isRoot(), LLDrawable::isSpatialBridge(), LL_PCODE_LEGACY_TREE, LLViewerObject::LL_VO_CLOUDS, LLViewerObject::LL_VO_PART_GROUP, LLViewerObject::LL_VO_SURFACE_PATCH, LLViewerObject::LL_VO_WATER, LLFace::mExtents, LLViewerObject::onActiveList(), S32, and sinf.
Referenced by LLOctreeRenderNonOccluded::visit().
void renderLights | ( | LLDrawable * | drawablep | ) |
Definition at line 2345 of file llspatialpartition.cpp.
References LLGLImmediate::color4f(), drawBoxOutline(), LLDrawable::getFace(), LLVOVolume::getLightRadius(), LLDrawable::getNumFaces(), LLDrawable::getSpatialExtents(), LLDrawable::getVOVolume(), gGL, i, LLDrawable::isLight(), LLVertexBuffer::MAP_VERTEX, pushVerts(), and S32.
Referenced by LLOctreeRenderNonOccluded::visit().
void renderOctree | ( | LLSpatialGroup * | group | ) |
Definition at line 2004 of file llspatialpartition.cpp.
References LLGLImmediate::blendFunc(), LLGLImmediate::color4f(), LLGLImmediate::color4fv(), drawBox(), drawBoxOutline(), FALSE, LLGLImmediate::flush(), LLSpatialGroup::getData(), LLDrawable::getFace(), LLFace::getIndicesCount(), LLFace::getIndicesStart(), LLDrawable::getNumFaces(), LLViewerRegion::getOriginAgent(), LLDrawable::getRegion(), gFrameIntervalSeconds, gFrameTimeSeconds, gGL, i, LLSpatialPartition::isBridge(), j, LLVertexBuffer::MAP_VERTEX, LLSpatialGroup::mBounds, LLSpatialGroup::mBufferUsage, LLSpatialGroup::mBuilt, LLFace::mLastMoveTime, LLFace::mLastUpdateTime, LLSpatialGroup::mObjectBounds, LLSpatialGroup::mOctreeNode, LLSpatialPartition::mRenderByGroup, LLSpatialGroup::mSpatialPartition, LLVector4::mV, LLVector3::mV, LLFace::mVertexBuffer, LLPointer< Type >::notNull(), S32, LLVector4::setVec(), and LLVertexBuffer::TRIANGLES.
Referenced by LLOctreeRenderNonOccluded::traverse().
void renderPoints | ( | LLDrawable * | drawablep | ) |
Definition at line 2311 of file llspatialpartition.cpp.
References LLGLImmediate::begin(), LLGLImmediate::color3f(), LLGLImmediate::end(), LLDrawable::getFace(), LLDrawable::getNumFaces(), LLDrawable::getPositionGroup(), gGL, i, LLFace::mCenterLocal, LLVector3::mV, LLVertexBuffer::POINTS, S32, and LLGLImmediate::vertex3fv().
Referenced by LLOctreeRenderNonOccluded::visit().
void renderTextureAnim | ( | LLDrawInfo * | params | ) |
Definition at line 2327 of file llspatialpartition.cpp.
References LLGLImmediate::color4f(), gGL, LLVertexBuffer::MAP_VERTEX, LLDrawInfo::mTextureMatrix, and pushVerts().
Referenced by LLOctreeRenderNonOccluded::visit().
void renderTexturePriority | ( | LLDrawable * | drawable | ) |
Definition at line 2256 of file llspatialpartition.cpp.
References LLGLImmediate::color4fv(), drawBox(), LLDrawable::getFace(), LLDrawable::getNumFaces(), LLFace::getPixelArea(), gGL, lerp(), LLFace::mExtents, LLVector4::mV, sCurMaxTexPriority, and sLastMaxTexPriority.
Referenced by LLOctreeRenderNonOccluded::visit().
void renderVisibility | ( | LLSpatialGroup * | group, | |
LLCamera * | camera | |||
) |
Definition at line 2122 of file llspatialpartition.cpp.
References LLGLImmediate::blendFunc(), LLSpatialPartition::cull(), get_occlusion_indices(), LLSpatialGroup::getData(), gGL, LLSpatialGroup::isState(), LLSpatialGroup::isVisible(), LLVertexBuffer::MAP_VERTEX, LLSpatialGroup::mBounds, LLSpatialGroup::mOcclusionVerts, LLSpatialGroup::OCCLUDED, pushBufferVerts(), LLPipeline::sUseOcclusion, and LLVertexBuffer::unbind().
Referenced by LLOctreeRenderNonOccluded::traverse().
void sg_assert | ( | BOOL | expr | ) |
Definition at line 89 of file llspatialpartition.cpp.
References llendl, and llerrs.
Referenced by LLSpatialGroup::LLSpatialGroup(), and LLSpatialGroup::validate().
void validate_draw_info | ( | LLDrawInfo & | params | ) |
Definition at line 455 of file llspatialpartition.cpp.
References i, LLPointer< Type >::isNull(), llendl, llerrs, LLDrawInfo::mCount, LLDrawInfo::mEnd, LLDrawInfo::mOffset, LLDrawInfo::mStart, and LLDrawInfo::mVertexBuffer.
Referenced by LLVolumeGeometryManager::registerFace(), and LLSpatialGroup::validateDrawMap().
F32 sCurMaxTexPriority = 1.f [static] |
Definition at line 65 of file llspatialpartition.cpp.
Referenced by LLSpatialPartition::renderDebug(), and renderTexturePriority().
const F32 SG_OCCLUSION_FUDGE = 1.01f |
Definition at line 49 of file llspatialpartition.cpp.
Referenced by LLSpatialGroup::buildOcclusion(), and earlyFail().
F32 sLastMaxTexPriority = 1.f [static] |
Definition at line 64 of file llspatialpartition.cpp.
Referenced by LLSpatialPartition::renderDebug(), and renderTexturePriority().
U8 sOcclusionIndices[] [static] |
Initial value:
{ b111, b110, b010, b011, b001, b101, b100, b110, b110, b000, b010, b011, b111, b101, b100, b000, b101, b100, b110, b111, b011, b001, b000, b100, b100, b010, b110, b111, b101, b001, b000, b010, b011, b010, b000, b001, b101, b111, b110, b010, b010, b100, b000, b001, b011, b111, b110, b100, b001, b000, b100, b101, b111, b011, b010, b000, b000, b110, b100, b101, b001, b011, b010, b110, }
Definition at line 166 of file llspatialpartition.cpp.
LLOcclusionQueryPool sQueryPool [static] |
Definition at line 83 of file llspatialpartition.cpp.
U32 sZombieGroups = 0 [static] |
Definition at line 61 of file llspatialpartition.cpp.
Referenced by LLSpatialGroup::handleDestruction(), and LLSpatialGroup::~LLSpatialGroup().