A BSP Map loaded from Quake 3.
More...
Inherits G3D::ReferenceCountedObject.
|
| ~Map () |
|
const AABox & | bounds () const |
| Returns a bounding box on the whole map. More...
|
|
void | checkCollision (Vector3 &pos, Vector3 &vel, const Vector3 &extent) |
|
More...
|
|
const Array< BSPEntity > & | getEntityList () const |
|
const Array< BSPModel > & | getModelList () const |
|
Vector3 | getStartingPosition () const |
|
void | getTriangles (Array< Vector3 > &outVertexArray, Array< Vector3 > &outNormalArray, Array< int > &outIndexArray, Array< Vector2 > &outTexCoordArray, Array< int > &outTextureMapIndexArray, Array< Vector2 > &outLightCoordArray, Array< int > &outLightMapIndexArray, Array< shared_ptr< Texture > > &outTextureMapArray, Array< shared_ptr< Texture > > &outLightMapArray) const |
| Returns the triangles in the map for use outside of this class. More...
|
|
void | setDefaultTexture (const shared_ptr< Texture > &txt) |
|
void | slideCollision (Vector3 &pos, Vector3 &vel, const Vector3 &extent) |
|
Move an object, sliding where it collides with walls (as is done in Quake and most FPS games). More...
|
|
|
static MapRef | fromFile (const String &path, const String &fileName, float scale=1.0f, String altLoad="", const String &defaultTextureFile="") |
|
Returns nullptr if an error occurs while loading. More...
|
|
|
template<class T , class ... ArgTypes> |
static shared_ptr< T > | createShared (ArgTypes &&... args) |
| Like std::make_shared, but works for protected constructors. More...
|
|
A BSP Map loaded from Quake 3.
◆ ~Map()
G3D::_BSPMAP::Map::~Map |
( |
| ) |
|
◆ bounds()
const AABox& G3D::_BSPMAP::Map::bounds |
( |
| ) |
const |
|
inline |
Returns a bounding box on the whole map.
◆ checkCollision()
◆ createShared()
template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared |
( |
ArgTypes &&... |
args | ) |
|
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
◆ fromFile()
static MapRef G3D::_BSPMAP::Map::fromFile |
( |
const String & |
path, |
|
|
const String & |
fileName, |
|
|
float |
scale = 1.0f , |
|
|
String |
altLoad = "" , |
|
|
const String & |
defaultTextureFile = "" |
|
) |
| |
|
static |
Returns nullptr if an error occurs while loading.
- Parameters
-
path | to the Quake 3 resource directory (i.e., the directory that contains the "maps" subdir. This is the .pk3 file if working from a compressed map file. |
fileName | Name of the .bsp file; include the extension |
scale | Multiply all vertices by this scale factor on load. |
altLoad | The root of a directory to search for missing textures. When loading Quake3 maps that use default textures, this should be the pak0.pk3 file that comes with Quake3 Arena. Note that this file is copyrighted by id software and is not redistributable. It is not part of G3D. If set to "<none>", avoids the (slow) process of looking in the pk3 file for textures. If set to "", the system looks in the root of drives (on Windows) and in System::findDataFile locations for pak0.pk3 or mini-pak0.pk3. |
You can obtain a limited version of this file by downloading the Q3A demo from: http://www.idsoftware.com/games/quake/quake3-arena/index.php?game_section=demo On Windows, the relevant file is at C:\Q3Ademo\demoq3\pak0.pk3
- Parameters
-
defaultTextureFile | If a texture is missing, load this texture. if "", use the default texture specified at runtime. |
◆ getEntityList()
◆ getModelList()
◆ getStartingPosition()
Vector3 G3D::_BSPMAP::Map::getStartingPosition |
( |
| ) |
const |
|
inline |
◆ getTriangles()
Returns the triangles in the map for use outside of this class.
The outVertexArray, outNormalArray, outTexCoordArray, and outLightCoordArray are parallel arrays that are the source data for an indexed triangle list. Every three sequential values in outIndexArray are the indices into those
textureMapIndexArray has length outIndexArray.size()/3
. It specifies the index of the texture in outTextureMapArray to use for each triangle. outLightMapIndexArray is a parallel array to textureMapIndexArray that specifies the index of the light map.
◆ setDefaultTexture()
void G3D::_BSPMAP::Map::setDefaultTexture |
( |
const shared_ptr< Texture > & |
txt | ) |
|
|
inline |
◆ slideCollision()
Move an object, sliding where it collides with walls (as is done in Quake and most FPS games).
- Parameters
-
pos | Initial pos, which is updated to the new position. |
extent | World-space axis aligned extents of the object. |
vel | Movement step size. This is updated based on the actual step taken. |
- See also
- checkCollision
◆ Billboard
◆ FaceSet
◆ Mesh
◆ Patch
◆ entityArray