#include <TerrainLogic.h>
Inherits Snapshot, and SubsystemInterface.
Inherited by W3DTerrainLogic.
Classes | |
| struct | DynamicWaterEntry |
Public Member Functions | |
| TerrainLogic () | |
| virtual | ~TerrainLogic () |
| 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 Real | getLayerHeight (Real x, Real y, PathfindLayerEnum layer, Coord3D *normal=NULL, Bool clip=true) const |
| virtual void | getExtent (Region3D *extent) const |
| virtual void | getExtentIncludingBorder (Region3D *extent) const |
| virtual void | getMaximumPathfindExtent (Region3D *extent) const |
| virtual Coord3D | findClosestEdgePoint (const Coord3D *closestTo) const |
| virtual Coord3D | findFarthestEdgePoint (const Coord3D *farthestFrom) const |
| virtual Bool | isClearLineOfSight (const Coord3D &pos, const Coord3D &posOther) 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 Bool | isCliffCell (Real x, Real y) const |
| is point cliff cell | |
| virtual const WaterHandle * | getWaterHandle (Real x, Real y) |
| get water handle at this location | |
| virtual const WaterHandle * | getWaterHandleByName (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 Waypoint * | getFirstWaypoint (void) |
| virtual Waypoint * | getWaypointByName (AsciiString name) |
| Return the waypoint with the given name. | |
| virtual Waypoint * | getWaypointByID (UnsignedInt id) |
| Return the waypoint with the given ID. | |
| virtual Waypoint * | getClosestWaypointOnPath (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 PolygonTrigger * | getTriggerAreaByName (AsciiString name) |
| Return the trigger area with the given name. | |
| virtual Bridge * | getFirstBridge (void) const |
| Gets the first bridge. Traverse all bridges using bridge->getNext();. | |
| virtual Bridge * | findBridgeAt (const Coord3D *pLoc) const |
| Find the bridge at a location. NULL means no bridge. | |
| virtual Bridge * | findBridgeLayerAt (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 Drawable * | pickBridge (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 Types | |
| enum | { MAX_DYNAMIC_WATER = 64 } |
Protected Member Functions | |
| virtual void | crc (Xfer *xfer) |
| virtual void | xfer (Xfer *xfer) |
| virtual void | loadPostProcess (void) |
| 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 | |
Static Protected Member Functions | |
| static Bool | parseWaypointDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData) |
| Chunk parser callback. | |
Protected Attributes | |
| UnsignedByte * | m_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 |
| Waypoint * | m_waypointListHead |
| Bridge * | m_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 |
Static Protected Attributes | |
| static WaterHandle | m_gridWaterHandle |
| water handle for the grid water (we only presently have one) | |
Device independent implementation for some functionality of the logical terrain singleton
Definition at line 217 of file TerrainLogic.h.
|
protected |
| Enumerator | |
|---|---|
| MAX_DYNAMIC_WATER | |
Definition at line 365 of file TerrainLogic.h.
| TerrainLogic::TerrainLogic | ( | ) |
Definition at line 963 of file TerrainLogic.cpp.
|
virtual |
Definition at line 996 of file TerrainLogic.cpp.
|
virtual |
Adds a bridge's logical info.
Adds a bridge's info get height function for logical terrain
Definition at line 1538 of file TerrainLogic.cpp.
|
virtual |
Adds a bridge's logical info.
Adds a bridge's info get height function for logical terrain
Definition at line 1551 of file TerrainLogic.cpp.
|
protected |
Add a directed link between waypoints.
Links 2 waypoints.
Definition at line 1376 of file TerrainLogic.cpp.
|
virtual |
given angle and position, return the matrix aligning this position with the ground
Definition at line 1515 of file TerrainLogic.cpp.
|
inline |
Bridge damage states updated.
Definition at line 300 of file TerrainLogic.h.
|
virtual |
change water height over time
Change the height of a water table over time
Definition at line 2418 of file TerrainLogic.cpp.
|
protectedvirtual |
Implements Snapshot.
Reimplemented in W3DTerrainLogic.
Definition at line 2917 of file TerrainLogic.cpp.
| void TerrainLogic::createCraterInTerrain | ( | Object * | obj | ) |
Flatten the terrain under a building.
Dig a deep circular gorge into the terrain beneath an object.
Definition at line 2862 of file TerrainLogic.cpp.
|
virtual |
|
protected |
|
protected |
Deletes all waypoints.
Deletes the waypoints list.
Definition at line 1415 of file TerrainLogic.cpp.
| void TerrainLogic::enableWaterGrid | ( | Bool | enable | ) |
enable/disable the water grid
Definition at line 1151 of file TerrainLogic.cpp.
|
protected |
find the axis aligned region bounding the water table
Find the axis aligned bounding region around a water table
Definition at line 2479 of file TerrainLogic.cpp.
Find the bridge at a location. NULL means no bridge.
Finds the bridge at a given x/y coordinate.
Definition at line 1655 of file TerrainLogic.cpp.
|
virtual |
Find the bridge at a location. NULL means no bridge. Note that the layer value will be used to resolve crossing bridges.
Finds the bridge at a given x/y coordinate. On a layer.
Definition at line 1671 of file TerrainLogic.cpp.
Returns the ground aligned point on the bounding box closest to the given point
Definition at line 2060 of file TerrainLogic.cpp.
Returns the ground aligned point on the bounding box farthest from the given point
Definition at line 2112 of file TerrainLogic.cpp.
| void TerrainLogic::flattenTerrain | ( | Object * | obj | ) |
Flatten the terrain under a building.
Flatten the terrain beneath a struture.
Definition at line 2644 of file TerrainLogic.cpp.
|
inline |
Definition at line 314 of file TerrainLogic.h.
| void TerrainLogic::getBridgeAttackPoints | ( | const Object * | bridge, |
| TBridgeAttackInfo * | attackInfo ) |
Get bridge attack points.
Gets the attack points for a bridge.
Definition at line 1929 of file TerrainLogic.cpp.
|
virtual |
Return the closest waypoint on the labeled path.
Return the closest waypoint on the labeled path.
Definition at line 1589 of file TerrainLogic.cpp.
|
inlinevirtual |
Reimplemented in W3DTerrainLogic.
Definition at line 235 of file TerrainLogic.h.
|
inlinevirtual |
Reimplemented in W3DTerrainLogic.
Definition at line 236 of file TerrainLogic.h.
|
inlinevirtual |
Gets the first bridge. Traverse all bridges using bridge->getNext();.
Definition at line 278 of file TerrainLogic.h.
|
inlinevirtual |
Definition at line 260 of file TerrainLogic.h.
default get height for terrain logic
Reimplemented in W3DTerrainLogic.
Definition at line 1438 of file TerrainLogic.cpp.
| PathfindLayerEnum TerrainLogic::getHighestLayerForDestination | ( | const Coord3D * | pos, |
| Bool | onlyHealthyBridges = false ) |
Definition at line 1725 of file TerrainLogic.cpp.
| PathfindLayerEnum TerrainLogic::getLayerForDestination | ( | const Coord3D * | pos | ) |
Returns the layer id for the bridge, if any, at this destination. Otherwisee return LAYER_GROUND.
Definition at line 1692 of file TerrainLogic.cpp.
|
virtual |
default get height for terrain logic
Reimplemented in W3DTerrainLogic.
Definition at line 1450 of file TerrainLogic.cpp.
|
inlinevirtual |
Reimplemented in W3DTerrainLogic.
Definition at line 237 of file TerrainLogic.h.
|
inlinevirtual |
Definition at line 242 of file TerrainLogic.h.
|
virtual |
Return the trigger area with the given name.
Given a name, return the associated trigger area, or NULL if one doesn't exist.
Definition at line 1641 of file TerrainLogic.cpp.
|
virtual |
get water handle at this location
Get the water table with the highest water Z value at the location
Definition at line 2184 of file TerrainLogic.cpp.
|
virtual |
get water handle by name
Get water handle by name assigned from the editor
Definition at line 2246 of file TerrainLogic.cpp.
|
virtual |
get height of water table
Definition at line 2265 of file TerrainLogic.cpp.
|
virtual |
Return the waypoint with the given ID.
Given a unique integer ID, return the associated waypoint.
Definition at line 1577 of file TerrainLogic.cpp.
|
virtual |
Return the waypoint with the given name.
Given a name, return the associated waypoint.
Definition at line 1565 of file TerrainLogic.cpp.
|
virtual |
Init.
Init
Implements SubsystemInterface.
Reimplemented in W3DTerrainLogic.
Definition at line 1006 of file TerrainLogic.cpp.
Is bridge repaired?
Checks if a bridge is repaired.
Definition at line 1879 of file TerrainLogic.cpp.
|
virtual |
Reimplemented in W3DTerrainLogic.
Definition at line 1429 of file TerrainLogic.cpp.
is point cliff cell
default isCliffCell for terrain logic
Reimplemented in W3DTerrainLogic.
Definition at line 1462 of file TerrainLogic.cpp.
|
virtual |
Return true if the waypoint path containint pWay is labeled with the label.
Return true if the waypoint path containing pWay is labeled with the label.
Definition at line 1622 of file TerrainLogic.cpp.
|
virtual |
is point under water
See if a location is underwater, and what the water height is.
Definition at line 2143 of file TerrainLogic.cpp.
|
virtual |
device independent terrain logic load. If query is true, we are just loading it to get look at some data rather than running a game, so don't pass this load to the client.
Reimplemented in W3DTerrainLogic.
Definition at line 1254 of file TerrainLogic.cpp.
|
protectedvirtual |
Load post process
Implements Snapshot.
Reimplemented in W3DTerrainLogic.
Definition at line 3018 of file TerrainLogic.cpp.
|
virtual |
Initialize the logic for new map.
newMap
Reimplemented in W3DTerrainLogic.
Definition at line 1126 of file TerrainLogic.cpp.
Returns true if the object is close to one or the other end of the bridge.
Determines whether the object interacts with the bridge on specified layer.
Definition at line 1823 of file TerrainLogic.cpp.
|
virtual |
Returns true if the object is close enough to interact with the bridge for pathfinding.
Determines whether the object interacts with the bridge on specified layer.
Definition at line 1762 of file TerrainLogic.cpp.
|
protected |
Chunk parser callback.
Reads in the waypoint chunk
Definition at line 1338 of file TerrainLogic.cpp.
|
staticprotected |
Chunk parser callback.
Reads in the waypoint chunk
Definition at line 1329 of file TerrainLogic.cpp.
|
virtual |
Picks a bridge, and returns it's drawable.
Definition at line 1967 of file TerrainLogic.cpp.
|
virtual |
Reset.
Reset
Implements SubsystemInterface.
Reimplemented in W3DTerrainLogic.
Definition at line 1014 of file TerrainLogic.cpp.
| void TerrainLogic::setActiveBoundary | ( | Int | newActiveBoundary | ) |
Definition at line 2569 of file TerrainLogic.cpp.
|
virtual |
set height of water table
Set the water height. If the water rises, then any objects that now find themselves underwater will be damaged by the amount provided in the parameter 'damageAmount'
Definition at line 2296 of file TerrainLogic.cpp.
|
virtual |
Implements SubsystemInterface.
Reimplemented in W3DTerrainLogic.
Definition at line 1027 of file TerrainLogic.cpp.
|
virtual |
Updates bridge's damage info.
Updates the damage state of the bridge from the logic.
Definition at line 1866 of file TerrainLogic.cpp.
|
protectedvirtual |
Xfer Version Info: 1: Initial version 2: Added water updates over time (CBD)
Implements Snapshot.
Reimplemented in W3DTerrainLogic.
Definition at line 2929 of file TerrainLogic.cpp.
|
protected |
Definition at line 348 of file TerrainLogic.h.
|
protected |
Definition at line 347 of file TerrainLogic.h.
|
protected |
Definition at line 353 of file TerrainLogic.h.
|
protected |
Definition at line 351 of file TerrainLogic.h.
|
protected |
filename for terrain data
Definition at line 355 of file TerrainLogic.h.
|
staticprotected |
water handle for the grid water (we only presently have one)
Definition at line 359 of file TerrainLogic.h.
|
protected |
array of height samples
Definition at line 343 of file TerrainLogic.h.
|
protected |
width of map samples
Definition at line 344 of file TerrainLogic.h.
|
protected |
height of map samples
Definition at line 345 of file TerrainLogic.h.
|
protected |
how many valid entries are in m_waterToUpdate
Definition at line 374 of file TerrainLogic.h.
|
protected |
TRUE when water grid is enabled.
Definition at line 357 of file TerrainLogic.h.
|
protected |
water tables to dynamicall update
|
protected |
Definition at line 350 of file TerrainLogic.h.