OgreSceneNode.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef _SceneNode_H__
#define _SceneNode_H__
#include "OgrePrerequisites.h"
#include "OgreNode.h"
#include "OgreIteratorWrappers.h"
#include "OgreAxisAlignedBox.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
// forward decl
struct VisibleObjectsBoundsInfo;
class _OgreExport SceneNode : public Node
{
public:
typedef HashMap<String, MovableObject*> ObjectMap;
typedef MapIterator<ObjectMap> ObjectIterator;
typedef ConstMapIterator<ObjectMap> ConstObjectIterator;
protected:
ObjectMap mObjectsByName;
WireBoundingBox *mWireBoundingBox;
bool mShowBoundingBox;
bool mHideBoundingBox;
SceneManager* mCreator;
AxisAlignedBox mWorldAABB;
void updateFromParentImpl(void) const;
Node* createChildImpl(void);
Node* createChildImpl(const String& name);
void setParent(Node* parent);
virtual void setInSceneGraph(bool inGraph);
bool mYawFixed;
Vector3 mYawFixedAxis;
SceneNode* mAutoTrackTarget;
Vector3 mAutoTrackOffset;
Vector3 mAutoTrackLocalDirection;
bool mIsInSceneGraph;
public:
SceneNode(SceneManager* creator);
SceneNode(SceneManager* creator, const String& name);
~SceneNode();
virtual void attachObject(MovableObject* obj);
virtual unsigned short numAttachedObjects(void) const;
virtual MovableObject* getAttachedObject(unsigned short index);
virtual MovableObject* getAttachedObject(const String& name);
virtual MovableObject* detachObject(unsigned short index);
virtual void detachObject(MovableObject* obj);
virtual MovableObject* detachObject(const String& name);
virtual void detachAllObjects(void);
virtual bool isInSceneGraph(void) const { return mIsInSceneGraph; }
virtual void _notifyRootNode(void) { mIsInSceneGraph = true; }
virtual void _update(bool updateChildren, bool parentHasChanged);
virtual void _updateBounds(void);
virtual void _findVisibleObjects(Camera* cam, RenderQueue* queue,
VisibleObjectsBoundsInfo* visibleBounds,
bool includeChildren = true, bool displayNodes = false, bool onlyShadowCasters = false);
virtual const AxisAlignedBox& _getWorldAABB(void) const;
virtual ObjectIterator getAttachedObjectIterator(void);
virtual ConstObjectIterator getAttachedObjectIterator(void) const;
SceneManager* getCreator(void) const { return mCreator; }
virtual void removeAndDestroyChild(const String& name);
virtual void removeAndDestroyChild(unsigned short index);
virtual void removeAndDestroyAllChildren(void);
virtual void showBoundingBox(bool bShow);
virtual void hideBoundingBox(bool bHide);
virtual void _addBoundingBoxToQueue(RenderQueue* queue);
virtual bool getShowBoundingBox() const;
virtual SceneNode* createChildSceneNode(
const Vector3& translate = Vector3::ZERO,
const Quaternion& rotate = Quaternion::IDENTITY );
virtual SceneNode* createChildSceneNode(const String& name, const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
virtual void findLights(LightList& destList, Real radius, uint32 lightMask = 0xFFFFFFFF) const;
virtual void setFixedYawAxis( bool useFixed, const Vector3& fixedAxis = Vector3::UNIT_Y );
virtual void yaw(const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
virtual void setDirection(Real x, Real y, Real z,
TransformSpace relativeTo = TS_LOCAL,
const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
virtual void setDirection(const Vector3& vec, TransformSpace relativeTo = TS_LOCAL,
const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
virtual void lookAt( const Vector3& targetPoint, TransformSpace relativeTo,
const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
virtual void setAutoTracking(bool enabled, SceneNode* const target = 0,
const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z,
const Vector3& offset = Vector3::ZERO);
virtual SceneNode* getAutoTrackTarget(void) { return mAutoTrackTarget; }
virtual const Vector3& getAutoTrackOffset(void) { return mAutoTrackOffset; }
virtual const Vector3& getAutoTrackLocalDirection(void) { return mAutoTrackLocalDirection; }
void _autoTrack(void);
SceneNode* getParentSceneNode(void) const;
virtual void setVisible(bool visible, bool cascade = true);
virtual void flipVisibility(bool cascade = true);
virtual void setDebugDisplayEnabled(bool enabled, bool cascade = true);
virtual DebugRenderable* getDebugRenderable();
};
}// namespace
#include "OgreHeaderSuffix.h"
#endif
Ogre::SceneNode::mIsInSceneGraph
bool mIsInSceneGraph
Is this node a current part of the scene graph?
Definition: OgreSceneNode.h:109
OgreAxisAlignedBox.h
Ogre::SceneNode::getAutoTrackTarget
virtual SceneNode * getAutoTrackTarget(void)
Get the auto tracking target for this node, if any.
Definition: OgreSceneNode.h:422
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::SceneNode::getAutoTrackLocalDirection
virtual const Vector3 & getAutoTrackLocalDirection(void)
Get the auto tracking local direction for this node, if it is auto tracking.
Definition: OgreSceneNode.h:426
Ogre::SceneNode::ObjectIterator
MapIterator< ObjectMap > ObjectIterator
Definition: OgreSceneNode.h:62
Ogre::MovableObject
Abstract class defining a movable object in a scene.
Definition: OgreMovableObject.h:60
Ogre::Vector3::NEGATIVE_UNIT_Z
static const Vector3 NEGATIVE_UNIT_Z
Definition: OgreVector3.h:806
Ogre::SceneNode::mObjectsByName
ObjectMap mObjectsByName
Definition: OgreSceneNode.h:66
Ogre::Node::DebugRenderable
Inner class for displaying debug renderable for Node.
Definition: OgreNode.h:106
Ogre::Quaternion
Implementation of a Quaternion, i.e.
Definition: OgreQuaternion.h:57
Ogre::MapIterator
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:319
Ogre::SceneNode::mCreator
SceneManager * mCreator
SceneManager which created this node.
Definition: OgreSceneNode.h:75
Ogre::ConstMapIterator
Concrete IteratorWrapper for const access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:352
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::SceneNode::mAutoTrackOffset
Vector3 mAutoTrackOffset
Tracking offset for fine tuning.
Definition: OgreSceneNode.h:105
Ogre::RenderQueue
Class to manage the scene object rendering queue.
Definition: OgreRenderQueue.h:92
Ogre::SceneNode::mYawFixed
bool mYawFixed
Whether to yaw around a fixed axis.
Definition: OgreSceneNode.h:98
Ogre::SceneNode
Class representing a node in the scene graph.
Definition: OgreSceneNode.h:58
Ogre::SceneNode::mHideBoundingBox
bool mHideBoundingBox
Definition: OgreSceneNode.h:72
Ogre::SceneNode::ObjectMap
HashMap< String, MovableObject * > ObjectMap
Definition: OgreSceneNode.h:61
Ogre::SceneNode::mAutoTrackLocalDirection
Vector3 mAutoTrackLocalDirection
Local &#39;normal&#39; direction vector.
Definition: OgreSceneNode.h:107
Ogre::SceneNode::mWorldAABB
AxisAlignedBox mWorldAABB
World-Axis aligned bounding box, updated only through _update.
Definition: OgreSceneNode.h:78
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
OgreNode.h
OgrePrerequisites.h
Ogre::SceneNode::getAutoTrackOffset
virtual const Vector3 & getAutoTrackOffset(void)
Get the auto tracking offset for this node, if the node is auto tracking.
Definition: OgreSceneNode.h:424
Ogre::HashedVector
A hashed vector.
Definition: OgreCommon.h:332
Ogre::Node
Class representing a general-purpose node an articulated scene graph.
Definition: OgreNode.h:64
Ogre::SceneNode::mShowBoundingBox
bool mShowBoundingBox
Flag that determines if the bounding box of the node should be displayed.
Definition: OgreSceneNode.h:71
Ogre::VisibleObjectsBoundsInfo
Structure collecting together information about the visible objects that have been discovered in a sc...
Definition: OgreSceneManager.h:86
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::SceneNode::_notifyRootNode
virtual void _notifyRootNode(void)
Notifies this SceneNode that it is the root scene node.
Definition: OgreSceneNode.h:170
Ogre::SceneNode::mYawFixedAxis
Vector3 mYawFixedAxis
Fixed axis to yaw around.
Definition: OgreSceneNode.h:100
Ogre::SceneNode::mWireBoundingBox
WireBoundingBox * mWireBoundingBox
Pointer to a Wire Bounding Box for this Node.
Definition: OgreSceneNode.h:69
Ogre::WireBoundingBox
Allows the rendering of a wireframe bounding box.
Definition: OgreWireBoundingBox.h:48
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre::Vector3::UNIT_Y
static const Vector3 UNIT_Y
Definition: OgreVector3.h:802
Ogre::SceneNode::getCreator
SceneManager * getCreator(void) const
Gets the creator of this scene node.
Definition: OgreSceneNode.h:248
OgreHeaderSuffix.h
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
OgreIteratorWrappers.h
Ogre::SceneNode::isInSceneGraph
virtual bool isInSceneGraph(void) const
Determines whether this node is in the scene graph, i.e.
Definition: OgreSceneNode.h:164
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Node::TransformSpace
TransformSpace
Enumeration denoting the spaces which a transform can be relative to.
Definition: OgreNode.h:69
Ogre::SceneNode::ConstObjectIterator
ConstMapIterator< ObjectMap > ConstObjectIterator
Definition: OgreSceneNode.h:63
OgreHeaderPrefix.h
Ogre::SceneNode::mAutoTrackTarget
SceneNode * mAutoTrackTarget
Auto tracking target.
Definition: OgreSceneNode.h:103
Ogre::Quaternion::IDENTITY
static const Quaternion IDENTITY
Definition: OgreQuaternion.h:301
Ogre::AxisAlignedBox
A 3D box aligned with the x/y/z axes.
Definition: OgreAxisAlignedBox.h:54
Ogre::SceneManager
Manages the organisation and rendering of a &#39;scene&#39; i.e.
Definition: OgreSceneManager.h:143
Ogre::Radian
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:47
Ogre::Vector3::ZERO
static const Vector3 ZERO
Definition: OgreVector3.h:800

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.