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

Ogre::MovableObject Class Reference

Abstract class definining a movable object in a scene. More...

#include <OgreMovableObject.h>

Inheritance diagram for Ogre::MovableObject:

Inheritance graph
[legend]
Collaboration diagram for Ogre::MovableObject:

Collaboration graph
[legend]
List of all members.

Public Methods

 MovableObject ()
 Constructor.

virtual ~MovableObject ()
 Virtual destructor - read Scott Meyers if you don't know why this is needed.

virtual const StringgetName (void) const=0
 Returns the name of this object.

virtual const StringgetMovableType (void) const=0
 Returns the type name of this object.

virtual NodegetParentNode (void) const
 Returns the node to which this object is attached.

virtual void _notifyAttached (Node *parent, bool isTagPoint=false)
 Internal method called to notify the object that it has been attached to a node.

virtual bool isAttached (void) const
 Returns true if this object is attached to a SceneNode or TagPoint.

virtual void _notifyCurrentCamera (Camera *cam)=0
 Internal method to notify the object of the camera to be used for the next rendering operation.

virtual const AxisAlignedBoxgetBoundingBox (void) const=0
 Retrieves the local axis-aligned bounding box for this object.

virtual Real getBoundingRadius (void) const=0
 Retrieves the radius of the origin-centered bounding sphere for this object.

virtual const AxisAlignedBoxgetWorldBoundingBox (bool derive=false) const
 Retrieves the axis-aligned bounding box for this object in world coordinates.

virtual const SpheregetWorldBoundingSphere (bool derive=false) const
 Retrieves the worldspace bounding sphere for this object.

virtual void _updateRenderQueue (RenderQueue *queue)=0
 Internal method by which the movable object must add Renderable subclass instances to the rendering queue.

virtual void setVisible (bool visible)
 Tells this object whether to be visible or not, if it has a renderable component.

virtual bool isVisible (void) const
 Returns whether or not this object is supposed to be visible or not.

virtual void setUserObject (UserDefinedObject *obj)
 Call this to associate your own custom user object instance with this MovableObject.

virtual UserDefinedObjectgetUserObject (void)
 Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject.

virtual void setRenderQueueGroup (RenderQueueGroupID queueID)
 Sets the render queue group this entity will be rendered through.

virtual RenderQueueGroupID getRenderQueueGroup (void) const
 Gets the queue group for this entity, see setRenderQueueGroup for full details.

virtual Matrix4 _getParentNodeFullTransform (void) const
 return the full transformation of the parent sceneNode or the attachingPoint node

virtual void setQueryFlags (unsigned long flags)
 Sets the query flags for this object.

virtual void addQueryFlags (unsigned long flags)
 As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.

virtual void removeQueryFlags (unsigned long flags)
 As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.

virtual unsigned long getQueryFlags (void) const
 Returns the query flags relevant for this object.


Protected Attributes

NodemParentNode
 node to which this object is attached

bool mParentIsTagPoint
bool mVisible
 Is this object visible?

UserDefinedObjectmUserObject
 User defined object which is linked to this object.

RenderQueueGroupID mRenderQueueID
 The render queue to use when rendering this object.

unsigned long mQueryFlags
 Flags determining whether this object is included / excluded from scene queries.

AxisAlignedBox mWorldAABB
 Cached world AABB of this object.

Sphere mWorldBoundingSphere

Detailed Description

Abstract class definining a movable object in a scene.

Remarks:
Instances of this class are discrete, relatively small, movable objects which are attached to SceneNode objects to define their position.

Definition at line 43 of file OgreMovableObject.h.


Constructor & Destructor Documentation

Ogre::MovableObject::MovableObject  
 

Constructor.

Definition at line 34 of file OgreMovableObject.cpp.

References mParentIsTagPoint, mParentNode, mQueryFlags, mRenderQueueID, mUserObject, mVisible, mWorldAABB, Ogre::RENDER_QUEUE_MAIN, and Ogre::AxisAlignedBox::setNull().

Ogre::MovableObject::~MovableObject   [virtual]
 

Virtual destructor - read Scott Meyers if you don't know why this is needed.

Definition at line 45 of file OgreMovableObject.cpp.

References mParentIsTagPoint, and mParentNode.


Member Function Documentation

Matrix4 Ogre::MovableObject::_getParentNodeFullTransform void    const [virtual]
 

return the full transformation of the parent sceneNode or the attachingPoint node

Definition at line 92 of file OgreMovableObject.cpp.

References Ogre::Node::_getFullTransform(), and mParentNode.

Referenced by Ogre::Entity::cacheBoneMatrices(), Ogre::TagPoint::getParentEntityTransform(), getWorldBoundingBox(), Ogre::SubEntity::getWorldTransforms(), and Ogre::BillboardSet::getWorldTransforms().

void Ogre::MovableObject::_notifyAttached Node   parent,
bool    isTagPoint = false
[virtual]
 

Internal method called to notify the object that it has been attached to a node.

Definition at line 54 of file OgreMovableObject.cpp.

References mParentIsTagPoint, and mParentNode.

Referenced by Ogre::SceneNode::attachObject(), Ogre::Entity::attachObjectImpl(), Ogre::SceneNode::detachAllObjects(), Ogre::SceneNode::detachObject(), and Ogre::SceneNode::~SceneNode().

virtual void Ogre::MovableObject::_notifyCurrentCamera Camera   cam [pure virtual]
 

Internal method to notify the object of the camera to be used for the next rendering operation.

Remarks:
Certain objects may want to do specific processing based on the camera position. This method notifies them incase they wish to do this.

Implemented in Ogre::BillboardSet, Ogre::Camera, Ogre::Entity, Ogre::Frustum, Ogre::Light, Ogre::SimpleRenderable, and Ogre::TerrainRenderable.

Referenced by Ogre::OctreeNode::_addToRenderQueue(), and Ogre::BspSceneManager::processVisibleLeaf().

virtual void Ogre::MovableObject::_updateRenderQueue RenderQueue   queue [pure virtual]
 

Internal method by which the movable object must add Renderable subclass instances to the rendering queue.

Remarks:
The engine will call this method when this object is to be rendered. The object must then create one or more Renderable subclass instances which it places on the passed in Queue for rendering.

Implemented in Ogre::BillboardSet, Ogre::Camera, Ogre::Entity, Ogre::Frustum, Ogre::Light, Ogre::SimpleRenderable, and Ogre::TerrainRenderable.

Referenced by Ogre::BspSceneManager::processVisibleLeaf().

virtual void Ogre::MovableObject::addQueryFlags unsigned long    flags [virtual]
 

As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.

Definition at line 168 of file OgreMovableObject.h.

virtual const AxisAlignedBox& Ogre::MovableObject::getBoundingBox void    const [pure virtual]
 

Retrieves the local axis-aligned bounding box for this object.

Remarks:
This bounding box is in local coordinates.

Implemented in Ogre::BillboardSet, Ogre::Camera, Ogre::Entity, Ogre::Frustum, Ogre::Light, Ogre::SimpleRenderable, and Ogre::TerrainRenderable.

Referenced by getWorldBoundingBox().

virtual Real Ogre::MovableObject::getBoundingRadius void    const [pure virtual]
 

Retrieves the radius of the origin-centered bounding sphere for this object.

Implemented in Ogre::BillboardSet, Ogre::Camera, Ogre::Entity, Ogre::Frustum, Ogre::Light, Ogre::WireBoundingBox, and Ogre::TerrainRenderable.

Referenced by Ogre::BspIntersectionSceneQuery::execute(), getWorldBoundingSphere(), and Ogre::BspLevel::tagNodesWithMovable().

virtual const String& Ogre::MovableObject::getMovableType void    const [pure virtual]
 

Returns the type name of this object.

Implemented in Ogre::BillboardSet, Ogre::Camera, Ogre::Entity, Ogre::Frustum, Ogre::Light, Ogre::ParticleSystem, Ogre::SimpleRenderable, and Ogre::TerrainRenderable.

virtual const String& Ogre::MovableObject::getName void    const [pure virtual]
 

Returns the name of this object.

Implemented in Ogre::BillboardSet, Ogre::Camera, Ogre::Entity, Ogre::Frustum, Ogre::Light, Ogre::ParticleSystem, Ogre::SimpleRenderable, and Ogre::TerrainRenderable.

Referenced by Ogre::SceneNode::attachObject(), and Ogre::Entity::attachObjectImpl().

Node * Ogre::MovableObject::getParentNode void    const [virtual]
 

Returns the node to which this object is attached.

Remarks:
An object is not visible in the scene unless attached to a SceneNode.

Attaching an object is done via the SceneNode::attachObject method.

Definition at line 60 of file OgreMovableObject.cpp.

References mParentNode.

Referenced by Ogre::TagPoint::_updateFromParent(), Ogre::BspIntersectionSceneQuery::execute(), Ogre::TagPoint::getLights(), Ogre::SubEntity::getLights(), Ogre::SubEntity::getSquaredViewDepth(), Ogre::TagPoint::needUpdate(), and Ogre::BspSceneManager::processVisibleLeaf().

virtual unsigned long Ogre::MovableObject::getQueryFlags void    const [virtual]
 

Returns the query flags relevant for this object.

Definition at line 175 of file OgreMovableObject.h.

Referenced by Ogre::BspIntersectionSceneQuery::execute().

RenderQueueGroupID Ogre::MovableObject::getRenderQueueGroup void    const [virtual]
 

Gets the queue group for this entity, see setRenderQueueGroup for full details.

Definition at line 87 of file OgreMovableObject.cpp.

References mRenderQueueID, and Ogre::RenderQueueGroupID.

virtual UserDefinedObject* Ogre::MovableObject::getUserObject void    [virtual]
 

Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject.

Definition at line 136 of file OgreMovableObject.h.

const AxisAlignedBox & Ogre::MovableObject::getWorldBoundingBox bool    derive = false const [virtual]
 

Retrieves the axis-aligned bounding box for this object in world coordinates.

Definition at line 104 of file OgreMovableObject.cpp.

References _getParentNodeFullTransform(), getBoundingBox(), mWorldAABB, and Ogre::AxisAlignedBox::transform().

Referenced by Ogre::BspIntersectionSceneQuery::execute(), and Ogre::BspSceneManager::processVisibleLeaf().

const Sphere & Ogre::MovableObject::getWorldBoundingSphere bool    derive = false const [virtual]
 

Retrieves the worldspace bounding sphere for this object.

Definition at line 116 of file OgreMovableObject.cpp.

References Ogre::Node::_getDerivedPosition(), getBoundingRadius(), mParentNode, mWorldBoundingSphere, Ogre::Sphere::setCenter(), and Ogre::Sphere::setRadius().

bool Ogre::MovableObject::isAttached void    const [virtual]
 

Returns true if this object is attached to a SceneNode or TagPoint.

Definition at line 65 of file OgreMovableObject.cpp.

References mParentNode.

Referenced by Ogre::Entity::attachObjectToBone().

bool Ogre::MovableObject::isVisible void    const [virtual]
 

Returns whether or not this object is supposed to be visible or not.

Definition at line 76 of file OgreMovableObject.cpp.

References mVisible.

Referenced by Ogre::OctreeNode::_addToRenderQueue(), Ogre::SceneManager::_populateLightList(), and Ogre::BspSceneManager::processVisibleLeaf().

virtual void Ogre::MovableObject::removeQueryFlags unsigned long    flags [virtual]
 

As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.

Definition at line 172 of file OgreMovableObject.h.

virtual void Ogre::MovableObject::setQueryFlags unsigned long    flags [virtual]
 

Sets the query flags for this object.

Remarks:
When performing a scene query, this object will be included or excluded according to flags on the object and flags on the query. This is a bitwise value, so only when a bit on these flags is set, will it be included in a query asking for that flag. The meaning of the bits is application-specific.

Definition at line 164 of file OgreMovableObject.h.

void Ogre::MovableObject::setRenderQueueGroup RenderQueueGroupID    queueID [virtual]
 

Sets the render queue group this entity will be rendered through.

Remarks:
Render queues are grouped to allow you to more tightly control the ordering of rendered objects. If you do not call this method, all Entity objects default to RENDER_QUEUE_MAIN which is fine for most objects. You may want to alter this if you want this entity to always appear in front of other objects, e.g. for a 3D menu system or such.

See RenderQueue for more details.

Parameters:
queueID  Enumerated value of the queue group to use.

Definition at line 82 of file OgreMovableObject.cpp.

References mRenderQueueID, and Ogre::RenderQueueGroupID.

virtual void Ogre::MovableObject::setUserObject UserDefinedObject   obj [virtual]
 

Call this to associate your own custom user object instance with this MovableObject.

Remarks:
By simply making your game / application object a subclass of UserDefinedObject, you can establish a link between an OGRE instance of MovableObject and your own application classes. Call this method to establish the link.

Definition at line 132 of file OgreMovableObject.h.

void Ogre::MovableObject::setVisible bool    visible [virtual]
 

Tells this object whether to be visible or not, if it has a renderable component.

Reimplemented in Ogre::Light.

Definition at line 71 of file OgreMovableObject.cpp.

References mVisible.


Member Data Documentation

bool Ogre::MovableObject::mParentIsTagPoint [protected]
 

Definition at line 48 of file OgreMovableObject.h.

Referenced by _notifyAttached(), MovableObject(), and ~MovableObject().

Node* Ogre::MovableObject::mParentNode [protected]
 

node to which this object is attached

Definition at line 47 of file OgreMovableObject.h.

Referenced by _getParentNodeFullTransform(), _notifyAttached(), Ogre::Entity::_notifyCurrentCamera(), Ogre::ParticleSystem::_triggerEmitters(), Ogre::ParticleSystem::_updateBounds(), Ogre::BillboardSet::_updateBounds(), Ogre::Camera::Camera(), Ogre::Frustum::Frustum(), Ogre::BillboardSet::genBillboardAxes(), Ogre::Entity::getBoundingBox(), Ogre::Entity::getBoundingRadius(), Ogre::TerrainRenderable::getLights(), Ogre::SimpleRenderable::getLights(), Ogre::BillboardSet::getLights(), getParentNode(), Ogre::Frustum::getSquaredViewDepth(), Ogre::BillboardSet::getSquaredViewDepth(), getWorldBoundingSphere(), Ogre::TerrainRenderable::getWorldOrientation(), Ogre::SubEntity::getWorldOrientation(), Ogre::SimpleRenderable::getWorldOrientation(), Ogre::ParticleSystem::getWorldOrientation(), Ogre::Frustum::getWorldOrientation(), Ogre::BillboardSet::getWorldOrientation(), Ogre::TerrainRenderable::getWorldPosition(), Ogre::SubEntity::getWorldPosition(), Ogre::SimpleRenderable::getWorldPosition(), Ogre::ParticleSystem::getWorldPosition(), Ogre::Frustum::getWorldPosition(), Ogre::BillboardSet::getWorldPosition(), Ogre::TerrainRenderable::getWorldTransforms(), Ogre::SimpleRenderable::getWorldTransforms(), Ogre::Frustum::getWorldTransforms(), isAttached(), Ogre::Frustum::isViewOutOfDate(), Ogre::Camera::isViewOutOfDate(), Ogre::Light::Light(), MovableObject(), Ogre::SimpleRenderable::SimpleRenderable(), Ogre::Light::update(), and ~MovableObject().

unsigned long Ogre::MovableObject::mQueryFlags [protected]
 

Flags determining whether this object is included / excluded from scene queries.

Definition at line 56 of file OgreMovableObject.h.

Referenced by MovableObject().

RenderQueueGroupID Ogre::MovableObject::mRenderQueueID [protected]
 

The render queue to use when rendering this object.

Definition at line 54 of file OgreMovableObject.h.

Referenced by Ogre::Entity::_updateRenderQueue(), Ogre::BillboardSet::_updateRenderQueue(), getRenderQueueGroup(), MovableObject(), and setRenderQueueGroup().

UserDefinedObject* Ogre::MovableObject::mUserObject [protected]
 

User defined object which is linked to this object.

Definition at line 52 of file OgreMovableObject.h.

Referenced by MovableObject().

bool Ogre::MovableObject::mVisible [protected]
 

Is this object visible?

Definition at line 50 of file OgreMovableObject.h.

Referenced by Ogre::Frustum::Frustum(), isVisible(), MovableObject(), and setVisible().

AxisAlignedBox Ogre::MovableObject::mWorldAABB [protected]
 

Cached world AABB of this object.

Definition at line 58 of file OgreMovableObject.h.

Referenced by getWorldBoundingBox(), and MovableObject().

Sphere Ogre::MovableObject::mWorldBoundingSphere [protected]
 

Definition at line 60 of file OgreMovableObject.h.

Referenced by getWorldBoundingSphere().


The documentation for this class was generated from the following files:

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:18:40 2004