Height Terrain. More...
#include <deHeightTerrain.h>
Public Member Functions | |
Constructors and Destructors | |
| deHeightTerrain (deHeightTerrainManager *manager, float sectorSize, int heightImageSize) | |
| Creates a new height terrain. | |
| virtual | ~deHeightTerrain () |
| Cleans up the height terrain. | |
Management | |
| float | GetSectorDimension () const |
| Retrieves the dimension of each sector in meters. | |
| int | GetHeightImageSize () const |
| Retrieves the size of the height images. | |
| decLayerMask & | GetLayerMask () |
| Retrieves the layer mask. | |
| void | NotifyLayerMaskChanged () |
| Notifies the peers that the layer mask changed. | |
| int | GetGroupNumber () const |
| Retrieves the group number or 0 if not set. | |
| void | SetGroupNumber (int groupNumber) |
| Sets the group number or 0 if not set. | |
| bool | CanHit (const decLayerMask &layerMask, int groupNumber) const |
| Determines if this height terrain can hit another object represented by a layer mask and a group number. | |
| void | NotifyHeightChanged (const decPoint &fromSector, const decPoint &fromCoordinates, const decPoint &toSector, const decPoint &toCoordinates) |
| Notifies the peers that a sector heights changed. | |
Sectors | |
| int | GetSectorCount () const |
| Retrieves the number of sectors. | |
| deHeightTerrainSector * | GetSectorAt (int index) const |
| Retrieves the sector at the given index. | |
| deHeightTerrainSector * | GetSectorWith (const decPoint &coordinates) const |
| Retrieves the sector with the given coordinates or NULL if not existing. | |
| int | IndexOfSector (deHeightTerrainSector *sector) const |
| Retrieves the index of the given sector of -1 if not found. | |
| void | AddSector (deHeightTerrainSector *sector) |
| Adds a sector to the world. | |
| void | RemoveSector (deHeightTerrainSector *sector) |
| Removes the given sector from the world. | |
| void | RemoveAllSectors () |
| Removes all sectors from the world. | |
| void | NotifySectorChanged (int sector) |
| Notifies the peers that a sector changed. | |
| void | NotifySectorTexturesChanged (int sector) |
| Notifies the peers that the textures of a sector changed. | |
Decals | |
| int | GetDecalCount () const |
| Retrieves the count of decals. | |
| deDecal * | GetDecalAt (int index) const |
| Retrieves the decal at the given index. | |
| int | IndexOfDecal (deDecal *decal) const |
| Retrieves the index of the given decal of -1 if not found. | |
| void | AddDecal (deDecal *decal) |
| Adds a decal to the world. | |
| void | RemoveDecal (deDecal *decal) |
| Removes the given decal from the world. | |
| void | RemoveAllDecals () |
| Removes all decals from the world. | |
System Peers | |
| deBaseGraphicHeightTerrain * | GetGraphicHeightTerrain () const |
| Retrieves the graphic system peer object. | |
| void | SetGraphicHeightTerrain (deBaseGraphicHeightTerrain *peer) |
| Sets the graphic system peer object. | |
| deBasePhysicsHeightTerrain * | GetPhysicsHeightTerrain () const |
| Retrieves the physics system peer object. | |
| void | SetPhysicsHeightTerrain (deBasePhysicsHeightTerrain *peer) |
| Sets the physics system peer object. | |
Collision Detection | |
| void | FindDecalsAt (const decDVector &point, deDecalList *list) |
| Stores all decals in contact with the given surface point into the provided list. | |
| void | FindDecalsTouching (decShape *shape, deDecalList *list) |
| Stores all decals in contact with the given shape into the provided list. | |
Height Terrain.
Defines a height terrain.
| deHeightTerrain::deHeightTerrain | ( | deHeightTerrainManager * | manager, |
| float | sectorSize, | ||
| int | heightImageSize | ||
| ) |
Creates a new height terrain.
| virtual deHeightTerrain::~deHeightTerrain | ( | ) | [virtual] |
Cleans up the height terrain.
| void deHeightTerrain::AddDecal | ( | deDecal * | decal ) |
Adds a decal to the world.
| void deHeightTerrain::AddSector | ( | deHeightTerrainSector * | sector ) |
Adds a sector to the world.
| bool deHeightTerrain::CanHit | ( | const decLayerMask & | layerMask, |
| int | groupNumber | ||
| ) | const |
Determines if this height terrain can hit another object represented by a layer mask and a group number.
The layer mask and the group number of both entities are checked for a match. Group numbers match only if neither of them is 0.
| void deHeightTerrain::FindDecalsAt | ( | const decDVector & | point, |
| deDecalList * | list | ||
| ) |
Stores all decals in contact with the given surface point into the provided list.
The point is best taken from an earlier collision test and is in world coordinates.
| point | Point on the surface to test. |
| list | List of decals to fill in. Not emptied before filling. |
| void deHeightTerrain::FindDecalsTouching | ( | decShape * | shape, |
| deDecalList * | list | ||
| ) |
Stores all decals in contact with the given shape into the provided list.
| shape | Shape to test. |
| list | List of decals to fill in. Not emptied before filling. |
| deDecal* deHeightTerrain::GetDecalAt | ( | int | index ) | const |
Retrieves the decal at the given index.
| int deHeightTerrain::GetDecalCount | ( | ) | const [inline] |
Retrieves the count of decals.
| deBaseGraphicHeightTerrain* deHeightTerrain::GetGraphicHeightTerrain | ( | ) | const [inline] |
Retrieves the graphic system peer object.
| int deHeightTerrain::GetGroupNumber | ( | ) | const [inline] |
Retrieves the group number or 0 if not set.
| int deHeightTerrain::GetHeightImageSize | ( | ) | const [inline] |
Retrieves the size of the height images.
| decLayerMask& deHeightTerrain::GetLayerMask | ( | ) | [inline] |
Retrieves the layer mask.
Call NotifyLayerMaskChanged after you have done changes.
| deBasePhysicsHeightTerrain* deHeightTerrain::GetPhysicsHeightTerrain | ( | ) | const [inline] |
Retrieves the physics system peer object.
| deHeightTerrainSector* deHeightTerrain::GetSectorAt | ( | int | index ) | const |
Retrieves the sector at the given index.
| int deHeightTerrain::GetSectorCount | ( | ) | const [inline] |
Retrieves the number of sectors.
| float deHeightTerrain::GetSectorDimension | ( | ) | const [inline] |
Retrieves the dimension of each sector in meters.
| deHeightTerrainSector* deHeightTerrain::GetSectorWith | ( | const decPoint & | coordinates ) | const |
Retrieves the sector with the given coordinates or NULL if not existing.
| int deHeightTerrain::IndexOfDecal | ( | deDecal * | decal ) | const |
Retrieves the index of the given decal of -1 if not found.
| int deHeightTerrain::IndexOfSector | ( | deHeightTerrainSector * | sector ) | const |
Retrieves the index of the given sector of -1 if not found.
| void deHeightTerrain::NotifyHeightChanged | ( | const decPoint & | fromSector, |
| const decPoint & | fromCoordinates, | ||
| const decPoint & | toSector, | ||
| const decPoint & | toCoordinates | ||
| ) |
Notifies the peers that a sector heights changed.
| void deHeightTerrain::NotifyLayerMaskChanged | ( | ) |
Notifies the peers that the layer mask changed.
| void deHeightTerrain::NotifySectorChanged | ( | int | sector ) |
Notifies the peers that a sector changed.
| void deHeightTerrain::NotifySectorTexturesChanged | ( | int | sector ) |
Notifies the peers that the textures of a sector changed.
| void deHeightTerrain::RemoveAllDecals | ( | ) |
Removes all decals from the world.
| void deHeightTerrain::RemoveAllSectors | ( | ) |
Removes all sectors from the world.
| void deHeightTerrain::RemoveDecal | ( | deDecal * | decal ) |
Removes the given decal from the world.
| void deHeightTerrain::RemoveSector | ( | deHeightTerrainSector * | sector ) |
Removes the given sector from the world.
| void deHeightTerrain::SetGraphicHeightTerrain | ( | deBaseGraphicHeightTerrain * | peer ) |
Sets the graphic system peer object.
| void deHeightTerrain::SetGroupNumber | ( | int | groupNumber ) |
Sets the group number or 0 if not set.
| void deHeightTerrain::SetPhysicsHeightTerrain | ( | deBasePhysicsHeightTerrain * | peer ) |
Sets the physics system peer object.
1.7.2