COgreObject Class Reference

An OgreObject manages a 3D object in an Ogre scene. More...

List of all members.

Public Member Functions

 COgreObject (const OpenViBE::Kernel::IKernelContext &rKernelContext, OpenViBE::CIdentifier oIdentifier, COgreVisualisation *pOgreVis, Ogre::SceneManager *pSceneManager, const OpenViBE::CString &rGeometryFileName)
 Constructor.
 ~COgreObject ()
 Destructor.
OpenViBE::CIdentifier getIdentifier ()
 Clone object.
const OpenViBE::CStringgetName ()
 Return object name.
const OpenViBE::CStringgetGeometryFileName ()
 Return geometry file name.
NodeMaterialOrig * getNodeMaterialOrig ()
 Return the node to change the materials.
Ogre::SceneNode & getSceneNode () const
 Retrieve scene node corresponding to this object.
OpenViBE::boolean setVisible (OpenViBE::boolean bVisible)
 Set visibility.
OpenViBE::boolean setDiffuseColor (const Ogre::ColourValue &oDiffuse)
 Set the color of an object.
OpenViBE::boolean setDiffuseColor (Ogre::Real f32ColorRed, Ogre::Real f32ColorGreen, Ogre::Real f32ColorBlue)
 Set the color of an object.
OpenViBE::boolean setTransparency (Ogre::Real transparency)
 Set the transparency of an object.
OpenViBE::boolean setPosition (Ogre::Real positionX, Ogre::Real positionY, Ogre::Real positionZ)
 Set the position of an object.
OpenViBE::boolean setRotation (Ogre::Real rotationX, Ogre::Real rotationY, Ogre::Real rotationZ)
 Set the orientation of an object.
OpenViBE::boolean setRotation (Ogre::Real rotationX, Ogre::Real rotationY, Ogre::Real rotationZ, Ogre::Real rotationW)
 Set the orientation of an object.
OpenViBE::boolean setScale (Ogre::Real scaleX, Ogre::Real scaleY, Ogre::Real scaleZ)
 Set the scale of an object.
OpenViBE::boolean setVertexColorArray (Ogre::uint32 ui32VertexColorCount, Ogre::Real *pVertexColorArray)
 Set vertex colors of an object.
OpenViBE::boolean getVertexCount (Ogre::uint32 &ui32VertexCount) const
 Get object vertex count.
OpenViBE::boolean getVertexPositionArray (Ogre::uint32 ui32VertexCount, Ogre::Real *pVertexPositionArray) const
 Get vertex position array.
OpenViBE::boolean getTriangleCount (Ogre::uint32 &ui32TriangleCount) const
 Get object triangle count.
OpenViBE::boolean getTriangleIndexArray (Ogre::uint32 ui32TriangleCount, OpenViBE::uint32 *pTriangleIndexArray) const
 Get array of face indices.
OpenViBE::boolean getWorldBoundingBox (Ogre::Real &rMinX, Ogre::Real &rMinY, Ogre::Real &rMinZ, Ogre::Real &rMaxX, Ogre::Real &rMaxY, Ogre::Real &rMaxZ)
 Get world bounding box of an object.

Friends

class COgreScene

Detailed Description

An OgreObject manages a 3D object in an Ogre scene.

Author:
Vincent Delannoy (INRIA/IRISA)
Date:
2008-06

Constructor & Destructor Documentation

COgreObject ( const OpenViBE::Kernel::IKernelContext rKernelContext,
OpenViBE::CIdentifier  oIdentifier,
COgreVisualisation pOgreVis,
Ogre::SceneManager *  pSceneManager,
const OpenViBE::CString rGeometryFileName 
)

Constructor.

Parameters:
[in]rKernelContextOpenViBE kernel context
[in]rIdentifierObject identifier
[in]pOgreVispointer to OgreVisualisation object
[in]pSceneManagerpointer to scene manager this object is to be added to
[in]rGeometryfileNamename of file containing this object's geometry

Member Function Documentation

OpenViBE::CIdentifier getIdentifier ( )

Clone object.

Parameters:
[in]oIdentifierIdentifier of the object
[out]pCloneReference of pointer to cloned object
Returns:
True if cloned object could be created, false otherwise Return object identifier
OpenViBE::boolean setVisible ( OpenViBE::boolean  bVisible)

Set visibility.

Parameters:
bVisibleVisibility flag
Returns:
True if visibility could be set, false otherwise
OpenViBE::boolean setDiffuseColor ( const Ogre::ColourValue &  oDiffuse)

Set the color of an object.

Parameters:
oDiffuseRGBA diffuse color
Returns:
True if color could be set, false otherwise
OpenViBE::boolean setDiffuseColor ( Ogre::Real  f32ColorRed,
Ogre::Real  f32ColorGreen,
Ogre::Real  f32ColorBlue 
)

Set the color of an object.

Parameters:
f32ColorRedRed component (0 to 1)
f32ColorGreenGreen component (0 to 1)
f32ColorBlueBlue component (0 to 1)
Returns:
True if color could be set, false otherwise
OpenViBE::boolean setTransparency ( Ogre::Real  transparency)

Set the transparency of an object.

Parameters:
f32TransparencyTransparency (0 to 1, 1 being totally transparent)
Returns:
True if transparency could be set, false otherwise
OpenViBE::boolean setPosition ( Ogre::Real  positionX,
Ogre::Real  positionY,
Ogre::Real  positionZ 
)

Set the position of an object.

Parameters:
f32PositionXX coordinate of position
f32PositionYY coordinate of position
f32PositionZZ coordinate of position
Returns:
True if object position could be set, false otherwise
OpenViBE::boolean setRotation ( Ogre::Real  rotationX,
Ogre::Real  rotationY,
Ogre::Real  rotationZ 
)

Set the orientation of an object.

Returns:
True if orientation could be set, false otherwise
OpenViBE::boolean setRotation ( Ogre::Real  rotationX,
Ogre::Real  rotationY,
Ogre::Real  rotationZ,
Ogre::Real  rotationW 
)

Set the orientation of an object.

Parameters:
f32OrientationXX component of a quaternion
f32OrientationYY component of a quaternion
f32OrientationZZ component of a quaternion
f32OrientationWW component of a quaternion
Returns:
True if orientation could be set, false otherwise
OpenViBE::boolean setScale ( Ogre::Real  scaleX,
Ogre::Real  scaleY,
Ogre::Real  scaleZ 
)

Set the scale of an object.

Parameters:
f32ScaleXX component of scale
f32ScaleYY component of scale
f32ScaleZZ component of scale
Returns:
True if scale could be set, false otherwise
OpenViBE::boolean setVertexColorArray ( Ogre::uint32  ui32VertexColorCount,
Ogre::Real *  pVertexColorArray 
)

Set vertex colors of an object.

Remarks:
This method applies vertex colors to the first mesh of the first Ogre::Entity encountered in the object hierarchy only. For it to work, the Ogre::Mesh needs to have been flagged as using vertex colors in authoring tools.
Parameters:
ui32VertexColorCountNumber of colors contained in pVertexColorArray
pVertexColorArrayArray of color triplets
Returns:
True if colors could be set, false otherwise
OpenViBE::boolean getVertexCount ( Ogre::uint32 &  ui32VertexCount) const

Get object vertex count.

Remarks:
This method returns the number of vertices in the first mesh of the first Ogre::Entity encountered in the object hierarchy only.
Parameters:
ui32VertexCountNumber of vertices found in first mesh of first entity
Returns:
True if vertex count could be retrieved, false otherwise
OpenViBE::boolean getVertexPositionArray ( Ogre::uint32  ui32VertexCount,
Ogre::Real *  pVertexPositionArray 
) const

Get vertex position array.

Remarks:
This method returns vertex positions of the first mesh of the first Ogre::Entity encountered in the object hierarchy only.
Parameters:
ui32VertexCountNumber of vertices that can be stored in pVertexPositionArray
pVertexPositionArrayPreallocated array destined to store vertex position triplets
Returns:
True if vertex positions could be retrieved, false otherwise
OpenViBE::boolean getTriangleCount ( Ogre::uint32 &  ui32TriangleCount) const

Get object triangle count.

Remarks:
This method returns the number of triangles in the first mesh of the first Ogre::Entity encountered in the object hierarchy only.
Parameters:
ui32TriangleCountNumber of triangles found in first mesh of first entity
Returns:
True if triangle count could be retrieved, false otherwise
OpenViBE::boolean getTriangleIndexArray ( Ogre::uint32  ui32TriangleCount,
OpenViBE::uint32 pTriangleIndexArray 
) const

Get array of face indices.

Remarks:
This method returns face indices of the first mesh of the first Ogre::Entity encountered in the object hierarchy only.
Parameters:
ui32TriangleCountNumber of triangles that can be stored in pTriangleIndexArray
pTriangleIndexArrayPreallocated array destined to store face indices triplets
Returns:
True if face indices could be retrieved, false otherwise
OpenViBE::boolean getWorldBoundingBox ( Ogre::Real &  rMinX,
Ogre::Real &  rMinY,
Ogre::Real &  rMinZ,
Ogre::Real &  rMaxX,
Ogre::Real &  rMaxY,
Ogre::Real &  rMaxZ 
)

Get world bounding box of an object.

Parameters:
rMinXX lower bound
rMinYY lower bound
rMinZZ lower bound
rMaxXX upper bound
rMaxYY upper bound
rMaxZZ upper bound
Returns:
True if bounding box could be retrieved, false otherwise