OGRE
14.3
Object-Oriented Graphics Rendering Engine
|
Holds all the data associated with a Binary Space Parition (BSP) based indoor level. More...
#include <OgreBspLevel.h>
Public Member Functions | |
BspLevel (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0) | |
Default constructor - used by BspResourceManager (do not call directly) More... | |
~BspLevel () | |
void | _notifyObjectDetached (const MovableObject *mov) |
Internal method, makes sure an object is removed from the leaves when detached from a node. More... | |
void | _notifyObjectMoved (const MovableObject *mov, const Vector3 &pos) |
Ensures that the MovableObject is attached to the right leaves of the BSP tree. More... | |
BspNode * | findLeaf (const Vector3 &point) const |
Walks the entire BSP tree and returns the leaf which contains the given point. More... | |
BspNode * | getLeafStart (void) |
Gets a pointer to the start of the leaf nodes. More... | |
const LightList & | getLights () const override |
Gets a list of lights, ordered relative to how close they are to this renderable. More... | |
const MaterialPtr & | getMaterial (void) const override |
Retrieves a weak reference to the material this renderable object uses. More... | |
int | getNumLeaves (void) const |
Gets the number of leaf nodes. More... | |
void | getRenderOperation (RenderOperation &op) override |
Gets the render operation required to send this object to the frame buffer. More... | |
const BspNode * | getRootNode (void) |
Returns a pointer to the root node (BspNode) of the BSP tree. More... | |
Real | getSkyCurvature (void) const |
Get sky curvature. More... | |
const String & | getSkyMaterialName (void) const |
Get Sky material name. More... | |
Real | getSquaredViewDepth (const Camera *cam) const override |
Returns the squared distance between the camera and this renderable. More... | |
void | getWorldTransforms (Matrix4 *xform) const override |
Gets the world transform matrix / matrices for this renderable object. More... | |
bool | isLeafVisible (const BspNode *from, const BspNode *to) const |
Determines if one leaf node is visible from another. More... | |
bool | isSkyEnabled (void) const |
Is sky enabled? More... | |
void | load (const DataStreamPtr &stream) |
Load direct from stream. More... | |
Public Member Functions inherited from Ogre::Resource | |
Resource (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0) | |
Standard constructor. More... | |
virtual | ~Resource () |
Virtual destructor. More... | |
virtual void | _dirtyState () |
Manually mark the state of this resource as having been changed. More... | |
void | _fireLoadingComplete (bool unused=false) |
Firing of loading complete event. More... | |
void | _firePreparingComplete (bool unused=false) |
Firing of preparing complete event. More... | |
void | _fireUnloadingComplete (void) |
Firing of unloading complete event. More... | |
void | _notifyOrigin (const String &origin) |
Notify this resource of it's origin. More... | |
virtual void | addListener (Listener *lis) |
Register a listener on this resource. More... | |
virtual void | changeGroupOwnership (const String &newGroup) |
Change the resource group ownership of a Resource. More... | |
virtual void | escalateLoading () |
Escalates the loading of a background loaded resource. More... | |
ResourceManager * | getCreator (void) |
Gets the manager which created this resource. More... | |
const String & | getGroup (void) const |
Gets the group which this resource is a member of. More... | |
ResourceHandle | getHandle (void) const |
LoadingState | getLoadingState () const |
Returns the current loading state. More... | |
const String & | getName (void) const |
Gets resource name. More... | |
const String & | getOrigin (void) const |
Get the origin of this resource, e.g. More... | |
size_t | getSize (void) const |
Retrieves info about the size of the resource. More... | |
virtual size_t | getStateCount () const |
Returns the number of times this resource has changed state, which generally means the number of times it has been loaded. More... | |
bool | isBackgroundLoaded (void) const |
Returns whether this Resource has been earmarked for background loading. More... | |
bool | isLoaded (void) const |
Returns true if the Resource has been loaded, false otherwise. More... | |
bool | isLoading () const |
Returns whether the resource is currently in the process of background loading. More... | |
bool | isManuallyLoaded (void) const |
Is this resource manually loaded? More... | |
bool | isPrepared (void) const |
Returns true if the Resource has been prepared, false otherwise. More... | |
bool | isReloadable (void) const |
Returns true if the Resource is reloadable, false otherwise. More... | |
virtual void | load (bool backgroundThread=false) |
Loads the resource, if it is not already. More... | |
virtual void | prepare (bool backgroundThread=false) |
Prepares the resource for load, if it is not already. More... | |
virtual void | reload (LoadingFlags flags=LF_DEFAULT) |
Reloads the resource, if it is already loaded. More... | |
virtual void | removeListener (Listener *lis) |
Remove a listener on this resource. More... | |
void | setBackgroundLoaded (bool bl) |
Tells the resource whether it is background loaded or not. More... | |
virtual void | touch (void) |
'Touches' the resource to indicate it has been used. More... | |
virtual void | unload (void) |
Unloads the resource; this is not permanent, the resource can be reloaded later if required. More... | |
Public Member Functions inherited from Ogre::StringInterface | |
StringInterface () | |
virtual | ~StringInterface () |
Virtual destructor, see Effective C++. More... | |
void | copyParametersTo (StringInterface *dest) const |
Method for copying this object's parameters to another object. More... | |
ParamDictionary * | getParamDictionary (void) |
Retrieves the parameter dictionary for this class. More... | |
const ParamDictionary * | getParamDictionary (void) const |
String | getParameter (const String &name) const |
Generic parameter retrieval method. More... | |
const ParameterList & | getParameters (void) const |
Retrieves a list of parameters valid for this object. More... | |
bool | setParameter (const String &name, const String &value) |
Generic parameter setting method. More... | |
void | setParameterList (const NameValuePairList ¶mList) |
Generic multiple parameter setting method. More... | |
Public Member Functions inherited from Ogre::Renderable | |
Renderable () | |
virtual | ~Renderable () |
Virtual destructor needed as class has virtual methods. More... | |
uint16 | _getMaterialLodIndex () const |
virtual void | _updateCustomGpuParameter (const GpuProgramParameters::AutoConstantEntry &constantEntry, GpuProgramParameters *params) const |
Update a custom GpuProgramParameters constant which is derived from information only this Renderable knows. More... | |
virtual bool | getCastsShadows (void) const |
Method which reports whether this renderable would normally cast a shadow. More... | |
const Vector4f & | getCustomParameter (size_t index) const |
Gets the custom value associated with this Renderable at the given index. More... | |
virtual uint16 | getNumWorldTransforms (void) const |
Returns the number of world transform matrices this renderable requires. More... | |
bool | getPolygonModeOverrideable (void) const |
Gets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setting. More... | |
virtual Technique * | getTechnique (void) const |
Retrieves a pointer to the Material Technique this renderable object uses. More... | |
bool | getUseIdentityProjection (void) const |
Returns whether or not to use an 'identity' projection. More... | |
bool | getUseIdentityView (void) const |
Returns whether or not to use an 'identity' view. More... | |
const Any & | getUserAny (void) const |
UserObjectBindings & | getUserObjectBindings () |
Class that provides convenient interface to establish a linkage between custom user application objects and Ogre core classes. More... | |
const UserObjectBindings & | getUserObjectBindings () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
bool | hasCustomParameter (size_t index) const |
Checks whether a custom value is associated with this Renderable at the given index. More... | |
virtual void | postRender (SceneManager *sm, RenderSystem *rsys) |
Called immediately after the Renderable has been rendered. More... | |
virtual bool | preRender (SceneManager *sm, RenderSystem *rsys) |
Called just prior to the Renderable being rendered. More... | |
void | removeCustomParameter (size_t index) |
Removes a custom value which is associated with this Renderable at the given index. More... | |
void | setCustomParameter (size_t index, const Vector4f &value) |
Sets a custom parameter for this Renderable, which may be used to drive calculations for this specific Renderable, like GPU program parameters. More... | |
void | setPolygonModeOverrideable (bool override) |
Sets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setting. More... | |
void | setUseIdentityProjection (bool useIdentityProjection) |
Sets whether or not to use an 'identity' projection. More... | |
void | setUseIdentityView (bool useIdentityView) |
Sets whether or not to use an 'identity' view. More... | |
void | setUserAny (const Any &anything) |
Static Public Member Functions | |
static size_t | calculateLoadingStages (const String &levelName) |
Calculate the number of loading stages required for a given level. More... | |
static size_t | calculateLoadingStages (DataStreamPtr &stream) |
Calculate the number of loading stages required for a given level. More... | |
Static Public Member Functions inherited from Ogre::StringInterface | |
static void | cleanupDictionary () |
Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g. More... | |
Additional Inherited Members | |
Public Types inherited from Ogre::Resource | |
enum | LoadingFlags { LF_DEFAULT = 0 , LF_INCLUDE_NON_RELOADABLE = 1 , LF_ONLY_UNREFERENCED = 2 , LF_ONLY_UNREFERENCED_INCLUDE_NON_RELOADABLE = 3 , LF_PRESERVE_STATE = 4 } |
Enum that allow to choose subset of unloaded/reloaded resources and to adjust reloading behavior. More... | |
enum | LoadingState { LOADSTATE_UNLOADED , LOADSTATE_LOADING , LOADSTATE_LOADED , LOADSTATE_UNLOADING , LOADSTATE_PREPARED , LOADSTATE_PREPARING } |
Enum identifying the loading state of the resource. More... | |
Public Types inherited from Ogre::Renderable | |
enum | { DEFAULT_PRIORITY = 100 } |
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.
Ogre::BspLevel::BspLevel | ( | ResourceManager * | creator, |
const String & | name, | ||
ResourceHandle | handle, | ||
const String & | group, | ||
bool | isManual = false , |
||
ManualResourceLoader * | loader = 0 |
||
) |
Default constructor - used by BspResourceManager (do not call directly)
Ogre::BspLevel::~BspLevel | ( | ) |
Determines if one leaf node is visible from another.
const BspNode* Ogre::BspLevel::getRootNode | ( | void | ) |
Returns a pointer to the root node (BspNode) of the BSP tree.
Walks the entire BSP tree and returns the leaf which contains the given point.
void Ogre::BspLevel::_notifyObjectMoved | ( | const MovableObject * | mov, |
const Vector3 & | pos | ||
) |
Ensures that the MovableObject is attached to the right leaves of the BSP tree.
void Ogre::BspLevel::_notifyObjectDetached | ( | const MovableObject * | mov | ) |
Internal method, makes sure an object is removed from the leaves when detached from a node.
|
inline |
Gets a pointer to the start of the leaf nodes.
|
inline |
Gets the number of leaf nodes.
|
static |
Calculate the number of loading stages required for a given level.
|
static |
Calculate the number of loading stages required for a given level.
void Ogre::BspLevel::load | ( | const DataStreamPtr & | stream | ) |
Load direct from stream.
bool Ogre::BspLevel::isSkyEnabled | ( | void | ) | const |
Is sky enabled?
const String& Ogre::BspLevel::getSkyMaterialName | ( | void | ) | const |
Get Sky material name.
Real Ogre::BspLevel::getSkyCurvature | ( | void | ) | const |
Get sky curvature.
|
inlineoverridevirtual |
Gets the render operation required to send this object to the frame buffer.
Implements Ogre::Renderable.
|
inlineoverridevirtual |
Gets the world transform matrix / matrices for this renderable object.
If the object has any derived transforms, these are expected to be up to date as long as all the SceneNode structures have been updated before this is called.
This method will populate transform with 1 matrix if it does not use GPU vertex blending. If it does use GPU vertex blending it will fill the passed in pointer with an array of matrices, the length being the value returned from getNumWorldTransforms.
Implements Ogre::Renderable.
References Ogre::Matrix4::IDENTITY.
Returns the squared distance between the camera and this renderable.
Used to sort transparent objects. Squared distance is used to avoid having to perform a square root on the result.
Implements Ogre::Renderable.
|
inlineoverridevirtual |
Gets a list of lights, ordered relative to how close they are to this renderable.
Directional lights, which have no position, will always be first on this list.
Implements Ogre::Renderable.
|
inlineoverridevirtual |
Retrieves a weak reference to the material this renderable object uses.
Note that the Renderable also has the option to override the getTechnique method to specify a particular Technique to use instead of the best one available.
Implements Ogre::Renderable.