#include <OgreBspLevel.h>
Inheritance diagram for Ogre::BspLevel:
Public Methods | |
BspLevel (const String &name) | |
Default constructor - used by BspResourceManager (do not call directly). | |
~BspLevel () | |
virtual void | load (void) |
Generic load - called by BspResourceManager. | |
virtual void | unload (void) |
Generic unload - called by BspResourceManager. | |
bool | isLeafVisible (const BspNode *from, const BspNode *to) const |
Determines if one leaf node is visible from another. | |
const BspNode * | getRootNode (void) |
Returns a pointer to the root node (BspNode) of the BSP tree. | |
BspNode * | findLeaf (const Vector3 &point) const |
Walks the entire BSP tree and returns the leaf which contains the given point. | |
void | _notifyObjectMoved (const MovableObject *mov, const Vector3 &pos) |
Ensures that the MovableObject is attached to the right leaves of the BSP tree. | |
void | _notifyObjectDetached (const MovableObject *mov) |
Internal method, makes sure an object is removed from the leaves when detached from a node. | |
BspNode * | getLeafStart (void) |
Gets a pointer to the start of the leaf nodes. | |
int | getNumLeaves (void) |
Gets the number of leaf nodes. | |
virtual size_t | getSize (void) const |
Retrieves info about the size of the resource. | |
virtual void | touch (void) |
'Touches' the resource to indicate it has been used. | |
time_t | getLastAccess (void) const |
Gets the last time the resource was 'touched'. | |
const String & | getName (void) const |
Gets resource name. | |
ResourceHandle | getHandle (void) const |
bool | isLoaded (void) const |
Returns true if the Resource has been loaded, false otherwise. | |
virtual void | destroy () |
A method to make the resource delete itself. | |
Protected Types | |
typedef std::map< const MovableObject *, std::list< BspNode * > > | MovableToNodeMap |
typedef std::map< int, PatchSurface * > | PatchMap |
Protected Methods | |
void | loadQuake3Level (const Quake3Level &q3lvl) |
Internal utility function for loading data from Quake3. | |
void | loadEntities (const Quake3Level &q3lvl) |
Internal method for parsing chosen entities. | |
void | tagNodesWithMovable (BspNode *node, const MovableObject *mov, const Vector3 &pos) |
void | initQuake3Patches (const Quake3Level &q3lvl, VertexDeclaration *decl) |
void | buildQuake3Patches (size_t vertOffset, size_t indexOffset) |
void | quakeVertexToBspVertex (const bsp_vertex_t *src, BspVertex *dest) |
Protected Attributes | |
BspNode * | mRootNode |
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. | |
int | mNumNodes |
int | mNumLeaves |
int | mLeafStart |
VertexData * | mVertexData |
Vertex data holding all the data for the level, but able to render parts of it. | |
int * | mLeafFaceGroups |
Array of indexes into the mFaceGroups array. | |
int | mNumLeafFaceGroups |
StaticFaceGroup * | mFaceGroups |
Array of face groups, indexed into by contents of mLeafFaceGroups. | |
int | mNumFaceGroups |
size_t | mNumIndexes |
indexes for the whole level, will be copied to the real indexdata per frame | |
DefaultHardwareIndexBuffer * | mIndexes |
BspNode::Brush * | mBrushes |
Brushes as used for collision, main memory is here. | |
std::vector< ViewPoint > | mPlayerStarts |
Vector of player start points. | |
VisData | mVisData |
MovableToNodeMap | mMovableToNodeMap |
Map for locating the nodes a movable is currently a member of. | |
PatchMap | mPatches |
size_t | mPatchVertexCount |
size_t | mPatchIndexCount |
String | mName |
ResourceHandle | mHandle |
bool | mIsLoaded |
time_t | mLastAccess |
size_t | mSize |
Friends | |
class | BspSceneManager |
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.
Definition at line 53 of file OgreBspLevel.h.
|
Definition at line 183 of file OgreBspLevel.h. |
|
Definition at line 190 of file OgreBspLevel.h. |
|
Default constructor - used by BspResourceManager (do not call directly).
Definition at line 49 of file OgreBspLevel.cpp. References mBrushes, mFaceGroups, mLeafFaceGroups, Ogre::Resource::mName, mRootNode, mVertexData, mVisData, and Ogre::BspLevel::VisData::tableData. |
|
Definition at line 61 of file OgreBspLevel.cpp. References Ogre::Resource::mIsLoaded, and unload(). |
|
Internal method, makes sure an object is removed from the leaves when detached from a node.
Definition at line 769 of file OgreBspLevel.cpp. References mMovableToNodeMap. Referenced by Ogre::BspSceneManager::_notifyObjectDetached(). |
|
Ensures that the MovableObject is attached to the right leaves of the BSP tree.
Definition at line 706 of file OgreBspLevel.cpp. References mMovableToNodeMap, mRootNode, and tagNodesWithMovable(). Referenced by Ogre::BspSceneManager::_notifyObjectMoved(). |
|
Definition at line 554 of file OgreBspLevel.cpp. References Ogre::PatchSurface::build(), Ogre::VertexBufferBinding::getBuffer(), Ogre::PatchSurface::getControlPointBuffer(), Ogre::PatchSurface::getRequiredIndexCount(), Ogre::PatchSurface::getRequiredVertexCount(), mIndexes, mPatches, mVertexData, Ogre::PatchSurface::notifyControlPointBufferDeallocated(), and Ogre::VertexData::vertexBufferBinding. Referenced by loadQuake3Level(). |
|
A method to make the resource delete itself.
Definition at line 137 of file OgreResource.h. |
|
Walks the entire BSP tree and returns the leaf which contains the given point.
Definition at line 627 of file OgreBspLevel.cpp. References Ogre::BspNode::getNextNode(), Ogre::BspNode::isLeaf(), and mRootNode. Referenced by Ogre::BspSceneManager::walkTree(). |
|
Definition at line 120 of file OgreResource.h. References Ogre::ResourceHandle. Referenced by Ogre::Material::clone(), loadQuake3Level(), and Ogre::ResourceManager::unload(). |
|
Gets the last time the resource was 'touched'.
Definition at line 108 of file OgreResource.h. |
|
Gets a pointer to the start of the leaf nodes.
Definition at line 85 of file OgreBspLevel.h. References mLeafStart, and mRootNode. Referenced by Ogre::BspIntersectionSceneQuery::execute(). |
|
|
Gets the number of leaf nodes.
Definition at line 87 of file OgreBspLevel.h. References mNumLeaves. Referenced by Ogre::BspIntersectionSceneQuery::execute(). |
|
Returns a pointer to the root node (BspNode) of the BSP tree.
Definition at line 622 of file OgreBspLevel.cpp. References mRootNode. |
|
Retrieves info about the size of the resource.
Definition at line 93 of file OgreResource.h. Referenced by Ogre::ResourceManager::unload(). |
|
Definition at line 502 of file OgreBspLevel.cpp. References BSP_FACETYPE_PATCH, Ogre::PatchSurface::defineSurface(), Ogre::PatchSurface::getRequiredIndexCount(), Ogre::PatchSurface::getRequiredVertexCount(), bsp_face_t::mesh_cp, Ogre::Quake3Level::mFaces, Ogre::Quake3Level::mNumFaces, mPatches, mPatchIndexCount, mPatchVertexCount, Ogre::Quake3Level::mVertices, quakeVertexToBspVertex(), bsp_face_t::type, bsp_face_t::vert_count, and bsp_face_t::vert_start. Referenced by loadQuake3Level(). |
|
Determines if one leaf node is visible from another.
Definition at line 582 of file OgreBspLevel.cpp. References Ogre::BspNode::isLeaf(), Ogre::BspNode::mVisCluster, mVisData, Ogre::BspLevel::VisData::rowLength, and Ogre::BspLevel::VisData::tableData. Referenced by Ogre::BspNode::isLeafVisible(), and Ogre::BspSceneManager::walkTree(). |
|
Returns true if the Resource has been loaded, false otherwise.
Definition at line 127 of file OgreResource.h. Referenced by Ogre::GpuProgramUsage::_load(), Ogre::Technique::isLoaded(), Ogre::D3D9Texture::load(), Ogre::D3D9Texture::unload(), and Ogre::D3D9Texture::~D3D9Texture(). |
|
Generic load - called by BspResourceManager.
Implements Ogre::Resource. Definition at line 72 of file OgreBspLevel.cpp. References Ogre::DataChunk::clear(), Ogre::Quake3Level::loadFromChunk(), loadQuake3Level(), Ogre::Resource::mIsLoaded, and Ogre::Resource::mName. Referenced by Ogre::BspSceneManager::setWorldGeometry(). |
|
Internal method for parsing chosen entities.
Definition at line 640 of file OgreBspLevel.cpp. References Ogre::Quaternion::FromAngleAxis(), Ogre::Quake3Level::mEntities, mPlayerStarts, Ogre::ViewPoint::orientation, Ogre::ViewPoint::position, Ogre::Real, Ogre::String::split(), Ogre::StringVector, Ogre::String::toLowerCase(), Ogre::String::trim(), Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z. Referenced by loadQuake3Level(). |
|
|
Definition at line 787 of file OgreBspLevel.cpp. References bsp_vertex_t::color, Ogre::BspLevel::BspVertex::colour, bsp_vertex_t::lightmap, Ogre::BspLevel::BspVertex::lightmap, bsp_vertex_t::normal, Ogre::BspLevel::BspVertex::normal, bsp_vertex_t::point, Ogre::BspLevel::BspVertex::position, Ogre::Real, Ogre::BspLevel::BspVertex::texcoords, and bsp_vertex_t::texture. Referenced by initQuake3Patches(), and loadQuake3Level(). |
|
Definition at line 728 of file OgreBspLevel.cpp. References Ogre::BspNode::_addMovable(), Ogre::BspNode::getBack(), Ogre::MovableObject::getBoundingRadius(), Ogre::BspNode::getDistance(), Ogre::BspNode::getFront(), Ogre::BspNode::isLeaf(), mMovableToNodeMap, and Ogre::Real. Referenced by _notifyObjectMoved(). |
|
'Touches' the resource to indicate it has been used.
Reimplemented in Ogre::Material. Definition at line 100 of file OgreResource.h. Referenced by Ogre::ResourceManager::load(). |
|
Generic unload - called by BspResourceManager.
Reimplemented from Ogre::Resource. Definition at line 89 of file OgreBspLevel.cpp. References mBrushes, mFaceGroups, mLeafFaceGroups, mRootNode, mVertexData, mVisData, and Ogre::BspLevel::VisData::tableData. Referenced by ~BspLevel(). |
|
Definition at line 55 of file OgreBspLevel.h. |
|
Brushes as used for collision, main memory is here.
Definition at line 148 of file OgreBspLevel.h. Referenced by BspLevel(), loadQuake3Level(), and unload(). |
|
Array of face groups, indexed into by contents of mLeafFaceGroups.
Definition at line 132 of file OgreBspLevel.h. Referenced by BspLevel(), loadQuake3Level(), Ogre::BspSceneManager::processVisibleLeaf(), and unload(). |
|
Definition at line 57 of file OgreResource.h. Referenced by Ogre::ResourceManager::add(), Ogre::Material::clone(), Ogre::Material::copyDetailsTo(), and Ogre::Material::operator=(). |
|
Definition at line 145 of file OgreBspLevel.h. Referenced by buildQuake3Patches(), Ogre::BspSceneManager::cacheGeometry(), and loadQuake3Level(). |
|
|
Definition at line 59 of file OgreResource.h. Referenced by Ogre::Material::operator=(). |
|
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. Definition at line 128 of file OgreBspLevel.h. Referenced by BspLevel(), loadQuake3Level(), Ogre::BspSceneManager::processVisibleLeaf(), and unload(). |
|
Definition at line 100 of file OgreBspLevel.h. Referenced by getLeafStart(), loadQuake3Level(), and Ogre::BspSceneManager::walkTree(). |
|
Map for locating the nodes a movable is currently a member of.
Definition at line 185 of file OgreBspLevel.h. Referenced by _notifyObjectDetached(), _notifyObjectMoved(), and tagNodesWithMovable(). |
|
|
Definition at line 133 of file OgreBspLevel.h. Referenced by loadQuake3Level(). |
|
indexes for the whole level, will be copied to the real indexdata per frame
Definition at line 143 of file OgreBspLevel.h. Referenced by loadQuake3Level(), and Ogre::BspSceneManager::setWorldGeometry(). |
|
Definition at line 129 of file OgreBspLevel.h. Referenced by loadQuake3Level(). |
|
Definition at line 99 of file OgreBspLevel.h. Referenced by getNumLeaves(), and loadQuake3Level(). |
|
Definition at line 98 of file OgreBspLevel.h. Referenced by loadQuake3Level(), and Ogre::BspSceneManager::walkTree(). |
|
Definition at line 191 of file OgreBspLevel.h. Referenced by buildQuake3Patches(), initQuake3Patches(), and loadQuake3Level(). |
|
Definition at line 195 of file OgreBspLevel.h. Referenced by initQuake3Patches(), and loadQuake3Level(). |
|
Definition at line 193 of file OgreBspLevel.h. Referenced by initQuake3Patches(), and loadQuake3Level(). |
|
Vector of player start points.
Definition at line 151 of file OgreBspLevel.h. Referenced by Ogre::BspSceneManager::getSuggestedViewpoint(), and loadEntities(). |
|
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. Definition at line 97 of file OgreBspLevel.h. Referenced by _notifyObjectMoved(), BspLevel(), findLeaf(), getLeafStart(), getRootNode(), loadQuake3Level(), unload(), and Ogre::BspSceneManager::walkTree(). |
|
Definition at line 60 of file OgreResource.h. Referenced by Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), Ogre::GLTexture::loadImages(), and Ogre::Material::operator=(). |
|
Vertex data holding all the data for the level, but able to render parts of it.
Definition at line 123 of file OgreBspLevel.h. Referenced by BspLevel(), buildQuake3Patches(), loadQuake3Level(), Ogre::BspSceneManager::setWorldGeometry(), and unload(). |
|
Definition at line 177 of file OgreBspLevel.h. Referenced by BspLevel(), isLeafVisible(), loadQuake3Level(), and unload(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:11:20 2004