File SceneNodeWrapper.h¶
-
namespace
Gsage
-
class
SceneNodeWrapper
: public Gsage::OgreObject, public EventSubscriber<SceneNodeWrapper> Public Functions
-
SceneNodeWrapper
()¶
-
virtual
~SceneNodeWrapper
()¶
-
bool
initialize
(OgreObjectManager *objectManager, const DataProxy &dict, const std::string &ownerId, const std::string &type, Ogre::SceneManager *sceneManager, Ogre::SceneNode *parent)¶ Initialize element from the node with values
- Parameters
factory
: OgreObjectManager to enable child class creationdict
: DataProxy with valuestype
: String type of the objectparent
: Parent SceneNodesceneManager
: SceneManager to useownerId
: Id of entity that owns the element
-
void
createNode
(const std::string &id)¶ Create Ogre::SceneNode with the specified if
- Parameters
id
: Node id
-
const std::string &
getId
() const¶ Get node id
-
void
setPosition
(const Ogre::Vector3 &position)¶ Set node position with defined offset
- Parameters
position
: Ogre::Vector3 position
-
void
setPositionWithoutOffset
(const Ogre::Vector3 &position)¶ Set node position without defined offset
- Parameters
position
: Ogre::Vector3 position
-
Ogre::Vector3
getPositionWithoutOffset
()¶ Get node position without correction that is defined in offset field
-
void
setScale
(const Ogre::Vector3 &scale)¶ Set SceneNode scale
- Parameters
scale
: Ogre::Vector3 scale in all dimensions
-
void
setOrientation
(const Ogre::Quaternion &rotation)¶ Set node orientation
- Parameters
rotation
: Orientation quaternion
-
void
readChildren
(const DataProxy &dict)¶
-
DataProxy
writeChildren
()¶
-
void
setOrientationVector
(const Ogre::Vector3 &value)¶ Set vector that defines “face” of the node
- Parameters
value
: Ogre::Vector3 normalized/not normalized vector (it is normalized anyway)
-
void
rotate
(const Ogre::Quaternion &rotation, const Ogre::Node::TransformSpace ts)¶ Rotate node
- Parameters
rotation
: Ogre::Quaternion that defines rotation
-
void
rotate
(const Ogre::Vector3 &axis, const Ogre::Degree °ree, const Ogre::Node::TransformSpace ts)¶ Rotate node
- Parameters
axis
: Axis to rotate arounddegree
: Rotation degreets
: Transform space
-
void
lookAt
(const Ogre::Vector3 &position, Ogre::Node::TransformSpace relativeTo)¶ Rotate node to look at position
- Parameters
position
: Position to look atrelativeTo
: Coordinate space to use
-
void
destroy
()¶ Remove all children and destroy node
-
bool
attach
(Ogre::MovableObject *object, const DataProxy ¶ms)¶ Attach movable object to this object
- Parameters
object
: Object to attach
-
void
destroyAllAttachedMovableObjects
(Ogre::SceneNode *node)¶ Remove all attached movable objects from the node
- Parameters
node
: Node to process
-
OgreObject *
getChild
(const std::string &type, const std::string &name, bool traverse = false)¶ Get child
- Parameters
type
: Type of the childname
: Name, that was defined in the “name” fieldtraverse
: Traverse children splitting name by .
-
template<class
T
>
T *getChildOfType
(const std::string &name)¶ Get child of specific type
- Parameters
type
: Type of the childname
: Name, that was defined in the “name” field
-
IMovableObjectWrapper *
getMovableObject
(const std::string &type, const std::string &name)¶
-
void
pitch
(const Ogre::Radian &angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)¶ Rotate the node around X axis
- Parameters
angle
: Rotation anglerelativeTo
: Transformation space
-
void
yaw
(const Ogre::Radian &angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)¶ Rotate the node around Y axis
- Parameters
angle
: Rotation anglerelativeTo
: Transformation space
-
void
roll
(const Ogre::Radian &angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)¶ Rotate the node around Z axis
- Parameters
angle
: Rotation anglerelativeTo
: Transformation space
-
void
translate
(const Ogre::Vector3 &d)¶ Moves the node along the Cartesian axes
- Parameters
d
: Vector with x,y,z values representing the translation
Public Static Attributes
-
const std::string
TYPE
¶
Private Types
-
typedef std::map<const std::string, OgreObject *>
ObjectCollection
¶
-
typedef std::map<const std::string, ObjectCollection>
Objects
¶
Private Functions
-
bool
onFactoryUnregister
(EventDispatcher *sender, const Event &event)¶ Handle factory removal event
- Parameters
event
: OgreObjectManager event
-
-
class