#include <VisibilityPatchGrid.h>
Definition at line 33 of file VisibilityPatchGrid.h.
| VisibilityPatchGrid::VisibilityPatchGrid | ( | ) | [private] |
Definition at line 41 of file VisibilityPatchGrid.cpp.
| VisibilityPatchGrid::~VisibilityPatchGrid | ( | ) | [private] |
Definition at line 48 of file VisibilityPatchGrid.cpp.
| VisibilityPatchGrid * VisibilityPatchGrid::instance | ( | ) | [static] |
Definition at line 35 of file VisibilityPatchGrid.cpp.
Referenced by Landscape::actualDrawLandReflection(), Landscape::actualDrawLandShader(), Landscape::actualDrawLandTextured(), TankFalling::collision(), RenderTargets::draw(), RenderTargets::draw2d(), Landscape::drawLand(), Landscape::drawShadows(), Water2Renderer::drawWater(), GroundMaps::generateMaps(), HelpButtonDialog::PerformanceMenu::getMenuToolTip(), TargetRendererImpl::moved(), TargetRendererImpl::setMovedPatch(), RenderTargets::shadowDraw(), Teleport::simulate(), Resurrection::simulate(), Explosion::simulate(), RenderTargets::Renderer3D::simulate(), and TankMovement::simulationMove().
| void VisibilityPatchGrid::generate | ( | ) |
Definition at line 67 of file VisibilityPatchGrid.cpp.
References clear(), epoc_, LandSurround::generate(), VisibilityPatchInfo::generate(), MipMapPatchIndexs::generate(), ScorchedContext::getLandscapeMaps(), ScorchedClient::instance(), landHeight_, landIndexs_, landPatches_, landWidth_, midX_, midY_, patchInfo_, VisibilityPatchQuad::setLocation(), WaterVisibilityPatch::setLocation(), TargetVisibilityPatch::setLocation(), LandVisibilityPatch::setLocation(), surround_, targetHeight_, targetPatches_, targetWidth_, visibilityHeight_, visibilityPatches_, visibilityWidth_, waterHeight_, waterPatches_, and waterWidth_.
Referenced by GroundMaps::generateMaps().
| void VisibilityPatchGrid::calculateVisibility | ( | ) |
Definition at line 273 of file VisibilityPatchGrid.cpp.
References VisibilityPatchQuad::calculateVisibility(), GLCamera::getCurrentCamera(), GLCamera::getCurrentPos(), patchInfo_, VisibilityPatchInfo::reset(), visibilityHeight_, visibilityPatches_, and visibilityWidth_.
Referenced by Landscape::drawLand().
| void VisibilityPatchGrid::recalculateErrors | ( | FixedVector & | position, | |
| fixed | size | |||
| ) |
Definition at line 191 of file VisibilityPatchGrid.cpp.
References fixed::asInt(), landHeight_, landPatches_, landWidth_, MAX, MIN, and LandVisibilityPatch::setRecalculateErrors().
Referenced by TankFalling::collision(), Teleport::simulate(), Resurrection::simulate(), Explosion::simulate(), and TankMovement::simulationMove().
| void VisibilityPatchGrid::drawLand | ( | int | addIndex = 0, |
|
| bool | simple = false | |||
| ) |
Definition at line 290 of file VisibilityPatchGrid.cpp.
References GLVertexBufferObject::bind(), LandVisibilityPatch::draw(), LandVisibilityPatch::getBottomPatch(), GraphicalLandscapeMap::getBufferObject(), MipMapPatchIndexs::getBufferObject(), MipMapPatchIndexs::getIndex(), ScorchedContext::getLandscapeMaps(), VisibilityPatchInfo::getLandVisibility(), LandVisibilityPatch::getLeftPatch(), LandVisibilityPatch::getRightPatch(), GLStateExtension::getTextureUnits(), LandVisibilityPatch::getTopPatch(), LandVisibilityPatch::getVisibilityIndex(), GL_NORMAL_ARRAY, GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, GL_TEXTURE2_ARB, GL_TEXTURE_COORD_ARRAY, GL_VERTEX_ARRAY, glClientActiveTextureARB, glDisableClientState(), glEnableClientState(), GLStateExtension::hasDrawRangeElements(), GLStateExtension::hasMultiTex(), OptionsDisplay::instance(), ScorchedClient::instance(), landHeight_, landIndexs_, landPatches_, landWidth_, patchInfo_, and GLVertexBufferObject::unbind().
Referenced by Landscape::actualDrawLandReflection(), Landscape::actualDrawLandShader(), Landscape::actualDrawLandTextured(), and Landscape::drawShadows().
| void VisibilityPatchGrid::drawLandLODLevels | ( | ) |
Definition at line 406 of file VisibilityPatchGrid.cpp.
References LandVisibilityPatch::drawLODLevel(), LandVisibilityPatch::getBottomPatch(), MipMapPatchIndexs::getIndex(), VisibilityPatchInfo::getLandVisibility(), LandVisibilityPatch::getLeftPatch(), LandVisibilityPatch::getRightPatch(), LandVisibilityPatch::getTopPatch(), LandVisibilityPatch::getVisibilityIndex(), landIndexs_, and patchInfo_.
Referenced by Landscape::actualDrawLandTextured().
| void VisibilityPatchGrid::drawSurround | ( | ) |
Definition at line 434 of file VisibilityPatchGrid.cpp.
References LandSurround::draw(), ScorchedClient::instance(), and surround_.
Referenced by Landscape::actualDrawLandShader(), and Landscape::actualDrawLandTextured().
| void VisibilityPatchGrid::drawWater | ( | Water2Patches & | patches, | |
| MipMapPatchIndexs & | indexes, | |||
| Vector & | cameraPosition, | |||
| Vector | landscapeSize, | |||
| GLSLShaderSetup * | waterShader | |||
| ) |
Definition at line 440 of file VisibilityPatchGrid.cpp.
References GLVertexBufferObject::bind(), Water2Patch::draw(), GAMESTATE_PERF_COUNTER_END, GAMESTATE_PERF_COUNTER_START, WaterVisibilityPatch::getBottomPatch(), MipMapPatchIndexs::getBufferObject(), Water2Patches::getBufferObject(), Water2Patch::getBufferOffSet(), MipMapPatchIndexs::getIndex(), Water2Patch::getInternalData(), WaterVisibilityPatch::getLeftPatch(), WaterVisibilityPatch::getOffset(), Water2Patches::getPatch(), WaterVisibilityPatch::getPosition(), WaterVisibilityPatch::getRightPatch(), OptionsDisplay::getSimpleWaterShaders(), Landscape::getSky(), Sky::getSun(), WaterVisibilityPatch::getTopPatch(), WaterVisibilityPatch::getVisibilityIndex(), VisibilityPatchInfo::getWaterVisibility(), GL_FLOAT, GL_MODELVIEW, GL_MODELVIEW_MATRIX, GL_NORMAL_ARRAY, GL_PROJECTION_MATRIX, GL_TEXTURE, GL_TEXTURE0, GL_TEXTURE1, GL_VERTEX_ARRAY, glActiveTexture, glDisableClientState(), glEnableClientState(), glGetFloatv(), glLoadIdentity(), glMatrixMode(), glMultMatrixf(), glNormalPointer(), glPopMatrix(), glPushMatrix(), glScalef(), glTranslatef(), glVertexPointer(), GLStateExtension::hasDrawRangeElements(), Landscape::instance(), OptionsDisplay::instance(), ScorchedClient::instance(), int(), NULL, patchInfo_, GLSLShaderSetup::set_uniform(), Sun::setLightPosition(), and GLVertexBufferObject::unbind().
Referenced by Water2Renderer::drawWater().
| int VisibilityPatchGrid::getEpocNumber | ( | ) | [inline] |
Definition at line 51 of file VisibilityPatchGrid.h.
References epoc_.
Referenced by TargetRendererImpl::setMovedPatch().
| int VisibilityPatchGrid::getVisibleLandPatchesCount | ( | ) | [inline] |
Definition at line 52 of file VisibilityPatchGrid.h.
References VisibilityPatchInfo::getVisibleLandPatchesCount(), and patchInfo_.
| int VisibilityPatchGrid::getVisibleWaterPatchesCount | ( | ) | [inline] |
Definition at line 54 of file VisibilityPatchGrid.h.
References VisibilityPatchInfo::getVisibleWaterPatchesCount(), and patchInfo_.
| VisibilityPatchInfo& VisibilityPatchGrid::getPatchInfo | ( | ) | [inline] |
Definition at line 57 of file VisibilityPatchGrid.h.
References patchInfo_.
Referenced by RenderTargets::draw(), RenderTargets::draw2d(), RenderTargets::shadowDraw(), and RenderTargets::Renderer3D::simulate().
| LandVisibilityPatch * VisibilityPatchGrid::getLandVisibilityPatch | ( | int | x, | |
| int | y | |||
| ) |
Definition at line 225 of file VisibilityPatchGrid.cpp.
References DIALOG_ASSERT, epoc_, landHeight_, landPatches_, and landWidth_.
Referenced by VisibilityPatchQuad::setLocation().
| TargetVisibilityPatch * VisibilityPatchGrid::getTargetVisibilityPatch | ( | int | x, | |
| int | y | |||
| ) |
Definition at line 241 of file VisibilityPatchGrid.cpp.
References DIALOG_ASSERT, epoc_, midX_, midY_, targetHeight_, targetPatches_, and targetWidth_.
Referenced by TargetRendererImpl::moved(), and VisibilityPatchQuad::setLocation().
| WaterVisibilityPatch * VisibilityPatchGrid::getWaterVisibilityPatch | ( | int | x, | |
| int | y | |||
| ) |
Definition at line 257 of file VisibilityPatchGrid.cpp.
References DIALOG_ASSERT, epoc_, midX_, midY_, waterHeight_, waterPatches_, and waterWidth_.
Referenced by VisibilityPatchQuad::setLocation().
| void VisibilityPatchGrid::clear | ( | ) | [protected] |
Definition at line 52 of file VisibilityPatchGrid.cpp.
References landPatches_, targetPatches_, visibilityPatches_, and waterPatches_.
Referenced by generate().
| void VisibilityPatchGrid::drawLandPatches | ( | ) | [protected] |
int VisibilityPatchGrid::epoc_ [protected] |
Definition at line 63 of file VisibilityPatchGrid.h.
Referenced by generate(), getEpocNumber(), getLandVisibilityPatch(), getTargetVisibilityPatch(), and getWaterVisibilityPatch().
LandSurround VisibilityPatchGrid::surround_ [protected] |
MipMapPatchIndexs VisibilityPatchGrid::landIndexs_ [protected] |
Definition at line 65 of file VisibilityPatchGrid.h.
Referenced by drawLand(), drawLandLODLevels(), and generate().
VisibilityPatchInfo VisibilityPatchGrid::patchInfo_ [protected] |
Definition at line 68 of file VisibilityPatchGrid.h.
Referenced by calculateVisibility(), drawLand(), drawLandLODLevels(), drawWater(), generate(), getPatchInfo(), getVisibleLandPatchesCount(), and getVisibleWaterPatchesCount().
LandVisibilityPatch* VisibilityPatchGrid::landPatches_ [protected] |
Definition at line 69 of file VisibilityPatchGrid.h.
Referenced by clear(), drawLand(), generate(), getLandVisibilityPatch(), and recalculateErrors().
TargetVisibilityPatch* VisibilityPatchGrid::targetPatches_ [protected] |
Definition at line 70 of file VisibilityPatchGrid.h.
Referenced by clear(), generate(), and getTargetVisibilityPatch().
WaterVisibilityPatch* VisibilityPatchGrid::waterPatches_ [protected] |
Definition at line 71 of file VisibilityPatchGrid.h.
Referenced by clear(), generate(), and getWaterVisibilityPatch().
Definition at line 74 of file VisibilityPatchGrid.h.
Referenced by calculateVisibility(), clear(), and generate().
int VisibilityPatchGrid::midX_ [protected] |
Definition at line 77 of file VisibilityPatchGrid.h.
Referenced by generate(), getTargetVisibilityPatch(), and getWaterVisibilityPatch().
int VisibilityPatchGrid::midY_ [protected] |
Definition at line 77 of file VisibilityPatchGrid.h.
Referenced by generate(), getTargetVisibilityPatch(), and getWaterVisibilityPatch().
int VisibilityPatchGrid::landWidth_ [protected] |
Definition at line 78 of file VisibilityPatchGrid.h.
Referenced by drawLand(), generate(), getLandVisibilityPatch(), and recalculateErrors().
int VisibilityPatchGrid::landHeight_ [protected] |
Definition at line 78 of file VisibilityPatchGrid.h.
Referenced by drawLand(), generate(), getLandVisibilityPatch(), and recalculateErrors().
int VisibilityPatchGrid::waterWidth_ [protected] |
Definition at line 79 of file VisibilityPatchGrid.h.
Referenced by generate(), and getWaterVisibilityPatch().
int VisibilityPatchGrid::waterHeight_ [protected] |
Definition at line 79 of file VisibilityPatchGrid.h.
Referenced by generate(), and getWaterVisibilityPatch().
int VisibilityPatchGrid::targetWidth_ [protected] |
Definition at line 80 of file VisibilityPatchGrid.h.
Referenced by generate(), and getTargetVisibilityPatch().
int VisibilityPatchGrid::targetHeight_ [protected] |
Definition at line 80 of file VisibilityPatchGrid.h.
Referenced by generate(), and getTargetVisibilityPatch().
int VisibilityPatchGrid::visibilityWidth_ [protected] |
Definition at line 81 of file VisibilityPatchGrid.h.
Referenced by calculateVisibility(), and generate().
int VisibilityPatchGrid::visibilityHeight_ [protected] |
Definition at line 81 of file VisibilityPatchGrid.h.
Referenced by calculateVisibility(), and generate().
1.5.3