Custom render object that draws the heightmap and handles intersection tests. More...
#include <BaseHeightMap.h>
Inherits RenderObjClass, DX8_CleanupHook, and Snapshot.
Inherited by FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Classes | |
| struct | shoreLineTileInfo |
| struct | shoreLineTileSortInfo |
Public Member Functions | |
| BaseHeightMapRenderObjClass (void) | |
| virtual | ~BaseHeightMapRenderObjClass (void) |
| virtual void | ReleaseResources (void) |
| Release all dx8 resources so the device can be reset. | |
| virtual void | ReAcquireResources (void) |
| Reacquire all resources after device reset. | |
| virtual RenderObjClass * | Clone (void) const |
| virtual int | Class_ID (void) const |
| virtual void | Render (RenderInfoClass &rinfo)=0 |
| virtual bool | Cast_Ray (RayCollisionTestClass &raytest) |
| virtual void | Get_Obj_Space_Bounding_Sphere (SphereClass &sphere) const |
| virtual void | Get_Obj_Space_Bounding_Box (AABoxClass &aabox) const |
| virtual void | On_Frame_Update (void) |
| virtual void | Notify_Added (SceneClass *scene) |
| virtual int | initHeightData (Int width, Int height, WorldHeightMap *pMap, RefRenderObjListIterator *pLightsIterator, Bool updateExtraPassTiles=TRUE) |
| allocate resources needed to render heightmap | |
| virtual Int | freeMapResources (void) |
| free resources used to render heightmap | |
| virtual void | updateCenter (CameraClass *camera, RefRenderObjListIterator *pLightsIterator) |
| virtual void | adjustTerrainLOD (Int adj) |
| virtual void | doPartialUpdate (const IRegion2D &partialRange, WorldHeightMap *htMap, RefRenderObjListIterator *pLightsIterator)=0 |
| virtual void | staticLightingChanged (void) |
| virtual void | oversizeTerrain (Int tilesToOversize) |
| virtual void | reset (void) |
| void | redirectToHeightmap (WorldHeightMap *pMap) |
| UnsignedByte | getClipHeight (Int x, Int y) const |
| void | setTextureLOD (Int lod) |
| Update the macro texture (pass 3). | |
| void | updateMacroTexture (AsciiString textureName) |
| void | doTextures (Bool flag) |
| void | doTheLight (VERTEX_FORMAT *vb, Vector3 *light, Vector3 *normal, RefRenderObjListIterator *pLightsIterator, UnsignedByte alpha) |
| Update the diffuse value from static light info for one vertex. | |
| void | addScorch (Vector3 location, Real radius, Scorches type) |
| void | addTree (DrawableID id, Coord3D location, Real scale, Real angle, Real randomScaleAmount, const W3DTreeDrawModuleData *data) |
| void | removeAllTrees (void) |
| void | removeTree (DrawableID id) |
| Bool | updateTreePosition (DrawableID id, Coord3D location, Real angle) |
| void | renderTrees (CameraClass *camera) |
| renders the tree buffer. | |
| void | addProp (Int id, Coord3D location, Real angle, Real scale, const AsciiString &modelName) |
| void | removeProp (Int id) |
| void | removeAllProps (void) |
| void | unitMoved (Object *unit) |
| void | notifyShroudChanged (void) |
| void | removeTreesAndPropsForConstruction (const Coord3D *pos, const GeometryInfo &geom, Real angle) |
| void | addTerrainBib (Vector3 corners[4], ObjectID id, Bool highlight) |
| Add a bib at location. | |
| void | addTerrainBibDrawable (Vector3 corners[4], DrawableID id, Bool highlight) |
| void | removeTerrainBib (ObjectID id) |
| Remove a bib. | |
| void | removeTerrainBibDrawable (DrawableID id) |
| void | removeAllTerrainBibs (void) |
| Removes all bibs. | |
| void | removeTerrainBibHighlighting (void) |
| Remove all highlighting. | |
| W3DShroud * | getShroud () |
| void | updateShorelineTiles (Int minX, Int minY, Int maxX, Int maxY, WorldHeightMap *pMap) |
| figure out which tiles on this map cross water plane | |
| void | updateShorelineTile (Int X, Int Y, Int Border, WorldHeightMap *pMap) |
| figure out which tiles on this map cross water plane | |
| void | recordShoreLineSortInfos (void) |
| void | updateViewImpassableAreas (Bool partial=FALSE, Int minX=0, Int maxX=0, Int minY=0, Int maxY=0) |
| void | clearAllScorches (void) |
| void | setTimeOfDay (TimeOfDay tod) |
| void | loadRoadsAndBridges (W3DTerrainLogic *pTerrainLogic, Bool saveGame) |
| Load the roads from the map objects. | |
| void | worldBuilderUpdateBridgeTowers (W3DAssetManager *assetManager, SimpleSceneClass *scene) |
| for the editor updating of bridge tower visuals | |
| Int | getStaticDiffuse (Int x, Int y) |
| Gets the diffuse terrain lighting value for a point on the mesh. | |
| virtual Int | getNumExtraBlendTiles (Bool visible) |
| Int | getNumShoreLineTiles (Bool visible) |
| void | setShoreLineDetail (void) |
| update shoreline tiles in case the feature was toggled by user. | |
| Bool | getMaximumVisibleBox (const FrustumClass &frustum, AABoxClass *box, Bool ignoreMaxHeight) |
| 3d extent of visible terrain. | |
| Real | getHeightMapHeight (Real x, Real y, Coord3D *normal) const |
| return height and normal at given point | |
| Bool | isCliffCell (Real x, Real y) |
| return height and normal at given point | |
| Real | getMinHeight (void) const |
| return minimum height of entire terrain | |
| Real | getMaxHeight (void) const |
| return maximum height of entire terrain | |
| Real | getMaxCellHeight (Real x, Real y) const |
| returns maximum height of the 4 cell corners. | |
| WorldHeightMap * | getMap (void) |
| returns object holding the heightmap samples - need this for fast access. | |
| Bool | isClearLineOfSight (const Coord3D &pos, const Coord3D &posOther) const |
| Bool | getShowImpassableAreas (void) |
| void | setShowImpassableAreas (Bool show) |
| Bool | showAsVisibleCliff (Int xIndex, Int yIndex) const |
| Bool | evaluateAsVisibleCliff (Int xIndex, Int yIndex, Real valuesGreaterThanRad) |
| Real | getViewImpassableAreaSlope (void) const |
| void | setViewImpassableAreaSlope (Real viewSlope) |
| Bool | doesNeedFullUpdate (void) |
| virtual int | updateBlock (Int x0, Int y0, Int x1, Int y1, WorldHeightMap *pMap, RefRenderObjListIterator *pLightsIterator)=0 |
Public Member Functions inherited from RenderObjClass | |
| RenderObjClass (void) | |
| RenderObjClass (const RenderObjClass &src) | |
| RenderObjClass & | operator= (const RenderObjClass &) |
| virtual | ~RenderObjClass (void) |
| virtual const char * | Get_Name (void) const |
| virtual void | Set_Name (const char *name) |
| virtual const char * | Get_Base_Model_Name (void) const |
| virtual void | Set_Base_Model_Name (const char *name) |
| virtual int | Get_Num_Polys (void) const |
| virtual void | Special_Render (SpecialRenderInfoClass &rinfo) |
| virtual void | Restart (void) |
| virtual void | Add (SceneClass *scene) |
| virtual void | Remove (void) |
| virtual SceneClass * | Get_Scene (void) |
| virtual SceneClass * | Peek_Scene (void) |
| virtual void | Set_Container (RenderObjClass *con) |
| virtual void | Validate_Transform (void) const |
| RenderObjClass * | Get_Container (void) const |
| virtual void | Set_Transform (const Matrix3D &m) |
| virtual void | Set_Position (const Vector3 &v) |
| const Matrix3D & | Get_Transform (void) const |
| const Matrix3D & | Get_Transform (bool &is_transform_identity) const |
| const Matrix3D & | Get_Transform_No_Validity_Check (void) const |
| const Matrix3D & | Get_Transform_No_Validity_Check (bool &is_transform_identity) const |
| bool | Is_Transform_Identity () const |
| bool | Is_Transform_Identity_No_Validity_Check () const |
| Vector3 | Get_Position (void) const |
| virtual void | Notify_Removed (SceneClass *scene) |
| virtual int | Get_Num_Sub_Objects (void) const |
| virtual RenderObjClass * | Get_Sub_Object (int index) const |
| virtual int | Add_Sub_Object (RenderObjClass *subobj) |
| virtual int | Remove_Sub_Object (RenderObjClass *robj) |
| virtual RenderObjClass * | Get_Sub_Object_By_Name (const char *name, int *index=NULL) const |
| virtual int | Get_Num_Sub_Objects_On_Bone (int boneindex) const |
| virtual RenderObjClass * | Get_Sub_Object_On_Bone (int index, int boneindex) const |
| virtual int | Get_Sub_Object_Bone_Index (RenderObjClass *subobj) const |
| virtual int | Get_Sub_Object_Bone_Index (int LodIndex, int ModelIndex) const |
| virtual int | Add_Sub_Object_To_Bone (RenderObjClass *subobj, int bone_index) |
| virtual int | Add_Sub_Object_To_Bone (RenderObjClass *subobj, const char *bname) |
| virtual int | Remove_Sub_Objects_From_Bone (int boneindex) |
| virtual int | Remove_Sub_Objects_From_Bone (const char *bname) |
| virtual void | Update_Sub_Object_Transforms (void) |
| virtual void | Set_Animation (void) |
| virtual void | Set_Animation (HAnimClass *motion, float frame, int anim_mode=ANIM_MODE_MANUAL) |
| virtual void | Set_Animation (HAnimClass *motion0, float frame0, HAnimClass *motion1, float frame1, float percentage) |
| virtual void | Set_Animation (HAnimComboClass *anim_combo) |
| virtual HAnimClass * | Peek_Animation (void) |
| virtual int | Get_Num_Bones (void) |
| virtual const char * | Get_Bone_Name (int bone_index) |
| virtual int | Get_Bone_Index (const char *bonename) |
| virtual const Matrix3D & | Get_Bone_Transform (const char *bonename) |
| virtual const Matrix3D & | Get_Bone_Transform (int boneindex) |
| virtual void | Capture_Bone (int bindex) |
| virtual void | Release_Bone (int bindex) |
| virtual bool | Is_Bone_Captured (int bindex) const |
| virtual void | Control_Bone (int bindex, const Matrix3D &objtm, bool world_space_translation=false) |
| virtual const HTreeClass * | Get_HTree (void) const |
| virtual bool | Cast_AABox (AABoxCollisionTestClass &boxtest) |
| virtual bool | Cast_OBBox (OBBoxCollisionTestClass &boxtest) |
| virtual bool | Intersect_AABox (AABoxIntersectionTestClass &boxtest) |
| virtual bool | Intersect_OBBox (OBBoxIntersectionTestClass &boxtest) |
| virtual bool | Intersect (IntersectionClass *Intersection, IntersectionResultClass *Final_Result) |
| virtual bool | Intersect_Sphere (IntersectionClass *Intersection, IntersectionResultClass *Final_Result) |
| virtual bool | Intersect_Sphere_Quick (IntersectionClass *Intersection, IntersectionResultClass *Final_Result) |
| virtual const SphereClass & | Get_Bounding_Sphere (void) const |
| virtual const AABoxClass & | Get_Bounding_Box (void) const |
| virtual void | Update_Obj_Space_Bounding_Volumes (void) |
| virtual void | Prepare_LOD (CameraClass &camera) |
| virtual void | Recalculate_Static_LOD_Factors (void) |
| virtual void | Increment_LOD (void) |
| virtual void | Decrement_LOD (void) |
| virtual float | Get_Cost (void) const |
| virtual float | Get_Value (void) const |
| virtual float | Get_Post_Increment_Value (void) const |
| virtual void | Set_LOD_Level (int lod) |
| virtual int | Get_LOD_Level (void) const |
| virtual int | Get_LOD_Count (void) const |
| virtual void | Set_LOD_Bias (float bias) |
| virtual int | Calculate_Cost_Value_Arrays (float screen_area, float *values, float *costs) const |
| virtual RenderObjClass * | Get_Current_LOD (void) |
| virtual bool | Build_Dependency_List (DynamicVectorClass< StringClass > &file_list, bool recursive=true) |
| virtual bool | Build_Texture_List (DynamicVectorClass< StringClass > &texture_file_list, bool recursive=true) |
| virtual void | Create_Decal (DecalGeneratorClass *generator) |
| virtual void | Delete_Decal (uint32 decal_id) |
| virtual MaterialInfoClass * | Get_Material_Info (void) |
| virtual void | Set_User_Data (void *value, bool recursive=false) |
| virtual void * | Get_User_Data () |
| virtual int | Get_Num_Snap_Points (void) |
| virtual void | Get_Snap_Point (int index, Vector3 *set) |
| virtual float | Get_Screen_Size (CameraClass &camera) |
| virtual void | Scale (float scale) |
| virtual void | Scale (float scalex, float scaley, float scalez) |
| virtual void | Set_ObjectScale (float scale) |
| const float | Get_ObjectScale (void) const |
| void | Set_ObjectColor (unsigned int color) |
| const unsigned int | Get_ObjectColor (void) const |
| virtual int | Get_Sort_Level (void) const |
| virtual void | Set_Sort_Level (int level) |
| virtual int | Is_Really_Visible (void) |
| virtual int | Is_Not_Hidden_At_All (void) |
| virtual int | Is_Visible (void) const |
| virtual void | Set_Visible (int onoff) |
| virtual int | Is_Hidden (void) const |
| virtual void | Set_Hidden (int onoff) |
| virtual int | Is_Animation_Hidden (void) const |
| virtual void | Set_Animation_Hidden (int onoff) |
| virtual int | Is_Force_Visible (void) const |
| virtual void | Set_Force_Visible (int onoff) |
| virtual int | Is_Translucent (void) const |
| virtual void | Set_Translucent (int onoff) |
| virtual int | Is_Alpha (void) const |
| virtual void | Set_Alpha (int onoff) |
| virtual int | Is_Additive (void) const |
| virtual void | Set_Additive (int onoff) |
| virtual int | Get_Collision_Type (void) const |
| virtual void | Set_Collision_Type (int type) |
| virtual bool | Is_Complete (void) |
| virtual bool | Is_In_Scene (void) |
| virtual float | Get_Native_Screen_Size (void) const |
| virtual void | Set_Native_Screen_Size (float screensize) |
| void | Set_Sub_Objects_Match_LOD (int onoff) |
| int | Is_Sub_Objects_Match_LOD_Enabled (void) |
| void | Set_Sub_Object_Transforms_Dirty (bool onoff) |
| bool | Are_Sub_Object_Transforms_Dirty (void) |
| void | Set_Ignore_LOD_Cost (bool onoff) |
| bool | Is_Ignoring_LOD_Cost (void) |
| void | Set_Is_Self_Shadowed () |
| void | Unset_Is_Self_Shadowed () |
| int | Is_Self_Shadowed () const |
| virtual const PersistFactoryClass & | Get_Factory (void) const |
| virtual bool | Save (ChunkSaveClass &csave) |
| virtual bool | Load (ChunkLoadClass &cload) |
| RenderHookClass * | Get_Render_Hook (void) |
| void | Set_Render_Hook (RenderHookClass *hook) |
Public Member Functions inherited from RefCountClass | |
| RefCountClass (void) | |
| RefCountClass (const RefCountClass &) | |
| void | Add_Ref (void) const |
| WWINLINE void | Release_Ref (void) const |
| int | Num_Refs (void) const |
| virtual void | Delete_This (void) |
Public Member Functions inherited from PostLoadableClass | |
| PostLoadableClass (void) | |
| virtual | ~PostLoadableClass (void) |
| virtual void | On_Post_Load (void) |
| bool | Is_Post_Load_Registered (void) |
| void | Set_Post_Load_Registered (bool onoff) |
Public Member Functions inherited from MultiListObjectClass | |
| MultiListObjectClass (void) | |
| virtual | ~MultiListObjectClass (void) |
| MultiListNodeClass * | Get_List_Node () const |
| void | Set_List_Node (MultiListNodeClass *node) |
Public Member Functions inherited from Snapshot | |
| Snapshot (void) | |
| ~Snapshot (void) | |
Protected Types | |
| enum | { MAX_SCORCH_VERTEX =8194 , MAX_SCORCH_INDEX =6*8194 , MAX_SCORCH_MARKS =500 , SCORCH_MARKS_IN_TEXTURE =9 , SCORCH_PER_ROW = 3 } |
Protected Types inherited from RenderObjClass | |
| enum | { COLL_TYPE_MASK = 0x000000FF , IS_VISIBLE = 0x00000100 , IS_NOT_HIDDEN = 0x00000200 , IS_NOT_ANIMATION_HIDDEN = 0x00000400 , IS_FORCE_VISIBLE = 0x00000800 , BOUNDING_VOLUMES_VALID = 0x00002000 , IS_TRANSLUCENT = 0x00004000 , IGNORE_LOD_COST = 0x00008000 , SUBOBJS_MATCH_LOD = 0x00010000 , SUBOBJ_TRANSFORMS_DIRTY = 0x00020000 , IS_ALPHA = 0x00040000 , IS_ADDITIVE = 0x00100000 , IS_SELF_SHADOWED = 0x00080000 , IS_CHEATER = 0x00100000 , IS_REALLY_VISIBLE = IS_VISIBLE | IS_NOT_HIDDEN | IS_NOT_ANIMATION_HIDDEN , IS_NOT_HIDDEN_AT_ALL = IS_NOT_HIDDEN | IS_NOT_ANIMATION_HIDDEN , DEFAULT_BITS = COLL_TYPE_ALL | IS_NOT_HIDDEN | IS_NOT_ANIMATION_HIDDEN } |
Protected Member Functions | |
| virtual void | crc (Xfer *xfer) |
| virtual void | xfer (Xfer *xfer) |
| virtual void | loadPostProcess (void) |
| void | updateScorches (void) |
| Update m_vertexScorch and m_indexScorch so all scorches will be drawn. | |
| void | allocateScorchBuffers (void) |
| allocate static buffers for drawing scorch marks. | |
| void | freeScorchBuffers (void) |
| frees up scorch buffers. | |
| void | drawScorches (void) |
| Draws the scorch mark polygons in m_vertexScorch. | |
| void | initDestAlphaLUT (void) |
| initialize water depth LUT stored in m_destAlphaTexture | |
| void | renderShoreLines (CameraClass *pCamera) |
| re-render parts of terrain that need custom blending into water edge | |
| void | renderShoreLinesSorted (CameraClass *pCamera) |
| optimized version for game usage. | |
Protected Member Functions inherited from RenderObjClass | |
| virtual void | Add_Dependencies_To_List (DynamicVectorClass< StringClass > &file_list, bool textures_only=false) |
| virtual void | Update_Cached_Bounding_Volumes (void) const |
| virtual void | Update_Sub_Object_Bits (void) |
| bool | Bounding_Volumes_Valid (void) const |
| void | Invalidate_Cached_Bounding_Volumes (void) const |
| void | Validate_Cached_Bounding_Volumes (void) const |
Protected Member Functions inherited from RefCountClass | |
| virtual | ~RefCountClass (void) |
Protected Attributes | |
| Int | m_x |
| dimensions of heightmap | |
| Int | m_y |
| dimensions of heightmap | |
| DX8VertexBufferClass * | m_vertexScorch |
| Scorch vertex buffer. | |
| DX8IndexBufferClass * | m_indexScorch |
| indices defining a triangles for the scorch drawing. | |
| TextureClass * | m_scorchTexture |
| Scorch mark texture. | |
| Int | m_curNumScorchVertices |
| number of vertices used in m_vertexScorch. | |
| Int | m_curNumScorchIndices |
| number of indices used in m_indexScorch. | |
| TScorch | m_scorches [MAX_SCORCH_MARKS] |
| Int | m_numScorches |
| Int | m_scorchesInBuffer |
| how many are in the buffers. If less than numScorches, we need to update | |
| Real | m_curImpassableSlope |
| WorldHeightMap * | m_map |
| Bool | m_useDepthFade |
| fade terrain lighting under water | |
| Bool | m_updating |
| Vector3 | m_depthFade |
| depth based fall off values for r,g,b | |
| Bool | m_disableTextures |
| Bool | m_needFullUpdate |
| True if lighting changed, and we need to update all instead of what moved. | |
| Bool | m_doXNextTime |
| True if we updated y scroll, and need to do x scroll next frame. | |
| Real | m_minHeight |
| minimum value of height samples in heightmap | |
| Real | m_maxHeight |
| maximum value of height samples in heightmap | |
| Bool | m_showImpassableAreas |
| If true, shade impassable areas. | |
| std::vector< bool > | m_showAsVisibleCliff |
| ShaderClass | m_shaderClass |
| shader or rendering state for heightmap | |
| VertexMaterialClass * | m_vertexMaterialClass |
| vertex shader (lighting) for terrain | |
| TextureClass * | m_stageZeroTexture |
| primary texture | |
| TextureClass * | m_stageOneTexture |
| transparent edging texture | |
| CloudMapTerrainTextureClass * | m_stageTwoTexture |
| Cloud map texture. | |
| TextureClass * | m_stageThreeTexture |
| light/noise map texture | |
| AsciiString | m_macroTextureName |
| Name for stage 3 texture. | |
| TextureClass * | m_destAlphaTexture |
| Texture holding destination alpha LUT for water depth. | |
| W3DTreeBuffer * | m_treeBuffer |
| Class for drawing trees and other alpha objects. | |
| W3DPropBuffer * | m_propBuffer |
| Class for drawing trees and other alpha objects. | |
| W3DBibBuffer * | m_bibBuffer |
| Class for drawing trees and other alpha objects. | |
| W3DWaypointBuffer * | m_waypointBuffer |
| Draws waypoints. | |
| W3DRoadBuffer * | m_roadBuffer |
| Class for drawing roads. | |
| W3DBridgeBuffer * | m_bridgeBuffer |
| W3DShroud * | m_shroud |
| Class for drawing the shroud over terrain. | |
| shoreLineTileInfo * | m_shoreLineTilePositions |
| array holding x,y tile positions of all shoreline terrain. | |
| Int | m_numShoreLineTiles |
| number of tiles in m_shoreLineTilePositions. | |
| Int | m_numVisibleShoreLineTiles |
| number of visible tiles. | |
| Int | m_shoreLineTilePositionsSize |
| total size of array including unused memory. | |
| Real | m_currentMinWaterOpacity |
| current value inside the gradient lookup texture. | |
| shoreLineTileSortInfo * | m_shoreLineSortInfos |
| Int | m_shoreLineSortInfosSize |
| Int | m_shoreLineSortInfosXMajor |
| Int | m_shoreLineTileSortMaxCoordinate |
| keep track of coordinate range along axis used for m_shoreLineSortInfos | |
| Int | m_shoreLineTileSortMinCoordinate |
Protected Attributes inherited from RenderObjClass | |
| unsigned long | Bits |
| Matrix3D | Transform |
| float | ObjectScale |
| unsigned int | ObjectColor |
| SphereClass | CachedBoundingSphere |
| AABoxClass | CachedBoundingBox |
| float | NativeScreenSize |
| bool | IsTransformIdentity |
| SceneClass * | Scene |
| RenderObjClass * | Container |
| void * | User_Data |
| RenderHookClass * | RenderHook |
Custom render object that draws the heightmap and handles intersection tests.
Custom W3D render object that's used to process the terrain. It handles virtually everything to do with the terrain, including: drawing, lighting, scorchmarks and intersection tests.
Definition at line 94 of file BaseHeightMap.h.
|
protected |
| Enumerator | |
|---|---|
| MAX_SCORCH_VERTEX | |
| MAX_SCORCH_INDEX | |
| MAX_SCORCH_MARKS | |
| SCORCH_MARKS_IN_TEXTURE | |
| SCORCH_PER_ROW | |
Definition at line 245 of file BaseHeightMap.h.
| BaseHeightMapRenderObjClass::BaseHeightMapRenderObjClass | ( | void | ) |
Constructor. Mostly nulls out the member variables.
Definition at line 256 of file BaseHeightMap.cpp.
|
virtual |
Destructor. Releases w3d assets.
Definition at line 206 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::addProp | ( | Int | id, |
| Coord3D | location, | ||
| Real | angle, | ||
| Real | scale, | ||
| const AsciiString & | modelName ) |
Adds a prop to the prop buffer.
Definition at line 2249 of file BaseHeightMap.cpp.
Adds a scorch mark.
Definition at line 2052 of file BaseHeightMap.cpp.
Add a bib at location.
Adds a terrainBib to the bib buffer.
Definition at line 2299 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::addTerrainBibDrawable | ( | Vector3 | corners[4], |
| DrawableID | id, | ||
| Bool | highlight ) |
Adds a terrainBib to the bib buffer.
Definition at line 2310 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::addTree | ( | DrawableID | id, |
| Coord3D | location, | ||
| Real | scale, | ||
| Real | angle, | ||
| Real | randomScaleAmount, | ||
| const W3DTreeDrawModuleData * | data ) |
Adds a tree to the tree buffer.
Definition at line 2199 of file BaseHeightMap.cpp.
|
virtual |
Adjust the terrain Level Of Detail. If adj > 0 , increases LOD 1 step, if adj < 0 decreases it one step, if adj==0, then just sets up for the current LOD
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 341 of file BaseHeightMap.cpp.
|
protected |
allocate static buffers for drawing scorch marks.
Allocates the vertex buffer and texture for scorches.
Definition at line 1890 of file BaseHeightMap.cpp.
|
virtual |
/** Return intersection of a ray with the heightmap mesh. This is a quick version that just checks every polygon inside a 2D bounding rectangle of the ray projected onto the heightfield plane. For most of our view-picking cases the ray in almost perpendicular to the map plane so this is very quick (small bounding box). But it can become slow for arbitrary rays such as those used in AI visbility checks.(2 units on opposite corners of the map would check every polygon in the map).
Reimplemented from RenderObjClass.
Reimplemented in WBHeightMap.
Definition at line 691 of file BaseHeightMap.cpp.
|
virtual |
returns the class id, so the scene can tell what kind of render object it has.
Reimplemented from RenderObjClass.
Definition at line 1431 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::clearAllScorches | ( | void | ) |
Removes all scorches.
Definition at line 2039 of file BaseHeightMap.cpp.
|
virtual |
Not used, but required virtual method.
Implements RenderObjClass.
Definition at line 1441 of file BaseHeightMap.cpp.
|
protectedvirtual |
|
inline |
Definition at line 229 of file BaseHeightMap.h.
|
pure virtual |
Implemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
|
inline |
Definition at line 161 of file BaseHeightMap.h.
| void BaseHeightMapRenderObjClass::doTheLight | ( | VERTEX_FORMAT * | vb, |
| Vector3 * | light, | ||
| Vector3 * | normal, | ||
| RefRenderObjListIterator * | pLightsIterator, | ||
| UnsignedByte | alpha ) |
Update the diffuse value from static light info for one vertex.
Calculates the diffuse lighting for a vertex in the terrain, taking all of the static lights into account as well. It is possible to just use the normal in the vertex and let D3D do the lighting, but it is slower to render, and can only handle 4 lights at this point.
Definition at line 516 of file BaseHeightMap.cpp.
|
protected |
Draws the scorch mark polygons in m_vertexScorch.
Draws the scorch marks.
Definition at line 178 of file BaseHeightMap.cpp.
| Bool BaseHeightMapRenderObjClass::evaluateAsVisibleCliff | ( | Int | xIndex, |
| Int | yIndex, | ||
| Real | valuesGreaterThanRad ) |
Definition at line 1297 of file BaseHeightMap.cpp.
|
virtual |
free resources used to render heightmap
Frees the w3d resources used to draw the terrain.
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 156 of file BaseHeightMap.cpp.
|
protected |
frees up scorch buffers.
Frees the vertex buffers for scorches.
Definition at line 1878 of file BaseHeightMap.cpp.
|
virtual |
WW3D method that returns object bounding box used in collision detection
Reimplemented from RenderObjClass.
Definition at line 1376 of file BaseHeightMap.cpp.
|
virtual |
WW3D method that returns object bounding sphere used in frustum culling
Reimplemented from RenderObjClass.
Definition at line 1354 of file BaseHeightMap.cpp.
|
inline |
Definition at line 140 of file BaseHeightMap.h.
return height and normal at given point
return the height and normal of the triangle plane containing given location within heightmap.
Definition at line 860 of file BaseHeightMap.cpp.
|
inline |
returns object holding the heightmap samples - need this for fast access.
Definition at line 216 of file BaseHeightMap.h.
returns maximum height of the 4 cell corners.
Returns maximum height of the 4 corners containing the given point
Definition at line 1204 of file BaseHeightMap.cpp.
|
inline |
return maximum height of entire terrain
Definition at line 214 of file BaseHeightMap.h.
| Bool BaseHeightMapRenderObjClass::getMaximumVisibleBox | ( | const FrustumClass & | frustum, |
| AABoxClass * | box, | ||
| Bool | ignoreMaxHeight ) |
3d extent of visible terrain.
Get the 3D extent of the terrain visible through the camera. Return value is false if no part of terrain is visible. This function returns a worse case bounding volume based on lowest/highest points in entire terrain. It does not optimize the volume to heights actually visible. Unlike some of the other methods, this function is guaranteed not to miss any visible polygons. The ignoreMaxHeight flag is used to return a box that uses the camera position as the maximum height instead of the terrain - good for getting a volume enclosing things that can float above terrain.
Definition at line 1401 of file BaseHeightMap.cpp.
|
inline |
return minimum height of entire terrain
Definition at line 213 of file BaseHeightMap.h.
Reimplemented in HeightMapRenderObjClass.
Definition at line 207 of file BaseHeightMap.h.
Definition at line 208 of file BaseHeightMap.h.
|
inline |
Definition at line 219 of file BaseHeightMap.h.
|
inline |
Definition at line 196 of file BaseHeightMap.h.
Gets the diffuse terrain lighting value for a point on the mesh.
Gets the static diffuse color value for a terrain vertex.
Definition at line 2088 of file BaseHeightMap.cpp.
|
inline |
Definition at line 226 of file BaseHeightMap.h.
|
protected |
initialize water depth LUT stored in m_destAlphaTexture
Generate a lookup table which can be used to generate an alpha value from a given set of uv coordinates. Currently used for smoothing water/terrain border
Definition at line 1742 of file BaseHeightMap.cpp.
|
virtual |
allocate resources needed to render heightmap
Allocate a heightmap of x by y vertices and fill with initial height values. Also allocates all rendering resources such as vertex buffers, index buffers, shaders, and materials.
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 1785 of file BaseHeightMap.cpp.
| Bool BaseHeightMapRenderObjClass::isClearLineOfSight | ( | const Coord3D & | pos, |
| const Coord3D & | posOther ) const |
Definition at line 1011 of file BaseHeightMap.cpp.
return height and normal at given point
Returns true if the cell containing the point is a cliff cell
Definition at line 1256 of file BaseHeightMap.cpp.
|
protectedvirtual |
| void BaseHeightMapRenderObjClass::loadRoadsAndBridges | ( | W3DTerrainLogic * | pTerrainLogic, |
| Bool | saveGame ) |
Load the roads from the map objects.
Loads the roads from the map objects.
Definition at line 1452 of file BaseHeightMap.cpp.
|
virtual |
W3D render object method, we use it to add ourselves to tthe update list, so On_Frame_Update gets called.
Reimplemented from RenderObjClass.
Definition at line 2390 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::notifyShroudChanged | ( | void | ) |
Notifies that the local shroud changed.
Definition at line 2287 of file BaseHeightMap.cpp.
|
virtual |
Updates the diffuse color values in the vertices as affected by the dynamic lights.
Reimplemented from RenderObjClass.
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 2162 of file BaseHeightMap.cpp.
|
virtual |
Sets the terrain oversize amount.
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 1342 of file BaseHeightMap.cpp.
|
virtual |
Reacquire all resources after device reset.
Reallocates all W3D assets after a reset..
Implements DX8_CleanupHook.
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 452 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::recordShoreLineSortInfos | ( | void | ) |
This is an extra pre-process of shoreline data to make it more efficient for runtime culling. It is not used by the world builder since it modifies the terrain too frequently. The function also assumes that updateShoreLineTiles() was previously called and inserted the tiles in the correctly sorted order. WARNING!!! Current version assumes we always sort the entire map! So don't set parameters to partial updates!
Definition at line 1498 of file BaseHeightMap.cpp.
|
inline |
Definition at line 133 of file BaseHeightMap.h.
|
virtual |
Release all dx8 resources so the device can be reset.
Releases all w3d assets, to prepare for Reset device call.
Implements DX8_CleanupHook.
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 400 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeAllProps | ( | void | ) |
Adds a prop to the prop buffer.
Definition at line 2275 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeAllTerrainBibs | ( | void | ) |
Removes all bibs.
Removes all terrainBibs from the bib buffer.
Definition at line 2331 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeAllTrees | ( | void | ) |
Adds a tree to the tree buffer.
Definition at line 2224 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeProp | ( | Int | id | ) |
Adds a prop to the prop buffer.
Definition at line 2263 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeTerrainBib | ( | ObjectID | id | ) |
Remove a bib.
Removes a terrainBib from the bib buffer.
Definition at line 2341 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeTerrainBibDrawable | ( | DrawableID | id | ) |
Removes a terrainBib from the bib buffer.
Definition at line 2351 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeTerrainBibHighlighting | ( | void | ) |
Remove all highlighting.
Removes all terrainBib highlighting from the bib buffer.
Definition at line 2321 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeTree | ( | DrawableID | id | ) |
Adds a tree to the tree buffer.
Definition at line 2212 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::removeTreesAndPropsForConstruction | ( | const Coord3D * | pos, |
| const GeometryInfo & | geom, | ||
| Real | angle ) |
Tell that a unit moved.
Definition at line 2184 of file BaseHeightMap.cpp.
|
pure virtual |
Renders (draws) the terrain.
Implements RenderObjClass.
Implemented in FlatHeightMapRenderObjClass, HeightMapRenderObjClass, and WBHeightMap.
Definition at line 2443 of file BaseHeightMap.cpp.
|
protected |
re-render parts of terrain that need custom blending into water edge
Render parts of terrain that are along the coast line and have vertices directly under the water plane. Applying a custom render to these polygons allows for a smoother land->water transition
Definition at line 2451 of file BaseHeightMap.cpp.
|
protected |
optimized version for game usage.
Render parts of terrain that are along the coast line and have vertices directly under the water plane. Applying a custom render to these polygons allows for a smoother land->water transition. This version is exactly like the one above but optimized for the case where tiles are assumed to be sorted. Not used by World Builder.
Definition at line 2624 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::renderTrees | ( | CameraClass * | camera | ) |
renders the tree buffer.
Renders (draws) the trees. Since the trees are transparent, this has to be called after flush.
Definition at line 2969 of file BaseHeightMap.cpp.
|
virtual |
Updates the macro noise/lightmap texture (pass 3)
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 642 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::setShoreLineDetail | ( | void | ) |
update shoreline tiles in case the feature was toggled by user.
Definition at line 1482 of file BaseHeightMap.cpp.
|
inline |
Definition at line 220 of file BaseHeightMap.h.
| void BaseHeightMapRenderObjClass::setTextureLOD | ( | Int | lod | ) |
Update the macro texture (pass 3).
change the maximum mip-level sent to the hardware.
Definition at line 327 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::setTimeOfDay | ( | TimeOfDay | tod | ) |
When the time of day changes, the lighting changes and we need to update.
Definition at line 2379 of file BaseHeightMap.cpp.
|
inline |
Definition at line 227 of file BaseHeightMap.h.
Definition at line 1283 of file BaseHeightMap.cpp.
|
virtual |
Notification that all lighting needs to be recalculated.
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 2361 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::unitMoved | ( | Object * | unit | ) |
Tell that a unit moved.
Definition at line 2172 of file BaseHeightMap.cpp.
|
pure virtual |
Implemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
|
virtual |
Updates the positioning of the drawn portion of the height map in the heightmap. As the view slides around, this determines what is the actually rendered portion of the terrain. Only a 96x96 section is rendered at any time, even though maps can be up to 1024x1024. This function determines which subset is rendered.
Reimplemented in FlatHeightMapRenderObjClass, and HeightMapRenderObjClass.
Definition at line 2405 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::updateMacroTexture | ( | AsciiString | textureName | ) |
Updates the macro noise/lightmap texture (pass 3)
Definition at line 628 of file BaseHeightMap.cpp.
|
protected |
Update m_vertexScorch and m_indexScorch so all scorches will be drawn.
Builds the vertex buffer data for drawing the scorches.
Definition at line 1913 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::updateShorelineTile | ( | Int | X, |
| Int | Y, | ||
| Int | Border, | ||
| WorldHeightMap * | pMap ) |
figure out which tiles on this map cross water plane
Definition at line 1597 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::updateShorelineTiles | ( | Int | minX, |
| Int | minY, | ||
| Int | maxX, | ||
| Int | maxY, | ||
| WorldHeightMap * | pMap ) |
figure out which tiles on this map cross water plane
Scan through our map and record all tiles which cross a water plane and are within visible depth under water.
Definition at line 1653 of file BaseHeightMap.cpp.
| Bool BaseHeightMapRenderObjClass::updateTreePosition | ( | DrawableID | id, |
| Coord3D | location, | ||
| Real | angle ) |
Updates a tree's position and angle in the tree buffer.
Definition at line 2236 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::updateViewImpassableAreas | ( | Bool | partial = FALSE, |
| Int | minX = 0, | ||
| Int | maxX = 0, | ||
| Int | minY = 0, | ||
| Int | maxY = 0 ) |
Generate a lookup table for arbitrary angled impassable area viewing.
Definition at line 1715 of file BaseHeightMap.cpp.
| void BaseHeightMapRenderObjClass::worldBuilderUpdateBridgeTowers | ( | W3DAssetManager * | assetManager, |
| SimpleSceneClass * | scene ) |
for the editor updating of bridge tower visuals
The worldbuilder has it's own method here to update the visual representation of the bridge towers
Definition at line 1473 of file BaseHeightMap.cpp.
|
protectedvirtual |
Xfer Version Info: 1: Initial version
Implements Snapshot.
Definition at line 3001 of file BaseHeightMap.cpp.
|
protected |
Class for drawing trees and other alpha objects.
Definition at line 294 of file BaseHeightMap.h.
|
protected |
Definition at line 299 of file BaseHeightMap.h.
|
protected |
Definition at line 261 of file BaseHeightMap.h.
|
protected |
number of indices used in m_indexScorch.
Definition at line 254 of file BaseHeightMap.h.
|
protected |
number of vertices used in m_vertexScorch.
Definition at line 253 of file BaseHeightMap.h.
|
protected |
current value inside the gradient lookup texture.
Definition at line 322 of file BaseHeightMap.h.
|
protected |
depth based fall off values for r,g,b
Definition at line 271 of file BaseHeightMap.h.
|
protected |
Texture holding destination alpha LUT for water depth.
Definition at line 290 of file BaseHeightMap.h.
|
protected |
Definition at line 272 of file BaseHeightMap.h.
|
protected |
True if we updated y scroll, and need to do x scroll next frame.
Definition at line 274 of file BaseHeightMap.h.
|
protected |
indices defining a triangles for the scorch drawing.
Definition at line 251 of file BaseHeightMap.h.
|
protected |
Name for stage 3 texture.
Definition at line 289 of file BaseHeightMap.h.
|
protected |
Definition at line 268 of file BaseHeightMap.h.
|
protected |
maximum value of height samples in heightmap
Definition at line 276 of file BaseHeightMap.h.
|
protected |
minimum value of height samples in heightmap
Definition at line 275 of file BaseHeightMap.h.
|
protected |
True if lighting changed, and we need to update all instead of what moved.
Definition at line 273 of file BaseHeightMap.h.
|
protected |
Definition at line 256 of file BaseHeightMap.h.
|
protected |
number of tiles in m_shoreLineTilePositions.
Definition at line 319 of file BaseHeightMap.h.
|
protected |
number of visible tiles.
Definition at line 320 of file BaseHeightMap.h.
|
protected |
Class for drawing trees and other alpha objects.
Definition at line 293 of file BaseHeightMap.h.
|
protected |
Class for drawing roads.
Definition at line 297 of file BaseHeightMap.h.
|
protected |
Definition at line 255 of file BaseHeightMap.h.
|
protected |
how many are in the buffers. If less than numScorches, we need to update
Definition at line 258 of file BaseHeightMap.h.
|
protected |
Scorch mark texture.
Definition at line 252 of file BaseHeightMap.h.
|
protected |
shader or rendering state for heightmap
Definition at line 283 of file BaseHeightMap.h.
|
protected |
Definition at line 323 of file BaseHeightMap.h.
|
protected |
Definition at line 324 of file BaseHeightMap.h.
|
protected |
Definition at line 325 of file BaseHeightMap.h.
|
protected |
array holding x,y tile positions of all shoreline terrain.
Definition at line 318 of file BaseHeightMap.h.
|
protected |
total size of array including unused memory.
Definition at line 321 of file BaseHeightMap.h.
|
protected |
keep track of coordinate range along axis used for m_shoreLineSortInfos
Definition at line 326 of file BaseHeightMap.h.
|
protected |
Definition at line 327 of file BaseHeightMap.h.
|
protected |
Definition at line 280 of file BaseHeightMap.h.
|
protected |
If true, shade impassable areas.
Definition at line 277 of file BaseHeightMap.h.
|
protected |
Class for drawing the shroud over terrain.
Definition at line 300 of file BaseHeightMap.h.
|
protected |
transparent edging texture
Definition at line 286 of file BaseHeightMap.h.
|
protected |
light/noise map texture
Definition at line 288 of file BaseHeightMap.h.
|
protected |
Cloud map texture.
Definition at line 287 of file BaseHeightMap.h.
|
protected |
primary texture
Definition at line 285 of file BaseHeightMap.h.
|
protected |
Class for drawing trees and other alpha objects.
Definition at line 292 of file BaseHeightMap.h.
|
protected |
Definition at line 270 of file BaseHeightMap.h.
|
protected |
fade terrain lighting under water
Definition at line 269 of file BaseHeightMap.h.
|
protected |
vertex shader (lighting) for terrain
Definition at line 284 of file BaseHeightMap.h.
|
protected |
Scorch vertex buffer.
Definition at line 250 of file BaseHeightMap.h.
|
protected |
Draws waypoints.
Definition at line 295 of file BaseHeightMap.h.
|
protected |
dimensions of heightmap
Definition at line 241 of file BaseHeightMap.h.
|
protected |
dimensions of heightmap
Definition at line 242 of file BaseHeightMap.h.