llspatialpartition.cpp File Reference

LLSpatialGroup class implementation and supporting functions. More...

#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"

Include dependency graph for llspatialpartition.cpp:

Go to the source code of this file.

Classes

class  LLOcclusionQueryPool
class  LLOctreeStateCheck
class  LLSpatialSetState
class  LLSpatialSetStateDiff
class  LLSpatialClearState
class  LLSpatialClearStateDiff
class  LLSpatialShift
class  LLOctreeCull
class  LLOctreeCullNoFarClip
class  LLOctreeSelect
class  LLOctreeDirty
class  LLOctreeRenderNonOccluded
class  LLOctreePick

Defines

#define SG_DISCARD_TOLERANCE   0.01f
#define assert_octree_valid(x)
#define assert_states_valid(x)
#define validate_drawable(x)

Enumerations

enum  eLoveTheBits {
  b000 = 0x00, b001 = 0x01, b010 = 0x02, b011 = 0x03,
  b100 = 0x04, b101 = 0x05, b110 = 0x06, b111 = 0x07
}

Functions

void sg_assert (BOOL expr)
S32 AABBSphereIntersect (const LLVector3 &min, const LLVector3 &max, const LLVector3 &origin, const F32 &rad)
U8get_occlusion_indices (LLCamera *camera, const LLVector3 &center)
BOOL earlyFail (LLCamera *camera, LLSpatialGroup *group)
BOOL LLLineSegmentAABB (const LLVector3 &start, const LLVector3 &end, const LLVector3 &center, const LLVector3 &size)
S32 LLSphereAABB (const LLVector3 &center, const LLVector3 &size, const LLVector3 &pos, const F32 &rad)
void validate_draw_info (LLDrawInfo &params)
void drawBox (const LLVector3 &c, const LLVector3 &r)
void drawBoxOutline (const LLVector3 &pos, const LLVector3 &size)
void pushVerts (LLDrawInfo *params, U32 mask)
void pushVerts (LLSpatialGroup *group, U32 mask)
void pushVerts (LLFace *face, U32 mask)
void pushBufferVerts (LLVertexBuffer *buffer, U32 mask)
void pushBufferVerts (LLSpatialGroup *group, U32 mask)
void pushVertsColorCoded (LLSpatialGroup *group, U32 mask)
void renderOctree (LLSpatialGroup *group)
void renderVisibility (LLSpatialGroup *group, LLCamera *camera)
void renderBoundingBox (LLDrawable *drawable)
void renderTexturePriority (LLDrawable *drawable)
void renderPoints (LLDrawable *drawablep)
void renderTextureAnim (LLDrawInfo *params)
void renderBatchSize (LLDrawInfo *params)
void renderLights (LLDrawable *drawablep)

Variables

const F32 SG_OCCLUSION_FUDGE = 1.01f
static U32 sZombieGroups = 0
static F32 sLastMaxTexPriority = 1.f
static F32 sCurMaxTexPriority = 1.f
static LLOcclusionQueryPool sQueryPool
static U8 sOcclusionIndices []


Detailed Description

LLSpatialGroup class implementation and supporting functions.

LicenseInfo
firstyear=2003&license=viewergpl

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 Documentation

#define assert_octree_valid (  ) 

#define assert_states_valid (  ) 

#define SG_DISCARD_TOLERANCE   0.01f

Definition at line 50 of file llspatialpartition.cpp.

#define validate_drawable (  ) 


Enumeration Type Documentation

Enumerator:
b000 
b001 
b010 
b011 
b100 
b101 
b110 
b111 

Definition at line 151 of file llspatialpartition.cpp.


Function Documentation

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().

Here is the caller graph for this function:

void drawBox ( const LLVector3 c,
const LLVector3 r 
)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void drawBoxOutline ( const LLVector3 pos,
const LLVector3 size 
)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL earlyFail ( LLCamera camera,
LLSpatialGroup group 
)

U8* get_occlusion_indices ( LLCamera camera,
const LLVector3 center 
)

Definition at line 186 of file llspatialpartition.cpp.

References b001, b010, b100, d, LLCoordFrame::getOrigin(), and LLVector3::mV.

Referenced by LLSpatialGroup::doOcclusion(), and renderVisibility().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

S32 LLSphereAABB ( const LLVector3 center,
const LLVector3 size,
const LLVector3 pos,
const F32 rad 
)

Definition at line 272 of file llspatialpartition.cpp.

References i, LLVector3::mV, and S32.

void pushBufferVerts ( LLSpatialGroup group,
U32  mask 
)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void pushVerts ( LLFace face,
U32  mask 
)

void pushVerts ( LLSpatialGroup group,
U32  mask 
)

Definition at line 1913 of file llspatialpartition.cpp.

References i, j, LLSpatialGroup::mDrawMap, NULL, and pushVerts().

Here is the call graph for this function:

void pushVerts ( LLDrawInfo params,
U32  mask 
)

void pushVertsColorCoded ( LLSpatialGroup group,
U32  mask 
)

void renderBatchSize ( LLDrawInfo params  ) 

Definition at line 2339 of file llspatialpartition.cpp.

References LLVertexBuffer::MAP_VERTEX, LLDrawInfo::mDebugColor, and pushVerts().

Referenced by LLOctreeRenderNonOccluded::visit().

Here is the call graph for this function:

Here is the caller graph for this function:

void renderBoundingBox ( LLDrawable drawable  ) 

void renderLights ( LLDrawable drawablep  ) 

void renderOctree ( LLSpatialGroup group  ) 

void renderPoints ( LLDrawable drawablep  ) 

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void renderVisibility ( LLSpatialGroup group,
LLCamera camera 
)

void sg_assert ( BOOL  expr  ) 

Definition at line 89 of file llspatialpartition.cpp.

References llendl, and llerrs.

Referenced by LLSpatialGroup::LLSpatialGroup(), and LLSpatialGroup::validate().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

F32 sCurMaxTexPriority = 1.f [static]

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]

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.

Definition at line 83 of file llspatialpartition.cpp.

U32 sZombieGroups = 0 [static]


Generated on Fri May 16 08:37:06 2008 for SecondLife by  doxygen 1.5.5