LLCamera Class Reference

#include <llcamera.h>

Inheritance diagram for LLCamera:

Inheritance graph
[legend]
Collaboration diagram for LLCamera:

Collaboration graph
[legend]

List of all members.

Public Types

enum  {
  PLANE_LEFT = 0, PLANE_RIGHT = 1, PLANE_BOTTOM = 2, PLANE_TOP = 3,
  PLANE_NUM = 4
}
enum  {
  PLANE_LEFT_MASK = (1<<PLANE_LEFT), PLANE_RIGHT_MASK = (1<<PLANE_RIGHT), PLANE_BOTTOM_MASK = (1<<PLANE_BOTTOM), PLANE_TOP_MASK = (1<<PLANE_TOP),
  PLANE_ALL_MASK = 0xf
}
enum  { HORIZ_PLANE_LEFT = 0, HORIZ_PLANE_RIGHT = 1, HORIZ_PLANE_NUM = 2 }
enum  { HORIZ_PLANE_LEFT_MASK = (1<<HORIZ_PLANE_LEFT), HORIZ_PLANE_RIGHT_MASK = (1<<HORIZ_PLANE_RIGHT), HORIZ_PLANE_ALL_MASK = 0x3 }

Public Member Functions

 LLCamera ()
 LLCamera (F32 z_field_of_view, F32 aspect_ratio, S32 view_height_in_pixels, F32 near_plane, F32 far_plane)
void setUserClipPlane (LLPlane plane)
void disableUserClipPlane ()
U8 calcPlaneMask (const LLPlane &plane)
void setView (F32 new_view)
void setViewHeightInPixels (S32 height)
void setAspect (F32 new_aspect)
void setNear (F32 new_near)
void setFar (F32 new_far)
F32 getView () const
S32 getViewHeightInPixels () const
F32 getAspect () const
F32 getNear () const
F32 getFar () const
F32 getYaw () const
F32 getPitch () const
const LLPlanegetWorldPlane (S32 index) const
const LLVector3getWorldPlanePos () const
size_t writeFrustumToBuffer (char *buffer) const
size_t readFrustumFromBuffer (const char *buffer)
void calcAgentFrustumPlanes (LLVector3 *frust)
S32 sphereInFrustumOld (const LLVector3 &center, const F32 radius) const
S32 sphereInFrustum (const LLVector3 &center, const F32 radius) const
S32 pointInFrustum (const LLVector3 &point) const
S32 sphereInFrustumFull (const LLVector3 &center, const F32 radius) const
S32 AABBInFrustum (const LLVector3 &center, const LLVector3 &radius)
S32 AABBInFrustumNoFarClip (const LLVector3 &center, const LLVector3 &radius)
S32 sphereInFrustumQuick (const LLVector3 &sphere_center, const F32 radius)
F32 heightInPixels (const LLVector3 &center, F32 radius) const
F32 visibleDistance (const LLVector3 &pos, F32 rad, F32 fudgescale=1.0f, U32 planemask=PLANE_ALL_MASK) const
F32 visibleHorizDistance (const LLVector3 &pos, F32 rad, F32 fudgescale=1.0f, U32 planemask=HORIZ_PLANE_ALL_MASK) const
void setFixedDistance (F32 distance)

Public Attributes

LLVector3 mAgentFrustum [8]
F32 mFrustumCornerDist

Protected Member Functions

void calculateFrustumPlanes ()
void calculateFrustumPlanes (F32 left, F32 right, F32 top, F32 bottom)
void calculateFrustumPlanesFromWindow (F32 x1, F32 y1, F32 x2, F32 y2)
void calculateWorldFrustumPlanes ()

Protected Attributes

F32 mView
F32 mAspect
S32 mViewHeightInPixels
F32 mNearPlane
F32 mFarPlane
LLPlane mLocalPlanes [4]
F32 mFixedDistance
LLVector3 mFrustCenter
F32 mFrustRadiusSquared
LLPlane mWorldPlanes [PLANE_NUM]
LLPlane mHorizPlanes [HORIZ_PLANE_NUM]
frustum_plane mAgentPlanes [7]
U32 mPlaneCount
LLVector3 mWorldPlanePos

Friends

std::ostream & operator<< (std::ostream &s, const LLCamera &C)

Classes

struct  frustum_plane


Detailed Description

Definition at line 75 of file llcamera.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
PLANE_LEFT 
PLANE_RIGHT 
PLANE_BOTTOM 
PLANE_TOP 
PLANE_NUM 

Definition at line 79 of file llcamera.h.

anonymous enum

Enumerator:
PLANE_LEFT_MASK 
PLANE_RIGHT_MASK 
PLANE_BOTTOM_MASK 
PLANE_TOP_MASK 
PLANE_ALL_MASK 

Definition at line 86 of file llcamera.h.

anonymous enum

Enumerator:
HORIZ_PLANE_LEFT 
HORIZ_PLANE_RIGHT 
HORIZ_PLANE_NUM 

Definition at line 93 of file llcamera.h.

anonymous enum

Enumerator:
HORIZ_PLANE_LEFT_MASK 
HORIZ_PLANE_RIGHT_MASK 
HORIZ_PLANE_ALL_MASK 

Definition at line 98 of file llcamera.h.


Constructor & Destructor Documentation

LLCamera::LLCamera (  ) 

Definition at line 39 of file llcamera.cpp.

References calculateFrustumPlanes().

Here is the call graph for this function:

LLCamera::LLCamera ( F32  z_field_of_view,
F32  aspect_ratio,
S32  view_height_in_pixels,
F32  near_plane,
F32  far_plane 
)


Member Function Documentation

void LLCamera::setUserClipPlane ( LLPlane  plane  ) 

Definition at line 83 of file llcamera.cpp.

References calcPlaneMask(), mAgentPlanes, LLCamera::frustum_plane::mask, mPlaneCount, and LLCamera::frustum_plane::p.

Referenced by LLPipeline::generateWaterReflection(), and LLPipeline::updateCull().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLCamera::disableUserClipPlane (  ) 

Definition at line 90 of file llcamera.cpp.

References mPlaneCount.

Referenced by LLPipeline::updateCull().

Here is the caller graph for this function:

U8 LLCamera::calcPlaneMask ( const LLPlane plane  ) 

Definition at line 540 of file llcamera.cpp.

References LLVector4::mV.

Referenced by calcAgentFrustumPlanes(), and setUserClipPlane().

Here is the caller graph for this function:

void LLCamera::setView ( F32  new_view  ) 

void LLCamera::setViewHeightInPixels ( S32  height  ) 

Definition at line 103 of file llcamera.cpp.

References calculateFrustumPlanes(), and mViewHeightInPixels.

Referenced by idle_startup(), LLAgent::init(), and LLViewerWindow::reshape().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLCamera::setAspect ( F32  new_aspect  ) 

void LLCamera::setNear ( F32  new_near  ) 

void LLCamera::setFar ( F32  new_far  ) 

F32 LLCamera::getView (  )  const [inline]

S32 LLCamera::getViewHeightInPixels (  )  const [inline]

F32 LLCamera::getAspect (  )  const [inline]

F32 LLCamera::getNear (  )  const [inline]

F32 LLCamera::getFar (  )  const [inline]

F32 LLCamera::getYaw (  )  const [inline]

Definition at line 151 of file llcamera.h.

References LLCoordFrame::mXAxis, VX, and VY.

Referenced by calculateWorldFrustumPlanes(), LLVOAvatar::getImpostorValues(), and LLWLParamManager::update().

Here is the caller graph for this function:

F32 LLCamera::getPitch (  )  const [inline]

Definition at line 155 of file llcamera.h.

References LLCoordFrame::mXAxis, sqrtf, VX, VY, and VZ.

Referenced by LLVOAvatar::getImpostorValues().

Here is the caller graph for this function:

const LLPlane& LLCamera::getWorldPlane ( S32  index  )  const [inline]

Definition at line 161 of file llcamera.h.

References mWorldPlanes.

const LLVector3& LLCamera::getWorldPlanePos (  )  const [inline]

Definition at line 162 of file llcamera.h.

References mWorldPlanePos.

size_t LLCamera::writeFrustumToBuffer ( char *  buffer  )  const

Definition at line 140 of file llcamera.cpp.

References mAspect, mFarPlane, mNearPlane, and mView.

size_t LLCamera::readFrustumFromBuffer ( const char *  buffer  ) 

Definition at line 152 of file llcamera.cpp.

References mAspect, mFarPlane, mNearPlane, and mView.

void LLCamera::calcAgentFrustumPlanes ( LLVector3 frust  ) 

Definition at line 560 of file llcamera.cpp.

References calcPlaneMask(), LLCoordFrame::getOrigin(), i, mAgentFrustum, mAgentPlanes, LLCamera::frustum_plane::mask, mFrustumCornerDist, mPlaneCount, p, LLCamera::frustum_plane::p, and planeFromPoints().

Referenced by LLViewerCamera::updateFrustumPlanes().

Here is the call graph for this function:

Here is the caller graph for this function:

int LLCamera::sphereInFrustumOld ( const LLVector3 center,
const F32  radius 
) const

int LLCamera::sphereInFrustum ( const LLVector3 center,
const F32  radius 
) const

Definition at line 369 of file llcamera.cpp.

References d, LLPlane::dist(), i, mAgentPlanes, and LLCamera::frustum_plane::p.

Referenced by LLToolSelectRect::handleRectangleSelection(), pointInFrustum(), sphereInFrustumFull(), and LLWorld::updateVisibilities().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLCamera::pointInFrustum ( const LLVector3 point  )  const [inline]

Definition at line 176 of file llcamera.h.

References sphereInFrustum().

Referenced by LLViewerCamera::areVertsVisible().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLCamera::sphereInFrustumFull ( const LLVector3 center,
const F32  radius 
) const [inline]

Definition at line 177 of file llcamera.h.

References sphereInFrustum().

Here is the call graph for this function:

S32 LLCamera::AABBInFrustum ( const LLVector3 center,
const LLVector3 radius 
)

Definition at line 167 of file llcamera.cpp.

References d, i, mAgentPlanes, LLCamera::frustum_plane::mask, mPlaneCount, LLVector4::mV, n, LLCamera::frustum_plane::p, p, S32, and LLVector3::scaledVec().

Here is the call graph for this function:

S32 LLCamera::AABBInFrustumNoFarClip ( const LLVector3 center,
const LLVector3 radius 
)

Definition at line 208 of file llcamera.cpp.

References d, i, mAgentPlanes, LLCamera::frustum_plane::mask, mPlaneCount, LLVector4::mV, n, LLCamera::frustum_plane::p, p, S32, and LLVector3::scaledVec().

Referenced by LLSpatialBridge::setVisible().

Here is the call graph for this function:

Here is the caller graph for this function:

int LLCamera::sphereInFrustumQuick ( const LLVector3 sphere_center,
const F32  radius 
)

Definition at line 254 of file llcamera.cpp.

References mFarPlane, and mFrustCenter.

F32 LLCamera::heightInPixels ( const LLVector3 center,
F32  radius 
) const

Definition at line 393 of file llcamera.cpp.

References LLVector3::magVec(), LLCoordFrame::mOrigin, mView, and mViewHeightInPixels.

Here is the call graph for this function:

F32 LLCamera::visibleDistance ( const LLVector3 pos,
F32  rad,
F32  fudgescale = 1.0f,
U32  planemask = PLANE_ALL_MASK 
) const

Definition at line 425 of file llcamera.cpp.

References LLPlane::dist(), LLVector3::magVec(), mFixedDistance, LLCoordFrame::mOrigin, mWorldPlanes, LLCoordFrame::mXAxis, p, and PLANE_NUM.

Here is the call graph for this function:

F32 LLCamera::visibleHorizDistance ( const LLVector3 pos,
F32  rad,
F32  fudgescale = 1.0f,
U32  planemask = HORIZ_PLANE_ALL_MASK 
) const

Definition at line 457 of file llcamera.cpp.

References LLPlane::dist(), HORIZ_PLANE_NUM, LLVector3::magVec(), mFixedDistance, mHorizPlanes, LLCoordFrame::mOrigin, and p.

Here is the call graph for this function:

void LLCamera::setFixedDistance ( F32  distance  )  [inline]

Definition at line 191 of file llcamera.h.

References mFixedDistance.

void LLCamera::calculateFrustumPlanes (  )  [protected]

Definition at line 515 of file llcamera.cpp.

References mAspect, mFarPlane, mView, and tanf.

Referenced by calculateFrustumPlanesFromWindow(), LLCamera(), setAspect(), setFar(), setNear(), setView(), and setViewHeightInPixels().

Here is the caller graph for this function:

void LLCamera::calculateFrustumPlanes ( F32  left,
F32  right,
F32  top,
F32  bottom 
) [protected]

void LLCamera::calculateFrustumPlanesFromWindow ( F32  x1,
F32  y1,
F32  x2,
F32  y2 
) [protected]

Definition at line 629 of file llcamera.cpp.

References calculateFrustumPlanes(), mAspect, mFarPlane, mView, and tanf.

Referenced by LLViewerCamera::setPerspective().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLCamera::calculateWorldFrustumPlanes (  )  [protected]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const LLCamera C 
) [friend]

Definition at line 484 of file llcamera.cpp.


Member Data Documentation

F32 LLCamera::mView [protected]

F32 LLCamera::mAspect [protected]

F32 LLCamera::mFarPlane [protected]

Definition at line 111 of file llcamera.h.

Referenced by setFixedDistance(), visibleDistance(), and visibleHorizDistance().

Definition at line 112 of file llcamera.h.

Referenced by calculateFrustumPlanes(), and sphereInFrustumQuick().

Definition at line 113 of file llcamera.h.

Referenced by calculateFrustumPlanes().

LLPlane LLCamera::mWorldPlanes[PLANE_NUM] [protected]

Definition at line 115 of file llcamera.h.

Referenced by calculateWorldFrustumPlanes(), getWorldPlane(), and visibleDistance().

LLPlane LLCamera::mHorizPlanes[HORIZ_PLANE_NUM] [protected]

Definition at line 116 of file llcamera.h.

Referenced by calculateWorldFrustumPlanes(), and visibleHorizDistance().

Definition at line 127 of file llcamera.h.

Referenced by calculateWorldFrustumPlanes(), and getWorldPlanePos().

Definition at line 129 of file llcamera.h.

Referenced by calcAgentFrustumPlanes().

Definition at line 130 of file llcamera.h.

Referenced by calcAgentFrustumPlanes(), and LLSpatialBridge::setVisible().


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

Generated on Fri May 16 08:39:41 2008 for SecondLife by  doxygen 1.5.5