LLWorld Class Reference

#include <llworld.h>

Collaboration diagram for LLWorld:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::list< LLViewerRegion * > region_list_t

Public Member Functions

 LLWorld (const U32 grids_per_region, const F32 meters_per_grid)
 ~LLWorld ()
LLViewerRegionaddRegion (const U64 &region_handle, const LLHost &host)
void removeRegion (const LLHost &host)
void disconnectRegions ()
LLViewerRegiongetRegion (const LLHost &host)
LLViewerRegiongetRegionFromPosGlobal (const LLVector3d &pos)
LLViewerRegiongetRegionFromPosAgent (const LLVector3 &pos)
LLViewerRegiongetRegionFromHandle (const U64 &handle)
BOOL positionRegionValidGlobal (const LLVector3d &pos)
LLVector3d clipToVisibleRegions (const LLVector3d &start_pos, const LLVector3d &end_pos)
void updateAgentOffset (const LLVector3d &offset)
LLViewerRegionresolveRegionGlobal (LLVector3 &localpos, const LLVector3d &position)
LLViewerRegionresolveRegionAgent (LLVector3 &localpos, const LLVector3 &position)
F32 resolveLandHeightGlobal (const LLVector3d &position)
F32 resolveLandHeightAgent (const LLVector3 &position)
F32 getMinAllowedZ (LLViewerObject *object)
F32 resolveStepHeightGlobal (const LLVOAvatar *avatarp, const LLVector3d &point_a, const LLVector3d &point_b, LLVector3d &intersection, LLVector3 &intersection_normal, LLViewerObject **viewerObjectPtr=NULL)
LLSurfacePatchresolveLandPatchGlobal (const LLVector3d &position)
LLVector3 resolveLandNormalGlobal (const LLVector3d &position)
U32 getRegionWidthInPoints () const
F32 getRegionScale () const
F32 getRegionWidthInMeters () const
F32 getRegionMinHeight () const
F32 getRegionMaxHeight () const
void updateRegions (F32 max_update_time)
void updateVisibilities ()
void updateParticles ()
void updateClouds (const F32 dt)
LLCloudGroupfindCloudGroup (const LLCloudPuff &puff)
void renderPropertyLines ()
void resetStats ()
void updateNetStats ()
void printPacketsLost ()
void requestCacheMisses ()
F32 getLandFarClip () const
void setLandFarClip (const F32 far_clip)
LLViewerImagegetDefaultWaterTexture ()
void updateWaterObjects ()
void setSpaceTimeUSec (const U64 space_time_usec)
U64 getSpaceTimeUSec () const
LLString getInfoString ()

Static Public Member Functions

static void processCoarseUpdate (LLMessageSystem *msg, void **user_data)

Public Attributes

region_list_t mActiveRegionList
LLViewerPartSim mPartSim

Private Attributes

region_list_t mRegionList
region_list_t mVisibleRegionList
region_list_t mCulledRegionList
const U32 mWidth
const F32 mScale
const F32 mWidthInMeters
F32 mLandFarClip
LLPatchVertexArray mLandPatch
S32 mLastPacketsIn
S32 mLastPacketsOut
S32 mLastPacketsLost
U32 mMinRegionX
U32 mMaxRegionX
U32 mMinRegionY
U32 mMaxRegionY
std::list< LLVOWater * > mHoleWaterObjects
LLPointer< LLVOWatermEdgeWaterObjects [8]
LLPointer< LLViewerImagemDefaultWaterTexturep
U64 mSpaceTimeUSec

Detailed Description

Definition at line 63 of file llworld.h.


Member Typedef Documentation

typedef std::list<LLViewerRegion*> LLWorld::region_list_t

Definition at line 148 of file llworld.h.


Constructor & Destructor Documentation

LLWorld::LLWorld ( const U32  grids_per_region,
const F32  meters_per_grid 
)

Definition at line 80 of file llworld.cpp.

References DEFAULT_FAR_PLANE, FALSE, gNoRender, i, mDefaultWaterTexturep, mEdgeWaterObjects, mLandFarClip, mLastPacketsIn, mLastPacketsLost, mLastPacketsOut, mSpaceTimeUSec, LLColor4U::mV, NULL, S32, and TRUE.

LLWorld::~LLWorld (  ) 

Definition at line 115 of file llworld.cpp.

References gObjectList, LLViewerObjectList::killAllObjects(), and mRegionList.


Member Function Documentation

LLViewerRegion * LLWorld::addRegion ( const U64 region_handle,
const LLHost host 
)

Definition at line 122 of file llworld.cpp.

References LLViewerRegion::connectNeighbor(), LLCloudLayer::create(), from_region_handle(), gDirAxes, LLViewerRegion::getHost(), getRegionFromHandle(), getRegionWidthInMeters(), llendl, llerrs, llinfos, llwarns, mActiveRegionList, LLViewerRegion::mAlive, LLViewerRegion::mCloudLayer, mCulledRegionList, mRegionList, LLMemType::MTYPE_REGIONS, mWidth, LLViewerRegion::mWind, removeRegion(), S32, LLCloudLayer::setWidth(), LLCloudLayer::setWindPointer(), to_region_handle(), updateWaterObjects(), width, WORLD_PATCH_SIZE, x, and y.

Referenced by idle_startup(), process_crossed_region(), process_enable_simulator(), and process_teleport_finish().

LLVector3d LLWorld::clipToVisibleRegions ( const LLVector3d start_pos,
const LLVector3d end_pos 
)

Definition at line 303 of file llworld.cpp.

References LLVector3d::abs(), LLVector3d::clamp(), LLViewerRegion::getPosGlobalFromRegion(), LLViewerRegion::getPosRegionFromGlobal(), getRegionFromPosGlobal(), LLViewerRegion::getWidth(), LLVector3d::mdV, LLVector3::mV, positionRegionValidGlobal(), LLVector3d::setVec(), VX, and VY.

Referenced by LLManipRotate::drag(), LLManipScale::dragCorner(), LLManipTranslate::handleHover(), LLToolGrab::handleHoverActive(), and LLManipScale::stretchFace().

void LLWorld::disconnectRegions (  ) 

Definition at line 987 of file llworld.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_AgentQuitCopy, _PREHASH_FuseBlock, _PREHASH_SessionID, _PREHASH_ViewerCircuitCode, LLMessageSystem::addU32Fast(), LLMessageSystem::addUUIDFast(), gAgent, LLViewerRegion::getHost(), LLAgent::getID(), LLAgent::getRegion(), LLAgent::getSessionID(), gMessageSystem, llendl, llinfos, LLMessageSystem::mOurCircuitCode, mRegionList, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), and LLMessageSystem::sendMessage().

LLCloudGroup * LLWorld::findCloudGroup ( const LLCloudPuff puff  ) 

Definition at line 673 of file llworld.cpp.

References mActiveRegionList, and NULL.

LLViewerImage * LLWorld::getDefaultWaterTexture (  ) 

Definition at line 950 of file llworld.cpp.

References mDefaultWaterTexturep.

Referenced by LLVOWater::createDrawable().

LLString LLWorld::getInfoString (  ) 

Definition at line 975 of file llworld.cpp.

References LLViewerRegion::getInfoString(), and mRegionList.

Referenced by viewer_crash_callback().

F32 LLWorld::getLandFarClip (  )  const

Definition at line 780 of file llworld.cpp.

References mLandFarClip.

F32 LLWorld::getMinAllowedZ ( LLViewerObject object  ) 

Definition at line 411 of file llworld.cpp.

References LLViewerObject::getPositionGlobal(), LLXform::getScale(), LLVector3::magVec(), and resolveLandHeightGlobal().

Referenced by LLManipTranslate::handleHover(), and LLPanelObject::sendPosition().

LLViewerRegion * LLWorld::getRegion ( const LLHost host  ) 

Definition at line 269 of file llworld.cpp.

References mRegionList, and NULL.

Referenced by LLEstablishAgentCommunication::post(), CoarseLocationUpdate::post(), process_layer_data(), process_region_handshake(), processCoarseUpdate(), LLViewerParcelMgr::processParcelOverlay(), LLViewerParcelMgr::processParcelProperties(), and removeRegion().

LLViewerRegion * LLWorld::getRegionFromHandle ( const U64 handle  ) 

Definition at line 367 of file llworld.cpp.

References mRegionList, and NULL.

Referenced by addRegion(), idle_startup(), process_agent_movement_complete(), and updateWaterObjects().

LLViewerRegion * LLWorld::getRegionFromPosAgent ( const LLVector3 pos  ) 

Definition at line 283 of file llworld.cpp.

References gAgent, LLAgent::getPosGlobalFromAgent(), and getRegionFromPosGlobal().

LLViewerRegion * LLWorld::getRegionFromPosGlobal ( const LLVector3d pos  ) 

Definition at line 288 of file llworld.cpp.

References mRegionList, and NULL.

Referenced by LLViewerParcelMgr::callbackDivideLand(), LLViewerParcelMgr::callbackJoinLand(), clipToVisibleRegions(), LLToolDragAndDrop::dropObject(), getRegionFromPosAgent(), LLViewerParcelMgr::getSelectionRegion(), LLViewerParcelMgr::inAgentParcel(), LLViewerParcelMgr::isOwnedAt(), LLViewerParcelMgr::isOwnedOtherAt(), LLViewerParcelMgr::isOwnedSelfAt(), LLViewerParcelMgr::isSoundLocal(), LLPanelRegionTools::onSelectRegion(), raycast_for_new_obj_pos(), LLViewerParcelMgr::render(), LLViewerParcelMgr::requestHoverParcelProperties(), resolveLandHeightGlobal(), resolveLandNormalGlobal(), resolveLandPatchGlobal(), resolveRegionAgent(), resolveRegionGlobal(), resolveStepHeightGlobal(), LLViewerParcelMgr::selectLand(), LLViewerParcelMgr::sendParcelAccessListRequest(), LLViewerParcelMgr::sendParcelAccessListUpdate(), LLViewerParcelMgr::sendParcelDeed(), LLViewerParcelMgr::sendParcelDwellRequest(), LLViewerParcelMgr::sendParcelGodForceOwner(), LLViewerParcelMgr::sendParcelGodForceToContent(), LLViewerParcelMgr::sendParcelPropertiesUpdate(), LLViewerParcelMgr::sendParcelRelease(), LLViewerParcelMgr::setupParcelBuy(), LLViewerParcelMgr::startDeedLandToGroup(), and LLViewerParcelMgr::startReleaseLand().

F32 LLWorld::getRegionMaxHeight (  )  const [inline]

Definition at line 117 of file llworld.h.

References mWidthInMeters.

F32 LLWorld::getRegionMinHeight (  )  const [inline]

Definition at line 116 of file llworld.h.

References mWidthInMeters.

F32 LLWorld::getRegionScale (  )  const [inline]

Definition at line 112 of file llworld.h.

References mScale.

F32 LLWorld::getRegionWidthInMeters (  )  const [inline]

Definition at line 115 of file llworld.h.

References mWidthInMeters.

Referenced by addRegion(), and updateWaterObjects().

U32 LLWorld::getRegionWidthInPoints (  )  const [inline]

Definition at line 111 of file llworld.h.

References mWidth.

U64 LLWorld::getSpaceTimeUSec (  )  const

Definition at line 960 of file llworld.cpp.

References mSpaceTimeUSec.

Referenced by idle().

BOOL LLWorld::positionRegionValidGlobal ( const LLVector3d pos  ) 

Definition at line 395 of file llworld.cpp.

References FALSE, mRegionList, and TRUE.

Referenced by clipToVisibleRegions().

void LLWorld::printPacketsLost (  ) 

Definition at line 750 of file llworld.cpp.

References LLCircuit::findCircuit(), gAgent, LLCircuitData::getPacketsLost(), LLAgent::getPositionGlobal(), gMessageSystem, llendl, llinfos, mActiveRegionList, LLMessageSystem::mCircuitInfo, NULL, and range.

void LLWorld::processCoarseUpdate ( LLMessageSystem msg,
void **  user_data 
) [static]

Definition at line 771 of file llworld.cpp.

References getRegion(), LLMessageSystem::getSender(), gWorldp, and LLViewerRegion::updateCoarseLocations().

Referenced by register_viewer_callbacks().

void LLWorld::removeRegion ( const LLHost host  ) 

Definition at line 219 of file llworld.cpp.

References do_disconnect(), from_region_handle(), gAgent, LLViewerRegion::getHandle(), LLViewerRegion::getName(), LLAgent::getPositionAgent(), LLAgent::getPositionGlobal(), LLAgent::getRegion(), getRegion(), LLAgent::getRegionsVisited(), gFrameTimeSeconds, llendl, llinfos, llwarns, mActiveRegionList, mCulledRegionList, mRegionList, mVisibleRegionList, updateWaterObjects(), x, and y.

Referenced by addRegion(), and process_disable_simulator().

void LLWorld::renderPropertyLines (  ) 

Definition at line 694 of file llworld.cpp.

References mVisibleRegionList, and S32.

Referenced by render_hud_elements().

void LLWorld::requestCacheMisses (  ) 

Definition at line 965 of file llworld.cpp.

References mRegionList, and LLViewerRegion::requestCacheMisses().

Referenced by update_statistics().

void LLWorld::resetStats (  ) 

F32 LLWorld::resolveLandHeightAgent ( const LLVector3 position  ) 

Definition at line 448 of file llworld.cpp.

References gAgent, LLAgent::getPosGlobalFromAgent(), and resolveLandHeightGlobal().

Referenced by LLViewerParcelMgr::renderRect(), and LLPanelObject::sendPosition().

F32 LLWorld::resolveLandHeightGlobal ( const LLVector3d position  ) 

Definition at line 455 of file llworld.cpp.

References LLViewerRegion::getLand(), getRegionFromPosGlobal(), and LLSurface::resolveHeightGlobal().

Referenced by LLTracker::drawHUDArrow(), getMinAllowedZ(), LLManipTranslate::handleHover(), and resolveLandHeightAgent().

LLVector3 LLWorld::resolveLandNormalGlobal ( const LLVector3d position  ) 

Definition at line 545 of file llworld.cpp.

References LLViewerRegion::getLand(), getRegionFromPosGlobal(), LLSurface::resolveNormalGlobal(), and LLVector3::z_axis.

Referenced by resolveStepHeightGlobal().

LLSurfacePatch * LLWorld::resolveLandPatchGlobal ( const LLVector3d position  ) 

Definition at line 532 of file llworld.cpp.

References LLViewerRegion::getLand(), getRegionFromPosGlobal(), NULL, and LLSurface::resolvePatchGlobal().

LLViewerRegion * LLWorld::resolveRegionAgent ( LLVector3 localpos,
const LLVector3 position 
)

Definition at line 433 of file llworld.cpp.

References gAgent, LLAgent::getPosGlobalFromAgent(), LLViewerRegion::getPosRegionFromGlobal(), getRegionFromPosGlobal(), and NULL.

LLViewerRegion * LLWorld::resolveRegionGlobal ( LLVector3 localpos,
const LLVector3d position 
)

Definition at line 419 of file llworld.cpp.

References LLViewerRegion::getPosRegionFromGlobal(), getRegionFromPosGlobal(), and NULL.

Referenced by idle().

F32 LLWorld::resolveStepHeightGlobal ( const LLVOAvatar avatarp,
const LLVector3d point_a,
const LLVector3d point_b,
LLVector3d intersection,
LLVector3 intersection_normal,
LLViewerObject **  viewerObjectPtr = NULL 
)

Definition at line 473 of file llworld.cpp.

References f, LLViewerRegion::getLand(), LLViewerRegion::getPosRegionFromGlobal(), LLViewerObject::getRegion(), getRegionFromPosGlobal(), LLVector4::isExactlyClear(), llclamp(), LLVector3d::mdV, LLVOAvatar::mFootPlane, LLVector4::mV, NULL, LLSurface::resolveHeightGlobal(), resolveLandNormalGlobal(), LLVector3::setVec(), VW, and VZ.

void LLWorld::setLandFarClip ( const F32  far_clip  ) 

Definition at line 785 of file llworld.cpp.

References mLandFarClip.

Referenced by display_update_camera(), and idle_startup().

void LLWorld::setSpaceTimeUSec ( const U64  space_time_usec  ) 

Definition at line 955 of file llworld.cpp.

References mSpaceTimeUSec.

Referenced by idle(), and process_time_synch().

void LLWorld::updateAgentOffset ( const LLVector3d offset  ) 

Definition at line 382 of file llworld.cpp.

References mRegionList.

void LLWorld::updateClouds ( const F32  dt  ) 

Definition at line 637 of file llworld.cpp.

References LLControlGroup::getBOOL(), gSavedSettings, and mActiveRegionList.

Referenced by idle().

void LLWorld::updateNetStats (  ) 

Definition at line 709 of file llworld.cpp.

References LLStat::addValue(), f, LLPacketRing::getAndResetActualInBits(), LLPacketRing::getAndResetActualOutBits(), gMessageSystem, gViewerStats, llfloor(), mActiveRegionList, LLViewerStats::mActualInKBitStat, LLViewerStats::mActualOutKBitStat, LLMessageSystem::mDroppedPackets, LLViewerStats::mKBitStat, mLastPacketsIn, mLastPacketsLost, mLastPacketsOut, LLMessageSystem::mPacketRing, LLMessageSystem::mPacketsIn, LLViewerStats::mPacketsInStat, LLViewerStats::mPacketsLostPercentStat, LLViewerStats::mPacketsLostStat, LLMessageSystem::mPacketsOut, LLViewerStats::mPacketsOutStat, and S32.

Referenced by update_statistics().

void LLWorld::updateParticles (  ) 

Definition at line 632 of file llworld.cpp.

References mPartSim, and LLViewerPartSim::updateSimulation().

Referenced by idle().

void LLWorld::updateRegions ( F32  max_update_time  ) 

Definition at line 614 of file llworld.cpp.

References f, FALSE, LLTimer::getElapsedTimeF32(), llmin(), and mRegionList.

Referenced by idle().

void LLWorld::updateVisibilities (  ) 

Definition at line 557 of file llworld.cpp.

References LLViewerRegion::calculateCameraDistance(), F_SQRT2, fsqrtf, gAgent, gCamera, LLViewerRegion::getCenterAgent(), LLCamera::getFar(), LLViewerRegion::getLand(), LLSurface::getMaxZ(), LLSurface::getMinZ(), gNoRender, LLSurface::hasZData(), height, mCulledRegionList, mLandFarClip, mVisibleRegionList, mWidth, LLCamera::setFar(), LLCamera::sphereInFrustum(), and LLSurface::updatePatchVisibilities().

Referenced by idle().

void LLWorld::updateWaterObjects (  ) 

Definition at line 791 of file llworld.cpp.

References LLPipeline::addObject(), LLViewerObjectList::createObjectViewer(), DEFAULT_WATER_HEIGHT, f, FALSE, first, from_region_handle(), gAgent, gDirAxes, LLViewerRegion::getHandle(), LLAgent::getRegion(), getRegionFromHandle(), getRegionWidthInMeters(), gObjectList, gPipeline, LLViewerObject::isDead(), LLViewerObjectList::killObject(), LLViewerObject::LL_VO_WATER, llendl, llfloor(), llmax(), llmin(), llround(), llwarns, mEdgeWaterObjects, mHoleWaterObjects, mRegionList, S32, LLViewerObject::setPositionGlobal(), LLViewerObject::setRegion(), LLViewerObject::setScale(), LLVOWater::setUseTexture(), to_region_handle(), LLViewerObjectList::updateActive(), x, and y.

Referenced by addRegion(), and removeRegion().


Member Data Documentation

region_list_t LLWorld::mActiveRegionList

Definition at line 150 of file llworld.h.

Referenced by addRegion(), LLNetMap::draw(), findCloudGroup(), LLPanelRequestTools::onClickRequest(), printPacketsLost(), LLPanelRequestTools::refresh(), removeRegion(), send_agent_pause(), send_agent_resume(), updateClouds(), and updateNetStats().

region_list_t LLWorld::mCulledRegionList [private]

Definition at line 156 of file llworld.h.

Referenced by addRegion(), removeRegion(), and updateVisibilities().

LLPointer<LLViewerImage> LLWorld::mDefaultWaterTexturep [private]

Definition at line 186 of file llworld.h.

Referenced by getDefaultWaterTexture(), and LLWorld().

LLPointer<LLVOWater> LLWorld::mEdgeWaterObjects[8] [private]

Definition at line 184 of file llworld.h.

Referenced by LLWorld(), and updateWaterObjects().

std::list<LLVOWater*> LLWorld::mHoleWaterObjects [private]

Definition at line 183 of file llworld.h.

Referenced by updateWaterObjects().

F32 LLWorld::mLandFarClip [private]

Definition at line 166 of file llworld.h.

Referenced by getLandFarClip(), LLWorld(), setLandFarClip(), and updateVisibilities().

LLPatchVertexArray LLWorld::mLandPatch [private]

Definition at line 167 of file llworld.h.

S32 LLWorld::mLastPacketsIn [private]

Definition at line 168 of file llworld.h.

Referenced by LLWorld(), and updateNetStats().

S32 LLWorld::mLastPacketsLost [private]

Definition at line 170 of file llworld.h.

Referenced by LLWorld(), and updateNetStats().

S32 LLWorld::mLastPacketsOut [private]

Definition at line 169 of file llworld.h.

Referenced by LLWorld(), and updateNetStats().

U32 LLWorld::mMaxRegionX [private]

Definition at line 179 of file llworld.h.

U32 LLWorld::mMaxRegionY [private]

Definition at line 181 of file llworld.h.

U32 LLWorld::mMinRegionX [private]

Definition at line 178 of file llworld.h.

U32 LLWorld::mMinRegionY [private]

Definition at line 180 of file llworld.h.

LLViewerPartSim LLWorld::mPartSim

Definition at line 151 of file llworld.h.

Referenced by updateParticles().

region_list_t LLWorld::mRegionList [private]

Definition at line 154 of file llworld.h.

Referenced by addRegion(), disconnectRegions(), getInfoString(), getRegion(), getRegionFromHandle(), getRegionFromPosGlobal(), positionRegionValidGlobal(), removeRegion(), requestCacheMisses(), updateAgentOffset(), updateRegions(), updateWaterObjects(), and ~LLWorld().

const F32 LLWorld::mScale [private]

Definition at line 162 of file llworld.h.

Referenced by getRegionScale().

U64 LLWorld::mSpaceTimeUSec [private]

Definition at line 187 of file llworld.h.

Referenced by getSpaceTimeUSec(), LLWorld(), and setSpaceTimeUSec().

region_list_t LLWorld::mVisibleRegionList [private]

Definition at line 155 of file llworld.h.

Referenced by removeRegion(), renderPropertyLines(), and updateVisibilities().

const U32 LLWorld::mWidth [private]

Definition at line 159 of file llworld.h.

Referenced by addRegion(), getRegionWidthInPoints(), and updateVisibilities().

const F32 LLWorld::mWidthInMeters [private]

Definition at line 164 of file llworld.h.

Referenced by getRegionMaxHeight(), getRegionMinHeight(), and getRegionWidthInMeters().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:12:04 2010 for Second Life Viewer by  doxygen 1.4.7