LLSurface Class Reference

#include <llsurface.h>

Collaboration diagram for LLSurface:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LLSurface (U32 type, LLViewerRegion *regionp=NULL)
virtual ~LLSurface ()
void create (const S32 surface_grid_width, const S32 surface_patch_width, const LLVector3d &origin_global, const F32 width)
void setRegion (LLViewerRegion *regionp)
void setOriginGlobal (const LLVector3d &origin_global)
void connectNeighbor (LLSurface *neighborp, U32 direction)
void disconnectNeighbor (LLSurface *neighborp)
void disconnectAllNeighbors ()
virtual void decompressDCTPatch (LLBitPack &bitpack, LLGroupHeader *gopp, BOOL b_large_patch)
virtual void updatePatchVisibilities (LLAgent &agent)
F32 getZ (const U32 k) const
F32 getZ (const S32 i, const S32 j) const
LLVector3 getOriginAgent () const
const LLVector3dgetOriginGlobal () const
F32 getMetersPerGrid () const
S32 getGridsPerEdge () const
S32 getPatchesPerEdge () const
S32 getGridsPerPatchEdge () const
U32 getRenderStride (const U32 render_level) const
U32 getRenderLevel (const U32 render_stride) const
F32 resolveHeightRegion (const F32 x, const F32 y) const
F32 resolveHeightRegion (const LLVector3 &location) const
F32 resolveHeightGlobal (const LLVector3d &position_global) const
LLVector3 resolveNormalGlobal (const LLVector3d &v) const
LLSurfacePatchresolvePatchRegion (const F32 x, const F32 y) const
LLSurfacePatchresolvePatchRegion (const LLVector3 &position_region) const
LLSurfacePatchresolvePatchGlobal (const LLVector3d &position_global) const
BOOL idleUpdate (F32 max_update_time)
BOOL containsPosition (const LLVector3 &position)
void moveZ (const S32 x, const S32 y, const F32 delta)
LLViewerRegiongetRegion () const
F32 getMinZ () const
F32 getMaxZ () const
void setWaterHeight (F32 height)
F32 getWaterHeight () const
LLViewerImagegetSTexture ()
LLViewerImagegetWaterTexture ()
BOOL hasZData () const
void dirtyAllPatches ()
void dirtySurfacePatch (LLSurfacePatch *patchp)
LLVOWatergetWaterObj ()

Static Public Member Functions

static void initClasses ()
static void setTextureSize (const S32 texture_size)

Public Attributes

S32 mGridsPerEdge
F32 mOOGridsPerEdge
S32 mPatchesPerEdge
S32 mNumberOfPatches
LLSurfacemNeighbors [8]
U32 mType
F32 mDetailTextureScale

Static Public Attributes

static F32 sTextureUpdateTime = 0.f
static S32 sTexelsUpdated = 0
static LLStat sTexelsUpdatedPerSecStat

Protected Member Functions

void createSTexture ()
void createWaterTexture ()
void initTextures ()
void initWater ()
void createPatchData ()
void destroyPatchData ()
BOOL generateWaterTexture (const F32 x, const F32 y, const F32 width, const F32 height)
LLSurfacePatchgetPatch (const S32 x, const S32 y) const

Protected Attributes

LLVector3d mOriginGlobal
LLSurfacePatchmPatchList
F32mSurfaceZ
LLVector3mNorm
std::set< LLSurfacePatch * > mDirtyPatchList
LLPointer< LLViewerImagemSTexturep
LLPointer< LLViewerImagemWaterTexturep
LLPointer< LLVOWatermWaterObjp
S32 mVisiblePatchCount
U32 mGridsPerPatchEdge
F32 mMetersPerGrid
F32 mMetersPerEdge
F32 mSurfaceTexScale
F32 mDetailTexScale
LLPatchVertexArray mPVArray
BOOL mHasZData
F32 mMinZ
F32 mMaxZ
S32 mSurfacePatchUpdateCount

Private Attributes

LLViewerRegionmRegionp

Static Private Attributes

static S32 sTextureSize = 256

Friends

class LLSurfacePatch
std::ostream & operator<< (std::ostream &s, const LLSurface &S)


Detailed Description

Definition at line 72 of file llsurface.h.


Constructor & Destructor Documentation

LLSurface::LLSurface ( U32  type,
LLViewerRegion regionp = NULL 
)

LLSurface::~LLSurface (  )  [virtual]


Member Function Documentation

void LLSurface::initClasses (  )  [static]

Definition at line 151 of file llsurface.cpp.

Referenced by idle_startup().

Here is the caller graph for this function:

void LLSurface::create ( const S32  surface_grid_width,
const S32  surface_patch_width,
const LLVector3d origin_global,
const F32  width 
)

void LLSurface::setRegion ( LLViewerRegion regionp  ) 

Definition at line 155 of file llsurface.cpp.

References mRegionp.

Referenced by LLViewerRegion::LLViewerRegion().

Here is the caller graph for this function:

void LLSurface::setOriginGlobal ( const LLVector3d origin_global  ) 

Definition at line 305 of file llsurface.cpp.

References LLSurfacePatch::getOriginGlobal(), getPatch(), i, j, LLVector3d::mdV, mGridsPerPatchEdge, mMetersPerGrid, mOriginGlobal, mPatchesPerEdge, mWaterObjp, LLPointer< Type >::notNull(), S32, LLSurfacePatch::setOriginGlobal(), VX, VY, and VZ.

Referenced by LLViewerRegion::setOriginGlobal().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLSurface::connectNeighbor ( LLSurface neighborp,
U32  direction 
)

void LLSurface::disconnectNeighbor ( LLSurface neighborp  ) 

Definition at line 531 of file llsurface.cpp.

References i, mNeighbors, mNumberOfPatches, mPatchList, NULL, and S32.

Referenced by disconnectAllNeighbors().

Here is the caller graph for this function:

void LLSurface::disconnectAllNeighbors (  ) 

Definition at line 550 of file llsurface.cpp.

References disconnectNeighbor(), i, mNeighbors, NULL, and S32.

Referenced by LLViewerRegion::disconnectAllNeighbors().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLSurface::decompressDCTPatch ( LLBitPack bitpack,
LLGroupHeader gopp,
BOOL  b_large_patch 
) [virtual]

void LLSurface::updatePatchVisibilities ( LLAgent agent  )  [virtual]

F32 LLSurface::getZ ( const U32  k  )  const [inline]

Definition at line 96 of file llsurface.h.

References mSurfaceZ.

Referenced by LLToolBrushLand::handleMouseDown(), LLToolBrushLand::modifyLandInSelectionGlobal(), LLToolBrushLand::renderOverlay(), and resolveHeightRegion().

Here is the caller graph for this function:

F32 LLSurface::getZ ( const S32  i,
const S32  j 
) const [inline]

Definition at line 97 of file llsurface.h.

References mGridsPerEdge, and mSurfaceZ.

LLVector3 LLSurface::getOriginAgent (  )  const

Definition at line 570 of file llsurface.cpp.

References gAgent, LLAgent::getPosAgentFromGlobal(), and mOriginGlobal.

Referenced by LLSurfacePatch::eval(), LLSurfacePatch::getTexCoords(), LLSurfacePatch::updateCompositionStats(), and LLSurfacePatch::updateVisibility().

Here is the call graph for this function:

Here is the caller graph for this function:

const LLVector3d & LLSurface::getOriginGlobal (  )  const

Definition at line 565 of file llsurface.cpp.

References mOriginGlobal.

Referenced by LLSurfacePatch::setOriginGlobal(), and LLSurfacePatch::updateTexture().

Here is the caller graph for this function:

F32 LLSurface::getMetersPerGrid (  )  const

S32 LLSurface::getGridsPerEdge (  )  const

S32 LLSurface::getPatchesPerEdge (  )  const

Definition at line 585 of file llsurface.cpp.

References mPatchesPerEdge.

S32 LLSurface::getGridsPerPatchEdge (  )  const

U32 LLSurface::getRenderStride ( const U32  render_level  )  const

Definition at line 1121 of file llsurface.cpp.

References mPVArray, and LLPatchVertexArray::mRenderStridep.

Referenced by LLSurfacePatch::updateVisibility().

Here is the caller graph for this function:

U32 LLSurface::getRenderLevel ( const U32  render_stride  )  const

Definition at line 1115 of file llsurface.cpp.

References mPVArray, and LLPatchVertexArray::mRenderLevelp.

Referenced by LLSurfacePatch::updateVisibility().

Here is the caller graph for this function:

F32 LLSurface::resolveHeightRegion ( const F32  x,
const F32  y 
) const

F32 LLSurface::resolveHeightRegion ( const LLVector3 location  )  const [inline]

Definition at line 111 of file llsurface.h.

References LLVector3::mV, resolveHeightRegion(), VX, and VY.

Here is the call graph for this function:

F32 LLSurface::resolveHeightGlobal ( const LLVector3d position_global  )  const

Definition at line 808 of file llsurface.cpp.

References LLViewerRegion::getPosRegionFromGlobal(), mRegionp, and resolveHeightRegion().

Referenced by LLViewerParcelOverlay::renderPropertyLines(), LLWorld::resolveLandHeightGlobal(), and LLWorld::resolveStepHeightGlobal().

Here is the call graph for this function:

Here is the caller graph for this function:

LLVector3 LLSurface::resolveNormalGlobal ( const LLVector3d v  )  const

Definition at line 821 of file llsurface.cpp.

References i, j, LLVector3d::mdV, mGridsPerEdge, mMetersPerEdge, mMetersPerGrid, mOriginGlobal, mSurfaceZ, LLVector3::normVec(), LLVector3::setVec(), VX, VY, and LLVector3::z_axis.

Referenced by LLWorld::resolveLandNormalGlobal().

Here is the call graph for this function:

Here is the caller graph for this function:

LLSurfacePatch * LLSurface::resolvePatchRegion ( const F32  x,
const F32  y 
) const

LLSurfacePatch * LLSurface::resolvePatchRegion ( const LLVector3 position_region  )  const

Definition at line 949 of file llsurface.cpp.

References LLVector3::mV, resolvePatchRegion(), VX, and VY.

Here is the call graph for this function:

LLSurfacePatch * LLSurface::resolvePatchGlobal ( const LLVector3d position_global  )  const

Definition at line 955 of file llsurface.cpp.

References LLViewerRegion::getPosRegionFromGlobal(), mRegionp, and resolvePatchRegion().

Referenced by LLWorld::resolveLandPatchGlobal().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLSurface::idleUpdate ( F32  max_update_time  ) 

BOOL LLSurface::containsPosition ( const LLVector3 position  ) 

Definition at line 736 of file llsurface.cpp.

References FALSE, mMetersPerEdge, LLVector3::mV, TRUE, VX, and VY.

void LLSurface::moveZ ( const S32  x,
const S32  y,
const F32  delta 
)

Definition at line 595 of file llsurface.cpp.

References llassert, mGridsPerEdge, and mSurfaceZ.

LLViewerRegion* LLSurface::getRegion (  )  const [inline]

F32 LLSurface::getMinZ (  )  const [inline]

Definition at line 129 of file llsurface.h.

References mMinZ.

Referenced by LLViewerRegion::calculateCenterGlobal(), and LLWorld::updateVisibilities().

Here is the caller graph for this function:

F32 LLSurface::getMaxZ (  )  const [inline]

Definition at line 130 of file llsurface.h.

References mMaxZ.

Referenced by LLViewerRegion::calculateCenterGlobal(), and LLWorld::updateVisibilities().

Here is the caller graph for this function:

void LLSurface::setWaterHeight ( F32  height  ) 

Definition at line 1160 of file llsurface.cpp.

References LLPointer< Type >::isNull(), llendl, llwarns, LLVector3::mV, mWaterObjp, and VZ.

Referenced by LLViewerRegion::setWaterHeight().

Here is the call graph for this function:

Here is the caller graph for this function:

F32 LLSurface::getWaterHeight (  )  const

Definition at line 1174 of file llsurface.cpp.

References DEFAULT_WATER_HEIGHT, LLPointer< Type >::isNull(), mWaterObjp, and VZ.

Referenced by generateWaterTexture(), and LLViewerRegion::getWaterHeight().

Here is the call graph for this function:

Here is the caller graph for this function:

LLViewerImage * LLSurface::getSTexture (  ) 

Definition at line 213 of file llsurface.cpp.

References createSTexture(), mSTexturep, and LLPointer< Type >::notNull().

Referenced by LLNetMap::draw(), LLVLComposition::generateTexture(), and LLVOSurfacePatch::getPool().

Here is the call graph for this function:

Here is the caller graph for this function:

LLViewerImage * LLSurface::getWaterTexture (  ) 

Definition at line 222 of file llsurface.cpp.

References createWaterTexture(), mWaterTexturep, and LLPointer< Type >::notNull().

Referenced by LLVOWater::createDrawable(), LLNetMap::draw(), and generateWaterTexture().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLSurface::hasZData (  )  const [inline]

Definition at line 137 of file llsurface.h.

References mHasZData.

Referenced by LLWorld::updateVisibilities().

Here is the caller graph for this function:

void LLSurface::dirtyAllPatches (  ) 

Definition at line 1144 of file llsurface.cpp.

References LLSurfacePatch::dirtyZ(), i, mNumberOfPatches, mPatchList, and S32.

Referenced by LLViewerRegion::unpackRegionHandshake().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLSurface::dirtySurfacePatch ( LLSurfacePatch patchp  ) 

Definition at line 1153 of file llsurface.cpp.

References mDirtyPatchList.

Referenced by LLSurfacePatch::dirty(), and LLSurfacePatch::updateNormals().

Here is the caller graph for this function:

LLVOWater* LLSurface::getWaterObj (  )  [inline]

Definition at line 142 of file llsurface.h.

References mWaterObjp.

Referenced by LLWorld::updateWaterObjects().

Here is the caller graph for this function:

void LLSurface::setTextureSize ( const S32  texture_size  )  [static]

Definition at line 1109 of file llsurface.cpp.

References sTextureSize.

Referenced by settings_to_globals().

Here is the caller graph for this function:

void LLSurface::createSTexture (  )  [protected]

Definition at line 231 of file llsurface.cpp.

References LLViewerImageList::addImage(), FALSE, gImageList, i, j, mSTexturep, S32, sTextureSize, and TRUE.

Referenced by getSTexture(), and initTextures().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLSurface::createWaterTexture (  )  [protected]

Definition at line 256 of file llsurface.cpp.

References LLViewerImageList::addImage(), FALSE, gImageList, i, j, MAX_WATER_COLOR, LLColor4U::mV, mWaterTexturep, S32, sTextureSize, and TRUE.

Referenced by getWaterTexture(), and initTextures().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLSurface::initTextures (  )  [protected]

void LLSurface::initWater (  )  [protected]

void LLSurface::createPatchData (  )  [protected]

void LLSurface::destroyPatchData (  )  [protected]

Definition at line 1099 of file llsurface.cpp.

References mPatchList, mVisiblePatchCount, and NULL.

Referenced by ~LLSurface().

Here is the caller graph for this function:

BOOL LLSurface::generateWaterTexture ( const F32  x,
const F32  y,
const F32  width,
const F32  height 
) [protected]

Definition at line 1188 of file llsurface.cpp.

References ABOVE_WATERLINE_ALPHA, FALSE, from_region_handle(), getMetersPerGrid(), getRegion(), getWaterHeight(), getWaterTexture(), i, j, llmax(), llmin(), llround(), MAX_WATER_COLOR, LLColor4U::mV, LLVector3::mV, mWaterTexturep, resolveHeightRegion(), S32, TRUE, VX, and VY.

Referenced by LLSurfacePatch::updateTexture().

Here is the call graph for this function:

Here is the caller graph for this function:

LLSurfacePatch * LLSurface::getPatch ( const S32  x,
const S32  y 
) const [protected]

Definition at line 1127 of file llsurface.cpp.

References llendl, llerrs, mPatchesPerEdge, mPatchList, and NULL.

Referenced by connectNeighbor(), createPatchData(), and setOriginGlobal().

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class LLSurfacePatch [friend]

Definition at line 146 of file llsurface.h.

std::ostream& operator<< ( std::ostream &  s,
const LLSurface S 
) [friend]

Definition at line 962 of file llsurface.cpp.


Member Data Documentation

Definition at line 153 of file llsurface.h.

Referenced by create().

Definition at line 169 of file llsurface.h.

Referenced by LLSurfacePatch::setSurface(), and LLSurfacePatch::updateNormals().

Definition at line 171 of file llsurface.h.

Definition at line 173 of file llsurface.h.

Referenced by LLVLComposition::generateTexture(), and reset_statistics().

Definition at line 174 of file llsurface.h.

Referenced by LLVLComposition::generateTexture(), and reset_statistics().

Definition at line 175 of file llsurface.h.

Referenced by reset_statistics().

F32* LLSurface::mSurfaceZ [protected]

Definition at line 202 of file llsurface.h.

Referenced by create(), createPatchData(), LLSurface(), and ~LLSurface().

std::set<LLSurfacePatch *> LLSurface::mDirtyPatchList [protected]

Definition at line 204 of file llsurface.h.

Referenced by dirtySurfacePatch(), and idleUpdate().

Definition at line 208 of file llsurface.h.

Referenced by createSTexture(), getSTexture(), and ~LLSurface().

Definition at line 209 of file llsurface.h.

Referenced by createWaterTexture(), generateWaterTexture(), getWaterTexture(), and ~LLSurface().

Definition at line 220 of file llsurface.h.

Definition at line 221 of file llsurface.h.

Definition at line 223 of file llsurface.h.

Referenced by LLSurfacePatch::calcNormal(), create(), getRenderLevel(), and getRenderStride().

Definition at line 225 of file llsurface.h.

Referenced by hasZData(), LLSurface(), and LLSurfacePatch::updateVerticalStats().

F32 LLSurface::mMinZ [protected]

Definition at line 226 of file llsurface.h.

Referenced by getMinZ(), LLSurface(), and LLSurfacePatch::updateVerticalStats().

F32 LLSurface::mMaxZ [protected]

Definition at line 227 of file llsurface.h.

Referenced by getMaxZ(), LLSurface(), and LLSurfacePatch::updateVerticalStats().

Definition at line 229 of file llsurface.h.

Referenced by LLSurface().

S32 LLSurface::sTextureSize = 256 [static, private]

Definition at line 233 of file llsurface.h.

Referenced by createSTexture(), createWaterTexture(), and setTextureSize().


The documentation for this class was generated from the following files:

Generated on Fri May 16 09:08:50 2008 for SecondLife by  doxygen 1.5.5