Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
W3DTerrainLogic Class Reference

#include <W3DTerrainLogic.h>

Inherits TerrainLogic.

Public Member Functions

 W3DTerrainLogic ()
 
virtual ~W3DTerrainLogic ()
 
virtual void init (void)
 Init.
 
virtual void reset (void)
 Reset.
 
virtual void update (void)
 Update.
 
virtual Bool loadMap (AsciiString filename, Bool query)
 
virtual void newMap (Bool saveGame)
 Initialize the logic for new map.
 
virtual Real getGroundHeight (Real x, Real y, Coord3D *normal=NULL) const
 
virtual Bool isCliffCell (Real x, Real y) const
 is point cliff cell.
 
virtual Real getLayerHeight (Real x, Real y, PathfindLayerEnum layer, Coord3D *normal=NULL, Bool clip=true) const
 
virtual void getExtent (Region3D *extent) const
 Get the 3D extent of the terrain in world coordinates.
 
virtual void getMaximumPathfindExtent (Region3D *extent) const
 
virtual void getExtentIncludingBorder (Region3D *extent) const
 
virtual Bool isClearLineOfSight (const Coord3D &pos, const Coord3D &posOther) const
 
- Public Member Functions inherited from TerrainLogic
 TerrainLogic ()
 
virtual ~TerrainLogic ()
 
virtual Coord3D findClosestEdgePoint (const Coord3D *closestTo) const
 
virtual Coord3D findFarthestEdgePoint (const Coord3D *farthestFrom) const
 
virtual AsciiString getSourceFilename (void)
 
virtual PathfindLayerEnum alignOnTerrain (Real angle, const Coord3D &pos, Bool stickToGround, Matrix3D &mtx)
 
virtual Bool isUnderwater (Real x, Real y, Real *waterZ=NULL, Real *terrainZ=NULL)
 is point under water
 
virtual const WaterHandlegetWaterHandle (Real x, Real y)
 get water handle at this location
 
virtual const WaterHandlegetWaterHandleByName (AsciiString name)
 get water handle by name
 
virtual Real getWaterHeight (const WaterHandle *water)
 get height of water table
 
virtual void setWaterHeight (const WaterHandle *water, Real height, Real damageAmount, Bool forcePathfindUpdate)
 set height of water table
 
virtual void changeWaterHeightOverTime (const WaterHandle *water, Real finalHeight, Real transitionTimeInSeconds, Real damageAmount)
 change water height over time
 
virtual WaypointgetFirstWaypoint (void)
 
virtual WaypointgetWaypointByName (AsciiString name)
 Return the waypoint with the given name.
 
virtual WaypointgetWaypointByID (UnsignedInt id)
 Return the waypoint with the given ID.
 
virtual WaypointgetClosestWaypointOnPath (const Coord3D *pos, AsciiString label)
 Return the closest waypoint on the labeled path.
 
virtual Bool isPurposeOfPath (Waypoint *pWay, AsciiString label)
 Return true if the waypoint path containint pWay is labeled with the label.
 
virtual PolygonTriggergetTriggerAreaByName (AsciiString name)
 Return the trigger area with the given name.
 
virtual BridgegetFirstBridge (void) const
 Gets the first bridge. Traverse all bridges using bridge->getNext();.
 
virtual BridgefindBridgeAt (const Coord3D *pLoc) const
 Find the bridge at a location. NULL means no bridge.
 
virtual BridgefindBridgeLayerAt (const Coord3D *pLoc, PathfindLayerEnum layer, Bool clip=true) const
 Find the bridge at a location. NULL means no bridge. Note that the layer value will be used to resolve crossing bridges.
 
virtual Bool objectInteractsWithBridgeLayer (Object *obj, Int layer, Bool considerBridgeHealth=true) const
 Returns true if the object is close enough to interact with the bridge for pathfinding.
 
virtual Bool objectInteractsWithBridgeEnd (Object *obj, Int layer) const
 Returns true if the object is close to one or the other end of the bridge.
 
virtual DrawablepickBridge (const Vector3 &from, const Vector3 &to, Vector3 *pos)
 
virtual void addBridgeToLogic (BridgeInfo *pInfo, Dict *props, AsciiString bridgeTemplateName)
 Adds a bridge's logical info.
 
virtual void addLandmarkBridgeToLogic (Object *bridgeObj)
 Adds a bridge's logical info.
 
virtual void deleteBridge (Bridge *bridge)
 remove a bridge
 
virtual void updateBridgeDamageStates (void)
 Updates bridge's damage info.
 
Bool anyBridgesDamageStatesChanged (void)
 Bridge damage states updated.
 
Bool isBridgeRepaired (const Object *bridge)
 Is bridge repaired?
 
Bool isBridgeBroken (const Object *bridge)
 Is bridge Broken?
 
void getBridgeAttackPoints (const Object *bridge, TBridgeAttackInfo *info)
 Get bridge attack points.
 
PathfindLayerEnum getLayerForDestination (const Coord3D *pos)
 
PathfindLayerEnum getHighestLayerForDestination (const Coord3D *pos, Bool onlyHealthyBridges=false)
 
void enableWaterGrid (Bool enable)
 enable/disable the water grid
 
Int getActiveBoundary (void)
 
void setActiveBoundary (Int newActiveBoundary)
 
void flattenTerrain (Object *obj)
 Flatten the terrain under a building.
 
void createCraterInTerrain (Object *obj)
 Flatten the terrain under a building.
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
- Protected Member Functions inherited from TerrainLogic
Bool parseWaypointData (DataChunkInput &file, DataChunkInfo *info, void *userData)
 Chunk parser callback.
 
void addWaypoint (MapObject *pMapObj)
 Add a waypoint to the list.
 
void addWaypointLink (Int id1, Int id2)
 Add a directed link between waypoints.
 
void deleteWaypoints (void)
 Deletes all waypoints.
 
void deleteBridges (void)
 Deletes all bridges.
 
void findAxisAlignedBoundingRect (const WaterHandle *waterHandle, Region3D *region)
 find the axis aligned region bounding the water table
 

Protected Attributes

Real m_mapMinZ
 Minimum terrain z value.
 
Real m_mapMaxZ
 Maximum terrain z value.
 
- Protected Attributes inherited from TerrainLogic
UnsignedBytem_mapData
 array of height samples
 
Int m_mapDX
 width of map samples
 
Int m_mapDY
 height of map samples
 
VecICoord2D m_boundaries
 
Int m_activeBoundary
 
Waypointm_waypointListHead
 
Bridgem_bridgeListHead
 
Bool m_bridgeDamageStatesChanged
 
AsciiString m_filenameString
 filename for terrain data
 
Bool m_waterGridEnabled
 TRUE when water grid is enabled.
 
struct TerrainLogic::DynamicWaterEntry m_waterToUpdate [MAX_DYNAMIC_WATER]
 water tables to dynamicall update
 
Int m_numWaterToUpdate
 how many valid entries are in m_waterToUpdate
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Additional Inherited Members

- Protected Types inherited from TerrainLogic
enum  { MAX_DYNAMIC_WATER = 64 }
 
- Static Protected Member Functions inherited from TerrainLogic
static Bool parseWaypointDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 Chunk parser callback.
 
- Static Protected Attributes inherited from TerrainLogic
static WaterHandle m_gridWaterHandle
 water handle for the grid water (we only presently have one)
 

Detailed Description

W3D specific implementation details for logical terrain ... we have this because the logic and visual terrain are closely tied together in that they represent the same thing, but need to be broken up into logical and graphical representations

Definition at line 43 of file W3DTerrainLogic.h.

Constructor & Destructor Documentation

◆ W3DTerrainLogic()

W3DTerrainLogic::W3DTerrainLogic ( )

Definition at line 52 of file W3DTerrainLogic.cpp.

◆ ~W3DTerrainLogic()

W3DTerrainLogic::~W3DTerrainLogic ( )
virtual

Definition at line 61 of file W3DTerrainLogic.cpp.

Member Function Documentation

◆ crc()

void W3DTerrainLogic::crc ( Xfer * xfer)
protectedvirtual

CRC

Reimplemented from TerrainLogic.

Definition at line 369 of file W3DTerrainLogic.cpp.

◆ getExtent()

void W3DTerrainLogic::getExtent ( Region3D * extent) const
virtual

Get the 3D extent of the terrain in world coordinates.

Get the 3D extent of the terrain in world coordinates

Reimplemented from TerrainLogic.

Definition at line 200 of file W3DTerrainLogic.cpp.

◆ getExtentIncludingBorder()

void W3DTerrainLogic::getExtentIncludingBorder ( Region3D * extent) const
virtual
Todo
This should not be a stub - this should own this functionality

Reimplemented from TerrainLogic.

Definition at line 252 of file W3DTerrainLogic.cpp.

◆ getGroundHeight()

Real W3DTerrainLogic::getGroundHeight ( Real x,
Real y,
Coord3D * normal = NULL ) const
virtual

W3D specific get height function for logical terrain

Reimplemented from TerrainLogic.

Definition at line 280 of file W3DTerrainLogic.cpp.

◆ getLayerHeight()

Real W3DTerrainLogic::getLayerHeight ( Real x,
Real y,
PathfindLayerEnum layer,
Coord3D * normal = NULL,
Bool clip = true ) const
virtual

Get the height considering the layer.

Reimplemented from TerrainLogic.

Definition at line 305 of file W3DTerrainLogic.cpp.

◆ getMaximumPathfindExtent()

void W3DTerrainLogic::getMaximumPathfindExtent ( Region3D * extent) const
virtual

Get the 3D largest bounds defined in the map.

Reimplemented from TerrainLogic.

Definition at line 224 of file W3DTerrainLogic.cpp.

◆ init()

void W3DTerrainLogic::init ( void )
virtual

Init.

Device DEPENDENT implementation init details for logical terrain

Reimplemented from TerrainLogic.

Definition at line 71 of file W3DTerrainLogic.cpp.

◆ isClearLineOfSight()

Bool W3DTerrainLogic::isClearLineOfSight ( const Coord3D & pos,
const Coord3D & posOther ) const
virtual

Reimplemented from TerrainLogic.

Definition at line 265 of file W3DTerrainLogic.cpp.

◆ isCliffCell()

Bool W3DTerrainLogic::isCliffCell ( Real x,
Real y ) const
virtual

is point cliff cell.

W3D isCliffCell for terrain logic

Reimplemented from TerrainLogic.

Definition at line 359 of file W3DTerrainLogic.cpp.

◆ loadMap()

Bool W3DTerrainLogic::loadMap ( AsciiString filename,
Bool query )
virtual
Todo
The loading of the raw height data should be device independent

Device DEPENDENT implementation for load details of logical terrain. Note - if query is true, we are

< holds raw heightmap data samples

Reimplemented from TerrainLogic.

Definition at line 118 of file W3DTerrainLogic.cpp.

◆ loadPostProcess()

void W3DTerrainLogic::loadPostProcess ( void )
protectedvirtual

Load post process

Reimplemented from TerrainLogic.

Definition at line 398 of file W3DTerrainLogic.cpp.

◆ newMap()

void W3DTerrainLogic::newMap ( Bool saveGame)
virtual

Initialize the logic for new map.

newMap

Reimplemented from TerrainLogic.

Definition at line 99 of file W3DTerrainLogic.cpp.

◆ reset()

void W3DTerrainLogic::reset ( void )
virtual

Reset.

Reset

Reimplemented from TerrainLogic.

Definition at line 86 of file W3DTerrainLogic.cpp.

◆ update()

void W3DTerrainLogic::update ( void )
virtual

Update.

Update

Reimplemented from TerrainLogic.

Definition at line 109 of file W3DTerrainLogic.cpp.

◆ xfer()

void W3DTerrainLogic::xfer ( Xfer * xfer)
protectedvirtual

Xfer Version Info: 1: Initial version

Reimplemented from TerrainLogic.

Definition at line 382 of file W3DTerrainLogic.cpp.

Member Data Documentation

◆ m_mapMaxZ

Real W3DTerrainLogic::m_mapMaxZ
protected

Maximum terrain z value.

Definition at line 81 of file W3DTerrainLogic.h.

◆ m_mapMinZ

Real W3DTerrainLogic::m_mapMinZ
protected

Minimum terrain z value.

Definition at line 80 of file W3DTerrainLogic.h.


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