DIE Engine
Loading...
Searching...
No Matches
Map Class Reference

#include <map.h>

Public Member Functions

 Map ()
void init ()
void terminate ()
void update ()
 Animate the doors and the lifts.
bool save (const QString &filename, bool submap)
 Save the map to a file.
bool load (const QString &filename)
 Load the map, then its submaps, sounds and textures.
void pass (const QVector3D &camPos)
 Push the map geometry and lights to the renderer.
void performAction (const QVector3D &pos)
 Trigger the actionable objects (doors, lifts) close to a position.
void doorOpen (uint16_t dId)
void doorClose (uint16_t dId)
void doorShake (uint16_t dId)
void liftStart (uint16_t eId)
void liftStop (uint16_t eId)
void speakerApplyFlags (uint16_t sId)
void computeAllWalls ()
 Recompute the cached wall geometry (dir, normal, length).
void computeWall (uint16_t wId)
QString getRelativePath (const QString &subMapPath)
QString resolveRelativePath (const QString &subMapPath)
QList< NodefindNodesByTag (const char *tagName) const
QList< SubmapfindSubmapsByTag (const char *tagName) const
QList< DoorfindDoorsByTag (const char *tagName) const
QList< LiftfindLiftsByTag (const char *tagName) const
QList< SpritefindSpritesByTag (const char *tagName) const
QList< LightfindLightsByTag (const char *tagName) const
QList< SpeakerfindSpeakersByTag (const char *tagName) const
QList< PathfindPathsByTag (const char *tagName) const
int findSubmapByName (const char *name) const
int findDoorByName (const char *name) const
int findLiftByName (const char *name) const
int findSpriteByName (const char *name) const
int findSpeakerByName (const char *name) const
int findPathByName (const char *name) const
MapState captureState () const
 Snapshot the persistent map data (see MapState).
void restoreState (const MapState &state)
 Restore a snapshot of the map data.

Public Attributes

QVector3D origin
float pan
float scale
QString path
QImage textures
Sun sun
Fog fog
QList< Nodenodes
QList< Wallwalls
QList< Submapsubmaps
QList< Doordoors
QList< Liftlifts
QList< Spritesprites
QList< Staircasestaircases
QList< Lightlights
QList< Speakerspeakers
QList< Pathpaths
QList< Mapmaps
QList< QSpatialSound * > sounds

Constructor & Destructor Documentation

◆ Map()

Map::Map ( )

Member Function Documentation

◆ captureState()

MapState Map::captureState ( ) const

Snapshot the persistent map data (see MapState).

◆ computeAllWalls()

void Map::computeAllWalls ( )

Recompute the cached wall geometry (dir, normal, length).

◆ computeWall()

void Map::computeWall ( uint16_t wId)

◆ doorClose()

void Map::doorClose ( uint16_t dId)

◆ doorOpen()

void Map::doorOpen ( uint16_t dId)

◆ doorShake()

void Map::doorShake ( uint16_t dId)

◆ findDoorByName()

int Map::findDoorByName ( const char * name) const

◆ findDoorsByTag()

QList< Door > Map::findDoorsByTag ( const char * tagName) const

◆ findLiftByName()

int Map::findLiftByName ( const char * name) const

◆ findLiftsByTag()

QList< Lift > Map::findLiftsByTag ( const char * tagName) const

◆ findLightsByTag()

QList< Light > Map::findLightsByTag ( const char * tagName) const

◆ findNodesByTag()

QList< Node > Map::findNodesByTag ( const char * tagName) const

◆ findPathByName()

int Map::findPathByName ( const char * name) const

◆ findPathsByTag()

QList< Path > Map::findPathsByTag ( const char * tagName) const

◆ findSpeakerByName()

int Map::findSpeakerByName ( const char * name) const

◆ findSpeakersByTag()

QList< Speaker > Map::findSpeakersByTag ( const char * tagName) const

◆ findSpriteByName()

int Map::findSpriteByName ( const char * name) const

◆ findSpritesByTag()

QList< Sprite > Map::findSpritesByTag ( const char * tagName) const

◆ findSubmapByName()

int Map::findSubmapByName ( const char * name) const

◆ findSubmapsByTag()

QList< Submap > Map::findSubmapsByTag ( const char * tagName) const

◆ getRelativePath()

QString Map::getRelativePath ( const QString & subMapPath)

◆ init()

void Map::init ( )

◆ liftStart()

void Map::liftStart ( uint16_t eId)

◆ liftStop()

void Map::liftStop ( uint16_t eId)

◆ load()

bool Map::load ( const QString & filename)

Load the map, then its submaps, sounds and textures.

Parameters
filenamepath of the map file
Returns
true on success

◆ pass()

void Map::pass ( const QVector3D & camPos)

Push the map geometry and lights to the renderer.

◆ performAction()

void Map::performAction ( const QVector3D & pos)

Trigger the actionable objects (doors, lifts) close to a position.

◆ resolveRelativePath()

QString Map::resolveRelativePath ( const QString & subMapPath)

◆ restoreState()

void Map::restoreState ( const MapState & state)

Restore a snapshot of the map data.

◆ save()

bool Map::save ( const QString & filename,
bool submap )

Save the map to a file.

Parameters
filenamepath of the map file
submapskip the environment section (submaps do not carry one)
Returns
true on success, false when the file cannot be opened

◆ speakerApplyFlags()

void Map::speakerApplyFlags ( uint16_t sId)

◆ terminate()

void Map::terminate ( )

◆ update()

void Map::update ( )

Animate the doors and the lifts.

Member Data Documentation

◆ doors

QList<Door> Map::doors

◆ fog

Fog Map::fog

◆ lifts

QList<Lift> Map::lifts

◆ lights

QList<Light> Map::lights

◆ maps

QList<Map> Map::maps

◆ nodes

QList<Node> Map::nodes

◆ origin

QVector3D Map::origin

◆ pan

float Map::pan

◆ path

QString Map::path

◆ paths

QList<Path> Map::paths

◆ scale

float Map::scale

◆ sounds

QList<QSpatialSound *> Map::sounds

◆ speakers

QList<Speaker> Map::speakers

◆ sprites

QList<Sprite> Map::sprites

◆ staircases

QList<Staircase> Map::staircases

◆ submaps

QList<Submap> Map::submaps

◆ sun

Sun Map::sun

◆ textures

QImage Map::textures

◆ walls

QList<Wall> Map::walls

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