Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::BspLevel Class Reference

Holds all the data associated with a Binary Space Parition (BSP) based indoor level. More...

#include <OgreBspLevel.h>

Inheritance diagram for Ogre::BspLevel:

Ogre::Resource List of all members.

Public Methods

 BspLevel (String name)
 Default constructor - used by BspResourceManager (do not call directly). More...

 ~BspLevel ()
virtual void load (void)
 Generic load - called by BspResourceManager. More...

virtual void unload (void)
 Generic unload - called by BspResourceManager. More...

bool isLeafVisible (const BspNode *from, const BspNode *to) const
 Determines if one leaf node is visible from another. More...

const BspNodegetRootNode (void)
 Returns a pointer to the root node (BspNode) of the BSP tree. More...

BspNodefindLeaf (const Vector3 &point) const
 Walks the entire BSP tree and returns the leaf which contains the given point. More...

virtual size_t getSize (void)
 Retrieves info about the size of the resource. More...

void touch (void)
 'Touches' the resource to indicate it has been used. More...

time_t getLastAccess (void) const
 Gets the last time the resource was 'touched'. More...

const StringgetName (void) const
 Gets resource name. More...

bool isLoaded (void) const
 Returns true if the Resource has been loaded, false otherwise. More...

virtual void destroy ()
 A method to make the resource delete itself. More...


Protected Methods

void loadQuake3Level (const Quake3Level &q3lvl)
 Internal utility function for loading data from Quake3. More...

void loadEntities (const Quake3Level &q3lvl)
 Internal method for parsing chosen entities. More...


Protected Attributes

BspNodemRootNode
 Pointer to the root node of the BSP tree; This pointer actually has a dual purpose; to avoid allocating lots of small chunks of memory, the BspLevel actually allocates all nodes required through this pointer. More...

int mNumNodes
int mNumLeaves
int mLeafStart
BspVertexmVertices
 Array of vertices for whole level. More...

int mNumVertices
int * mLeafFaceGroups
 Array of indexes into the mFaceGroups array. More...

int mNumLeafFaceGroups
StaticFaceGroupmFaceGroups
 Array of face groups, indexed into by contents of mLeafFaceGroups. More...

int mNumFaceGroups
int * mElements
 Array of elements i.e. More...

int mNumElements
std::vector< ViewPointmPlayerStarts
 Vector of player start points. More...

VisData mVisData
String mName
bool mIsLoaded
time_t mLastAccess
size_t mSize

Friends

class BspSceneManager

Detailed Description

Holds all the data associated with a Binary Space Parition (BSP) based indoor level.

The data used here is populated by loading level files via the BspLevelManager::load method, although application users are more likely to call SceneManager::setWorldGeometry which will automatically arrange the loading of the level. Note that this assumes that you have asked for an indoor-specialised SceneManager (specify ST_INDOOR when calling Root::getSceneManager). Ogre currently only supports loading from Quake3 Arena level files, although any source that can be converted into this classes structure could also be used. The Quake3 level load process is in a different class called Quake3Level to keep the specifics separate.


Constructor & Destructor Documentation

Ogre::BspLevel::BspLevel String    name
 

Default constructor - used by BspResourceManager (do not call directly).

Ogre::BspLevel::~BspLevel  
 


Member Function Documentation

virtual void Ogre::Resource::destroy void    [inline, virtual, inherited]
 

A method to make the resource delete itself.

Note:
This exists because Resource objects could be created in other processes, and they need to be destroyed in the process that created them.

BspNode * Ogre::BspLevel::findLeaf const Vector3   point const
 

Walks the entire BSP tree and returns the leaf which contains the given point.

time_t Ogre::Resource::getLastAccess void    const [inline, inherited]
 

Gets the last time the resource was 'touched'.

const String& Ogre::Resource::getName void    const [inline, inherited]
 

Gets resource name.

Reimplemented in Ogre::Material.

const BspNode * Ogre::BspLevel::getRootNode void   
 

Returns a pointer to the root node (BspNode) of the BSP tree.

virtual size_t Ogre::Resource::getSize void    [inline, virtual, inherited]
 

Retrieves info about the size of the resource.

bool Ogre::BspLevel::isLeafVisible const BspNode   from,
const BspNode   to
const
 

Determines if one leaf node is visible from another.

bool Ogre::Resource::isLoaded void    const [inline, inherited]
 

Returns true if the Resource has been loaded, false otherwise.

void Ogre::BspLevel::load void    [virtual]
 

Generic load - called by BspResourceManager.

Implements Ogre::Resource.

void Ogre::BspLevel::loadEntities const Quake3Level   q3lvl [protected]
 

Internal method for parsing chosen entities.

void Ogre::BspLevel::loadQuake3Level const Quake3Level   q3lvl [protected]
 

Internal utility function for loading data from Quake3.

void Ogre::Resource::touch void    [inline, inherited]
 

'Touches' the resource to indicate it has been used.

void Ogre::BspLevel::unload void    [virtual]
 

Generic unload - called by BspResourceManager.

Reimplemented from Ogre::Resource.


Friends And Related Function Documentation

friend class BspSceneManager [friend]
 


Member Data Documentation

int* Ogre::BspLevel::mElements [protected]
 

Array of elements i.e.

vertex indexes as used by face groups.

StaticFaceGroup* Ogre::BspLevel::mFaceGroups [protected]
 

Array of face groups, indexed into by contents of mLeafFaceGroups.

bool Ogre::Resource::mIsLoaded [protected, inherited]
 

time_t Ogre::Resource::mLastAccess [protected, inherited]
 

int* Ogre::BspLevel::mLeafFaceGroups [protected]
 

Array of indexes into the mFaceGroups array.

This buffer is organised by leaf node so leaves can just use contiguous chunks of it and get repointed to the actual entries in mFaceGroups.

int Ogre::BspLevel::mLeafStart [protected]
 

String Ogre::Resource::mName [protected, inherited]
 

int Ogre::BspLevel::mNumElements [protected]
 

int Ogre::BspLevel::mNumFaceGroups [protected]
 

int Ogre::BspLevel::mNumLeafFaceGroups [protected]
 

int Ogre::BspLevel::mNumLeaves [protected]
 

int Ogre::BspLevel::mNumNodes [protected]
 

int Ogre::BspLevel::mNumVertices [protected]
 

std::vector<ViewPoint> Ogre::BspLevel::mPlayerStarts [protected]
 

Vector of player start points.

BspNode* Ogre::BspLevel::mRootNode [protected]
 

Pointer to the root node of the BSP tree; This pointer actually has a dual purpose; to avoid allocating lots of small chunks of memory, the BspLevel actually allocates all nodes required through this pointer.

So this pointer is the handle for the allocation of memory for all nodes. It also happens to point to the root node, since the first one in the memory chunk is the root node.

size_t Ogre::Resource::mSize [protected, inherited]
 

BspVertex* Ogre::BspLevel::mVertices [protected]
 

Array of vertices for whole level.

VisData Ogre::BspLevel::mVisData [protected]
 

Copyright © 2002 by The OGRE Team