File OgreRenderComponent.h¶
-
namespace
Ogre File: MovableText.h
Description: This creates a billboarding object that display a text. Note: This object must have a dedicated scene node since it will rotate it to face the camera (OGRE 2.1)
- Author
2003 by cTh see gavocanov@rambler.ru 2006 by barraq see nospam@barraquand.com 2012 to work with newer versions of OGRE by MindCalamity mindcalamity@gmail.com 2015 to work on OGRE 2.1 (but not on older versions anymore) by Jayray jeremy.richert1@gmail.com
-
namespace
Gsage -
class
OgreRenderComponent: public EventDispatcher, public RenderComponent - #include <OgreRenderComponent.h>
Ogre render system component
Public Functions
-
OgreRenderComponent()¶
-
virtual
~OgreRenderComponent()¶
-
void
prepare(Ogre::SceneManager *sceneManager, ResourceManager *resourceManager, OgreObjectManager *objectManager)¶ Set scene manager instance
- Parameters
sceneManager: Ogre::SceneManager instance to allow creating objects on sceneresourceManager: ResourceManager* instance to allow component loading additional resourceobjectManager: OgreObjectManager instance to allow creating root tree
-
void
setPosition(const Ogre::Vector3 &position)¶ Set render component position
- Parameters
position: New position
-
void
setOrientation(const Ogre::Quaternion &orientation)¶ Set render component orientation (equal to Ogre::SceneNode::setOrientation)
- Parameters
orientation: Orientation quaternion (absolute)
-
void
rotate(const Ogre::Quaternion &rotation)¶ Rotates render component
- Parameters
rotation: Rotation quaternion (relative)
-
void
lookAt(const Ogre::Vector3 &position, const Geometry::RotationAxis rotationAxis, Geometry::TransformSpace transformSpace = Geometry::TS_WORLD)¶ Equalient to Ogre::Node lookAt
- Parameters
position: Position to look atrotationAxis: rotate only in one axistransformSpace: ogre transform space
-
void
lookAt(const Ogre::Vector3 &position)¶ Equalient to Ogre::Node lookAt
- Parameters
position: Position to look at
-
const Ogre::Vector3
getOgreDirection()¶ Get current direction vector, uses orientationVector from config to detect front of the object
-
const Ogre::Quaternion
getOgreFaceOrientation()¶ Get object orientation with respect to the direction vector
-
void
rotate(const Gsage::Quaternion &rotation)¶ Rotates render component using Gsage::Quaternion
- Parameters
rotation: Rotation quaternion (relative)
-
void
lookAt(const Gsage::Vector3 &position, const Geometry::RotationAxis rotationAxis, Geometry::TransformSpace transformSpace = Geometry::TS_WORLD)¶ Equalient to Ogre::Node lookAt
- Parameters
position: Position to look atrotationAxis: rotate only in one axistransformSpace: ogre transform space
-
void
setPosition(const Gsage::Vector3 &position)¶ Set position by using Gsage::Vector
- Parameters
position: New position
-
void
setOrientation(const Gsage::Quaternion &orientation)¶ Set orientation using Gsage::Quaternion
- Parameters
orientation: Orientation quaternion (absolute)
-
const Gsage::Vector3
getDirection()¶ Get current direction vector, uses orientationVector from config to detect front of the object
-
const Gsage::Quaternion
getFaceOrientation()¶ Get object orientation with respect to the direction vector
-
bool
adjustAnimationStateSpeed(const std::string &name, double speed)¶ Adjusts animation speed for state
- Parameters
name: Animation state namespeed: animation speed
-
bool
setAnimationState(const std::string &name)¶ Sets animation state
- Return
true if state was found
- Parameters
name: Animation name
-
bool
playAnimation(const std::string &name, int times = -1, double speed = 1, double offset = 0, bool reset = false)¶ Plays animation
-
void
resetAnimationState()¶ Resets animation state to default
-
DataProxy
getRootNode()¶ Reads component root node
-
void
setRootNode(const DataProxy &value)¶ Builds node tree from DataProxy.
Example:
{ "position": "0,0,0", "scale": "0,0,0", "children": [ { "type": "model", "mesh": "mesh.mesh" } ] }
-
DataProxy
getAnimations()¶ Reads component animations
-
void
setAnimations(const DataProxy &value)¶ Sets animations
DataProxy should have the following format:
{ "states": { "state1": {"base": {"<model-name>": "<anim-name>"}} } }
-
SceneNodeWrapper *
getRoot()¶ Get root SceneNodeWrapper
-
void
setResources(const DataProxy &resources)¶ Read additional resources paths from the DataProxy
- Parameters
resources: DataProxy with all resources settings
-
const DataProxy &
getResources() const¶ Get resources
Private Members
-
bool
mAddedToScene¶
-
AnimationScheduler
mAnimationScheduler¶
-
SceneNodeWrapper *
mRootNode¶
-
DataProxy
mResources¶
-
ResourceManager *
mResourceManager¶
-
OgreObjectManager *
mObjectManager¶
Friends
-
friend
Gsage::OgreRenderSystem
-
-
class