#include <llvowlsky.h>
Public Member Functions | |
LLVOWLSky (const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) | |
void | initSunDirection (LLVector3 const &sun_direction, LLVector3 const &sun_angular_velocity) |
BOOL | idleUpdate (LLAgent &agent, LLWorld &world, const F64 &time) |
BOOL | isActive (void) const |
LLDrawable * | createDrawable (LLPipeline *pipeline) |
BOOL | updateGeometry (LLDrawable *drawable) |
void | drawStars (void) |
void | drawDome (void) |
void | resetVertexBuffers (void) |
void | cleanupGL () |
void | restoreGL () |
Private Member Functions | |
void | initStars () |
void | updateStarColors () |
BOOL | updateStarGeometry (LLDrawable *drawable) |
Static Private Member Functions | |
static U32 | getNumStacks (void) |
static U32 | getNumSlices (void) |
static U32 | getFanNumVerts (void) |
static U32 | getFanNumIndices (void) |
static U32 | getStripsNumVerts (void) |
static U32 | getStripsNumIndices (void) |
static U32 | getStarsNumVerts (void) |
static U32 | getStarsNumIndices (void) |
static F32 | calcPhi (U32 i) |
static void | buildFanBuffer (LLStrider< LLVector3 > &vertices, LLStrider< LLVector2 > &texCoords, LLStrider< U16 > &indices) |
static void | buildStripsBuffer (U32 begin_stack, U32 end_stack, LLStrider< LLVector3 > &vertices, LLStrider< LLVector2 > &texCoords, LLStrider< U16 > &indices) |
Private Attributes | |
LLPointer< LLVertexBuffer > | mFanVerts |
std::vector< LLPointer < LLVertexBuffer > > | mStripsVerts |
LLPointer< LLVertexBuffer > | mStarsVerts |
std::vector< LLVector3 > | mStarVertices |
std::vector< LLColor4 > | mStarColors |
std::vector< F32 > | mStarIntensities |
Static Private Attributes | |
static const F32 | DISTANCE_TO_STARS = (HORIZON_DIST - 10.f)*0.25f |
static const U32 | MIN_SKY_DETAIL = 3 |
static const U32 | MAX_SKY_DETAIL = 180 |
Definition at line 37 of file llvowlsky.h.
LLVOWLSky::LLVOWLSky | ( | const LLUUID & | id, | |
const LLPCode | pcode, | |||
LLViewerRegion * | regionp | |||
) |
Definition at line 89 of file llvowlsky.cpp.
References initStars().
U32 LLVOWLSky::getNumStacks | ( | void | ) | [inline, static, private] |
Definition at line 49 of file llvowlsky.cpp.
References LLControlGroup::getU32(), and gSavedSettings.
Referenced by buildStripsBuffer(), calcPhi(), getStripsNumIndices(), getStripsNumVerts(), and updateGeometry().
U32 LLVOWLSky::getNumSlices | ( | void | ) | [inline, static, private] |
Definition at line 54 of file llvowlsky.cpp.
References LLControlGroup::getU32(), and gSavedSettings.
Referenced by buildFanBuffer(), buildStripsBuffer(), getFanNumIndices(), getFanNumVerts(), getStripsNumIndices(), getStripsNumVerts(), and updateGeometry().
U32 LLVOWLSky::getFanNumVerts | ( | void | ) | [inline, static, private] |
Definition at line 59 of file llvowlsky.cpp.
References getNumSlices().
Referenced by buildFanBuffer(), and updateGeometry().
U32 LLVOWLSky::getFanNumIndices | ( | void | ) | [inline, static, private] |
Definition at line 64 of file llvowlsky.cpp.
References getNumSlices().
Referenced by buildFanBuffer(), and updateGeometry().
U32 LLVOWLSky::getStripsNumVerts | ( | void | ) | [inline, static, private] |
Definition at line 69 of file llvowlsky.cpp.
References getNumSlices(), and getNumStacks().
U32 LLVOWLSky::getStripsNumIndices | ( | void | ) | [inline, static, private] |
Definition at line 74 of file llvowlsky.cpp.
References getNumSlices(), and getNumStacks().
U32 LLVOWLSky::getStarsNumVerts | ( | void | ) | [inline, static, private] |
Definition at line 79 of file llvowlsky.cpp.
Referenced by initStars(), updateStarColors(), and updateStarGeometry().
U32 LLVOWLSky::getStarsNumIndices | ( | void | ) | [inline, static, private] |
Definition at line 84 of file llvowlsky.cpp.
Referenced by drawStars(), and updateStarGeometry().
void LLVOWLSky::initSunDirection | ( | LLVector3 const & | sun_direction, | |
LLVector3 const & | sun_angular_velocity | |||
) |
Definition at line 95 of file llvowlsky.cpp.
BOOL LLVOWLSky::isActive | ( | void | ) | const [virtual] |
LLDrawable * LLVOWLSky::createDrawable | ( | LLPipeline * | pipeline | ) | [virtual] |
Reimplemented from LLViewerObject.
Definition at line 110 of file llvowlsky.cpp.
References LLPipeline::allocDrawable(), LLPipeline::getPool(), gPipeline, LLViewerObject::mDrawable, LLDrawPool::POOL_WL_SKY, and LLPipeline::RENDER_TYPE_WL_SKY.
BOOL LLVOWLSky::updateGeometry | ( | LLDrawable * | drawable | ) | [virtual] |
Reimplemented from LLViewerObject.
Definition at line 309 of file llvowlsky.cpp.
References LLVertexBuffer::allocateBuffer(), buildFanBuffer(), buildStripsBuffer(), LLVertexBuffer::calcStride(), LLFastTimer::FTM_GEO_SKY, getFanNumIndices(), getFanNumVerts(), LLVertexBuffer::getIndexStrider(), getNumSlices(), getNumStacks(), LLControlGroup::getS32(), LLVertexBuffer::getTexCoordStrider(), LLVertexBuffer::getVertexStrider(), gSavedSettings, i, llassert, llendl, llerrs, llinfos, LLVertexBuffer::MAP_VERTEX, mFanVerts, mStripsVerts, LLVector3::mV, LLVector3::normVec(), NULL, RADIUS, S32, LLPipeline::sCompiles, LLVertexBuffer::setBuffer(), LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, TRUE, updateStarColors(), and updateStarGeometry().
Referenced by drawDome().
void LLVOWLSky::drawStars | ( | void | ) |
Definition at line 485 of file llvowlsky.cpp.
References getStarsNumIndices(), mStarsVerts, LLPointer< Type >::notNull(), LLVertexBuffer::POINTS, and LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK.
void LLVOWLSky::drawDome | ( | void | ) |
Definition at line 495 of file llvowlsky.cpp.
References LLPipeline::addTrianglesDrawn(), LLVertexBuffer::drawRange(), LLVertexBuffer::getRequestedIndices(), LLVertexBuffer::getRequestedVerts(), gPipeline, LLViewerObject::mDrawable, mStripsVerts, LLVertexBuffer::setBuffer(), LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, LLVertexBuffer::TRIANGLE_STRIP, LLVertexBuffer::unbind(), and updateGeometry().
void LLVOWLSky::resetVertexBuffers | ( | void | ) |
Definition at line 285 of file llvowlsky.cpp.
References gPipeline, LLPipeline::markRebuild(), LLViewerObject::mDrawable, mFanVerts, mStarsVerts, mStripsVerts, NULL, LLDrawable::REBUILD_ALL, and TRUE.
void LLVOWLSky::cleanupGL | ( | ) |
Definition at line 294 of file llvowlsky.cpp.
References LLDrawPoolWLSky::cleanupGL(), mFanVerts, mStarsVerts, mStripsVerts, and NULL.
void LLVOWLSky::restoreGL | ( | ) |
Definition at line 303 of file llvowlsky.cpp.
References gPipeline, LLPipeline::markRebuild(), LLViewerObject::mDrawable, LLDrawable::REBUILD_ALL, LLDrawPoolWLSky::restoreGL(), and TRUE.
Definition at line 122 of file llvowlsky.cpp.
References F_PI, and getNumStacks().
Referenced by buildFanBuffer(), and buildStripsBuffer().
void LLVOWLSky::initStars | ( | ) | [private] |
Definition at line 534 of file llvowlsky.cpp.
References DISTANCE_TO_STARS, getStarsNumVerts(), i, ll_frand(), llmin(), mStarColors, mStarIntensities, mStarVertices, VALPHA, VBLUE, VGREEN, VRED, VX, VY, and VZ.
Referenced by LLVOWLSky().
void LLVOWLSky::buildFanBuffer | ( | LLStrider< LLVector3 > & | vertices, | |
LLStrider< LLVector2 > & | texCoords, | |||
LLStrider< U16 > & | indices | |||
) | [static, private] |
Definition at line 569 of file llvowlsky.cpp.
References calcPhi(), F_PI, LLWLParamManager::getDomeRadius(), getFanNumIndices(), getFanNumVerts(), getNumSlices(), i, LLWLParamManager::instance(), llassert, and RADIUS.
Referenced by updateGeometry().
void LLVOWLSky::buildStripsBuffer | ( | U32 | begin_stack, | |
U32 | end_stack, | |||
LLStrider< LLVector3 > & | vertices, | |||
LLStrider< LLVector2 > & | texCoords, | |||
LLStrider< U16 > & | indices | |||
) | [static, private] |
Definition at line 629 of file llvowlsky.cpp.
References calcPhi(), F_TWO_PI, LLWLParamManager::getDomeRadius(), getNumSlices(), getNumStacks(), i, LLWLParamManager::instance(), j, llassert, RADIUS, and S32.
Referenced by updateGeometry().
void LLVOWLSky::updateStarColors | ( | ) | [private] |
Definition at line 715 of file llvowlsky.cpp.
References getStarsNumVerts(), gSky, ll_frand(), llclamp(), mStarColors, mStarIntensities, mStarVertices, LLSky::mVOSkyp, LLVector3::normVec(), S32, and VALPHA.
Referenced by updateGeometry().
BOOL LLVOWLSky::updateStarGeometry | ( | LLDrawable * | drawable | ) | [private] |
Definition at line 767 of file llvowlsky.cpp.
References getStarsNumIndices(), getStarsNumVerts(), LLPointer< Type >::isNull(), llendl, llerrs, mStarColors, mStarsVerts, mStarVertices, LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK, and TRUE.
Referenced by updateGeometry().
const F32 LLVOWLSky::DISTANCE_TO_STARS = (HORIZON_DIST - 10.f)*0.25f [static, private] |
const U32 LLVOWLSky::MIN_SKY_DETAIL = 3 [static, private] |
Definition at line 42 of file llvowlsky.h.
const U32 LLVOWLSky::MAX_SKY_DETAIL = 180 [static, private] |
Definition at line 44 of file llvowlsky.h.
LLPointer<LLVertexBuffer> LLVOWLSky::mFanVerts [private] |
Definition at line 101 of file llvowlsky.h.
Referenced by cleanupGL(), resetVertexBuffers(), and updateGeometry().
std::vector< LLPointer<LLVertexBuffer> > LLVOWLSky::mStripsVerts [private] |
Definition at line 102 of file llvowlsky.h.
Referenced by cleanupGL(), drawDome(), resetVertexBuffers(), and updateGeometry().
LLPointer<LLVertexBuffer> LLVOWLSky::mStarsVerts [private] |
Definition at line 103 of file llvowlsky.h.
Referenced by cleanupGL(), drawStars(), resetVertexBuffers(), and updateStarGeometry().
std::vector<LLVector3> LLVOWLSky::mStarVertices [private] |
Definition at line 105 of file llvowlsky.h.
Referenced by initStars(), updateStarColors(), and updateStarGeometry().
std::vector<LLColor4> LLVOWLSky::mStarColors [private] |
Definition at line 106 of file llvowlsky.h.
Referenced by initStars(), updateStarColors(), and updateStarGeometry().
std::vector<F32> LLVOWLSky::mStarIntensities [private] |