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) | |
~BspLevel () | |
void | _notifyObjectDetached (const MovableObject *mov) |
Internal method, makes sure an object is removed from the leaves when detached from a node. | |
void | _notifyObjectMoved (const MovableObject *mov, const Vector3 &pos) |
Ensures that the MovableObject is attached to the right leaves of the BSP tree. | |
BspNode * | findLeaf (const Vector3 &point) const |
Walks the entire BSP tree and returns the leaf which contains the given point. | |
BspNode * | getLeafStart (void) |
Gets a pointer to the start of the leaf nodes. | |
const LightList & | getLights () const override |
Gets a list of lights, ordered relative to how close they are to this renderable. | |
const MaterialPtr & | getMaterial (void) const override |
Retrieves a weak reference to the material this renderable object uses. | |
int | getNumLeaves (void) const |
Gets the number of leaf nodes. | |
void | getRenderOperation (RenderOperation &op) override |
Gets the render operation required to send this object to the frame buffer. | |
const BspNode * | getRootNode (void) |
Returns a pointer to the root node (BspNode) of the BSP tree. | |
Real | getSkyCurvature (void) const |
Get sky curvature. | |
const String & | getSkyMaterialName (void) const |
Get Sky material name. | |
Real | getSquaredViewDepth (const Camera *cam) const override |
Returns the squared distance between the camera and this renderable. | |
void | getWorldTransforms (Matrix4 *xform) const override |
Gets the world transform matrix / matrices for this renderable object. | |
bool | isLeafVisible (const BspNode *from, const BspNode *to) const |
Determines if one leaf node is visible from another. | |
bool | isSkyEnabled (void) const |
Is sky enabled? | |
void | load (const DataStreamPtr &stream) |
Load direct from stream. | |
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. | |
virtual | ~Resource () |
Virtual destructor. | |
virtual void | _dirtyState () |
Manually mark the state of this resource as having been changed. | |
void | _fireLoadingComplete (bool unused=false) |
Firing of loading complete event. | |
void | _firePreparingComplete (bool unused=false) |
Firing of preparing complete event. | |
void | _fireUnloadingComplete (void) |
Firing of unloading complete event. | |
void | _notifyOrigin (const String &origin) |
Notify this resource of it's origin. | |
virtual void | addListener (Listener *lis) |
Register a listener on this resource. | |
virtual void | changeGroupOwnership (const String &newGroup) |
Change the resource group ownership of a Resource. | |
virtual void | escalateLoading () |
Escalates the loading of a background loaded resource. | |
ResourceManager * | getCreator (void) |
Gets the manager which created this resource. | |
const String & | getGroup (void) const |
Gets the group which this resource is a member of. | |
ResourceHandle | getHandle (void) const |
LoadingState | getLoadingState () const |
Returns the current loading state. | |
const String & | getName (void) const |
Gets resource name. | |
const String & | getOrigin (void) const |
Get the origin of this resource, e.g. | |
size_t | getSize (void) const |
Retrieves info about the size of the resource. | |
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. | |
bool | isBackgroundLoaded (void) const |
Returns whether this Resource has been earmarked for background loading. | |
bool | isLoaded (void) const |
Returns true if the Resource has been loaded, false otherwise. | |
bool | isLoading () const |
Returns whether the resource is currently in the process of background loading. | |
bool | isManuallyLoaded (void) const |
Is this resource manually loaded? | |
bool | isPrepared (void) const |
Returns true if the Resource has been prepared, false otherwise. | |
bool | isReloadable (void) const |
Returns true if the Resource is reloadable, false otherwise. | |
virtual void | prepare (bool backgroundThread=false) |
Prepares the resource for load, if it is not already. | |
virtual void | reload (LoadingFlags flags=LF_DEFAULT) |
Reloads the resource, if it is already loaded. | |
virtual void | removeListener (Listener *lis) |
Remove a listener on this resource. | |
void | setBackgroundLoaded (bool bl) |
Tells the resource whether it is background loaded or not. | |
virtual void | touch (void) |
'Touches' the resource to indicate it has been used. | |
virtual void | unload (void) |
Unloads the resource; this is not permanent, the resource can be reloaded later if required. | |
Public Member Functions inherited from Ogre::StringInterface | |
StringInterface () | |
virtual | ~StringInterface () |
Virtual destructor, see Effective C++. | |
void | copyParametersTo (StringInterface *dest) const |
Method for copying this object's parameters to another object. | |
ParamDictionary * | getParamDictionary (void) |
Retrieves the parameter dictionary for this class. | |
const ParamDictionary * | getParamDictionary (void) const |
String | getParameter (const String &name) const |
Generic parameter retrieval method. | |
const ParameterList & | getParameters (void) const |
Retrieves a list of parameters valid for this object. | |
bool | setParameter (const String &name, const String &value) |
Generic parameter setting method. | |
void | setParameterList (const NameValuePairList ¶mList) |
Generic multiple parameter setting method. | |
Public Member Functions inherited from Ogre::Renderable | |
Renderable () | |
virtual | ~Renderable () |
Virtual destructor needed as class has virtual methods. | |
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. | |
virtual bool | getCastsShadows (void) const |
Method which reports whether this renderable would normally cast a shadow. | |
const Vector4f & | getCustomParameter (size_t index) const |
Gets the custom value associated with this Renderable at the given index. | |
virtual uint16 | getNumWorldTransforms (void) const |
Returns the number of world transform matrices this renderable requires. | |
bool | getPolygonModeOverrideable (void) const |
Gets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setting. | |
virtual Technique * | getTechnique (void) const |
Retrieves a pointer to the Material Technique this renderable object uses. | |
bool | getUseIdentityProjection (void) const |
Returns whether or not to use an 'identity' projection. | |
bool | getUseIdentityView (void) const |
Returns whether or not to use an 'identity' view. | |
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. | |
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. | |
bool | hasCustomParameter (size_t index) const |
Checks whether a custom value is associated with this Renderable at the given index. | |
virtual void | postRender (SceneManager *sm, RenderSystem *rsys) |
Called immediately after the Renderable has been rendered. | |
virtual bool | preRender (SceneManager *sm, RenderSystem *rsys) |
Called just prior to the Renderable being rendered. | |
void | removeCustomParameter (size_t index) |
Removes a custom value which is associated with this Renderable at the given index. | |
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. | |
void | setPolygonModeOverrideable (bool override) |
Sets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setting. | |
void | setUseIdentityProjection (bool useIdentityProjection) |
Sets whether or not to use an 'identity' projection. | |
void | setUseIdentityView (bool useIdentityView) |
Sets whether or not to use an 'identity' view. | |
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. | |
static size_t | calculateLoadingStages (DataStreamPtr &stream) |
Calculate the number of loading stages required for a given level. | |
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. | |
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.
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.
Gets a pointer to the start of the leaf nodes.
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.
|
inlineoverridevirtual |
Gets the render operation required to send this object to the frame buffer.
Implements Ogre::Renderable.
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.
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.