Scene Class Reference

Representation of an entire scene graph. More...

#include <rendering/rendering.hh>

Inherits enable_shared_from_this< Scene >.

Public Types

enum  SkyXMode { GZ_SKYX_ALL = 0x0FFFFFFF, GZ_SKYX_CLOUDS = 0x0000001, GZ_SKYX_MOON = 0x0000002, GZ_SKYX_NONE = 0 }
 

Public Member Functions

 Scene (const std::string &_name, const bool _enableVisualizations=false, const bool _isServer=false)
 Constructor. More...
 
virtual ~Scene ()
 Destructor. More...
 
void AddLight (LightPtr _light)
 Add a light to the scene. More...
 
void AddVisual (VisualPtr _vis)
 Add a visual to the scene. More...
 
common::Color AmbientColor () const
 Get the ambient color. More...
 
common::Color BackgroundColor () const
 Get the background color. More...
 
uint32_t CameraCount () const
 Get the number of cameras in this scene. More...
 
void Clear ()
 Clear rendering::Scene. More...
 
CameraPtr CreateCamera (const std::string &_name, const bool _autoRender=true)
 Create a camera. More...
 
DepthCameraPtr CreateDepthCamera (const std::string &_name, const bool _autoRender=true)
 Create depth camera. More...
 
GpuLaserPtr CreateGpuLaser (const std::string &_name, const bool _autoRender=true)
 Create laser that generates data from rendering. More...
 
void CreateGrid (const uint32_t _cellCount, const float _cellLength, const float _lineWidth, const common::Color &_color)
 Create a square grid of cells. More...
 
UserCameraPtr CreateUserCamera (const std::string &_name, const bool _stereoEnabled=false)
 Create a user camera. More...
 
WideAngleCameraPtr CreateWideAngleCamera (const std::string &_name, const bool _autoRender=true)
 Create a wide-angle camera. More...
 
void DrawLine (const math::Vector3 &_start, const math::Vector3 &_end, const std::string &_name) GAZEBO_DEPRECATED(7.0)
 Draw a named line. More...
 
void DrawLine (const ignition::math::Vector3d &_start, const ignition::math::Vector3d &_end, const std::string &_name)
 Draw a named line. More...
 
bool FirstContact (CameraPtr _camera, const ignition::math::Vector2i &_mousePos, ignition::math::Vector3d &_position)
 Get the world pos of a the first contact at a pixel location. More...
 
common::Color GetAmbientColor () const GAZEBO_DEPRECATED(7.0)
 Get the ambient color. More...
 
common::Color GetBackgroundColor () const GAZEBO_DEPRECATED(7.0)
 Get the background color. More...
 
CameraPtr GetCamera (const uint32_t _index) const
 Get a camera based on an index. More...
 
CameraPtr GetCamera (const std::string &_name) const
 Get a camera by name. More...
 
uint32_t GetCameraCount () const GAZEBO_DEPRECATED(7.0)
 Get the number of cameras in this scene. More...
 
bool GetFirstContact (CameraPtr _camera, const math::Vector2i &_mousePos, math::Vector3 &_position) GAZEBO_DEPRECATED(7.0)
 Get the world pos of a the first contact at a pixel location. More...
 
GridGetGrid (uint32_t _index) const
 Get a grid based on an index. More...
 
uint32_t GetGridCount () const GAZEBO_DEPRECATED(7.0)
 Get the number of grids. More...
 
double GetHeightBelowPoint (const math::Vector3 &_pt) GAZEBO_DEPRECATED(7.0)
 Get the Z-value of the first object below the given point. More...
 
HeightmapGetHeightmap () const
 Get a pointer to the heightmap. More...
 
uint32_t GetId () const GAZEBO_DEPRECATED(7.0)
 Get the scene ID. More...
 
std::string GetIdString () const GAZEBO_DEPRECATED(7.0)
 Get the scene Id as a string. More...
 
bool GetInitialized () const GAZEBO_DEPRECATED(7.0)
 Return true if the Scene has been initialized. More...
 
LightPtr GetLight (const std::string &_name) const
 Get a light by name. More...
 
LightPtr GetLight (const uint32_t _index) const
 Get a light based on an index. More...
 
uint32_t GetLightCount () const GAZEBO_DEPRECATED(7.0)
 Get the count of the lights. More...
 
Ogre::SceneManager * GetManager () const GAZEBO_DEPRECATED(7.0)
 Get the OGRE scene manager. More...
 
VisualPtr GetModelVisualAt (CameraPtr _camera, const math::Vector2i &_mousePos) GAZEBO_DEPRECATED(7.0)
 Get a model's visual at a mouse position. More...
 
std::string GetName () const GAZEBO_DEPRECATED(7.0)
 Get the name of the scene. More...
 
VisualPtr GetSelectedVisual () const GAZEBO_DEPRECATED(7.0)
 Get the currently selected visual. More...
 
bool GetShadowsEnabled () const GAZEBO_DEPRECATED(7.0)
 Get whether shadows are on or off. More...
 
bool GetShowClouds () const GAZEBO_DEPRECATED(7.0)
 Get whether or not clouds are displayed. More...
 
common::Time GetSimTime () const GAZEBO_DEPRECATED(7.0)
 Get the scene simulation time. More...
 
SkyX::SkyX * GetSkyX () const
 Get the sky in the scene. More...
 
UserCameraPtr GetUserCamera (const uint32_t _index) const
 Get a user camera by index. More...
 
uint32_t GetUserCameraCount () const GAZEBO_DEPRECATED(7.0)
 Get the number of user cameras in this scene. More...
 
VisualPtr GetVisual (const std::string &_name) const
 Get a visual by name. More...
 
VisualPtr GetVisual (const uint32_t _id) const
 Get a visual by id. More...
 
VisualPtr GetVisualAt (CameraPtr _camera, const math::Vector2i &_mousePos, std::string &_mod) GAZEBO_DEPRECATED(7.0)
 Get an entity at a pixel location using a camera. More...
 
VisualPtr GetVisualAt (CameraPtr _camera, const math::Vector2i &_mousePos) GAZEBO_DEPRECATED(7.0)
 Get a visual at a mouse position. More...
 
VisualPtr GetVisualBelow (const std::string &_visualName) GAZEBO_DEPRECATED(7.0)
 Get the closest visual below a given visual. More...
 
uint32_t GetVisualCount () const GAZEBO_DEPRECATED(7.0)
 Get the number of visuals. More...
 
void GetVisualsBelowPoint (const math::Vector3 &_pt, std::vector< VisualPtr > &_visuals) GAZEBO_DEPRECATED(7.0)
 Get a visual directly below a point. More...
 
VisualPtr GetWorldVisual () const GAZEBO_DEPRECATED(7.0)
 Get the top level world visual. More...
 
uint32_t GridCount () const
 Get the number of grids. More...
 
double HeightBelowPoint (const ignition::math::Vector3d &_pt)
 Get the Z-value of the first object below the given point. More...
 
uint32_t Id () const
 Get the scene ID. More...
 
std::string IdString () const
 Get the scene Id as a string. More...
 
void Init ()
 Init rendering::Scene. More...
 
bool Initialized () const
 Return true if the Scene has been initialized. More...
 
uint32_t LightCount () const
 Get the count of the lights. More...
 
void Load (sdf::ElementPtr _scene)
 Load the scene from a set of parameters. More...
 
void Load ()
 Load the scene with default parameters. More...
 
VisualPtr ModelVisualAt (CameraPtr _camera, const ignition::math::Vector2i &_mousePos)
 Get a model's visual at a mouse position. More...
 
std::string Name () const
 Get the name of the scene. More...
 
Ogre::SceneManager * OgreSceneManager () const
 Get the OGRE scene manager. More...
 
void PreRender ()
 Process all received messages. More...
 
void PrintSceneGraph ()
 Print the scene graph to std_out. More...
 
void RemoveCamera (const std::string &_name)
 Remove a camera from the scene. More...
 
void RemoveLight (LightPtr _light)
 Remove a light to the scene. More...
 
void RemoveProjectors ()
 Remove all projectors. More...
 
void RemoveVisual (VisualPtr _vis)
 Remove a visual from the scene. More...
 
void RemoveVisual (const uint32_t _id)
 Remove a visual from the scene. More...
 
VisualPtr SelectedVisual () const
 Get the currently selected visual. More...
 
void SelectVisual (const std::string &_name, const std::string &_mode)
 Select a visual by name. More...
 
void SetAmbientColor (const common::Color &_color)
 Set the ambient color. More...
 
void SetBackgroundColor (const common::Color &_color)
 Set the background color. More...
 
void SetFog (const std::string &_type, const common::Color &_color, const double _density, const double _start, const double _end)
 Set the fog parameters. More...
 
void SetGrid (const bool _enabled)
 Set the grid on or off. More...
 
void SetShadowsEnabled (const bool _value)
 Set whether shadows are on or off. More...
 
void SetSkyXMode (const unsigned int _mode)
 Set SkyX mode to enable/disable skyx components such as clouds and moon. More...
 
void SetTransparent (const bool _show)
 Enable or disable transparency for all visuals. More...
 
void SetVisible (const std::string &_name, const bool _visible)
 Hide or show a visual. More...
 
void SetVisualId (VisualPtr _vis, const uint32_t _id)
 
void SetWireframe (const bool _show)
 Enable or disable wireframe for all visuals. More...
 
bool ShadowsEnabled () const
 Get whether shadows are on or off. More...
 
void ShowClouds (const bool _show)
 Display clouds in the sky. More...
 
bool ShowClouds () const
 Get whether or not clouds are displayed. More...
 
void ShowCollisions (const bool _show)
 Enable or disable collision visualization. More...
 
void ShowCOMs (const bool _show)
 Enable or disable center of mass visualization. More...
 
void ShowContacts (const bool _show)
 Enable or disable contact visualization. More...
 
void ShowInertias (const bool _show)
 Enable or disable inertia visualization. More...
 
void ShowJoints (const bool _show)
 Enable or disable joint visualization. More...
 
void ShowLinkFrames (const bool _show)
 Enable or disable link frame visualization. More...
 
void ShowOrigin (const bool _show)
 Show/hide the world origin indicator. More...
 
void ShowSkeleton (const bool _show)
 Enable or disable skeleton visualization. More...
 
common::Time SimTime () const
 Get the scene simulation time. More...
 
void SnapVisualToNearestBelow (const std::string &_visualName)
 Move the visual to be ontop of the nearest visual below it. More...
 
std::string StripSceneName (const std::string &_name) const
 Remove the name of scene from a string. More...
 
void ToggleLayer (const int32_t _layer)
 Toggle layer visilibility. More...
 
uint32_t UserCameraCount () const
 Get the number of user cameras in this scene. More...
 
VisualPtr VisualAt (CameraPtr _camera, const ignition::math::Vector2i &_mousePos, std::string &_mod)
 Get an entity at a pixel location using a camera. More...
 
VisualPtr VisualAt (CameraPtr _camera, const ignition::math::Vector2i &_mousePos)
 Get a visual at a mouse position. More...
 
VisualPtr VisualBelow (const std::string &_visualName)
 Get the closest visual below a given visual. More...
 
uint32_t VisualCount () const
 Get the number of visuals. More...
 
void VisualsBelowPoint (const ignition::math::Vector3d &_pt, std::vector< VisualPtr > &_visuals)
 Get a visual directly below a point. More...
 
VisualPtr WorldVisual () const
 Get the top level world visual. More...
 

Detailed Description

Representation of an entire scene graph.

Maintains all the Visuals, Lights, and Cameras for a World.

Member Enumeration Documentation

enum SkyXMode
Enumerator
GZ_SKYX_ALL 
GZ_SKYX_CLOUDS 
GZ_SKYX_MOON 
GZ_SKYX_NONE 

Constructor & Destructor Documentation

Scene ( const std::string &  _name,
const bool  _enableVisualizations = false,
const bool  _isServer = false 
)

Constructor.

Parameters
[in]_nameName of the scene.
[in]_enableVisualizationsTrue to enable visualizations, this should be set to true for user interfaces, and false for sensor generation.
virtual ~Scene ( )
virtual

Destructor.

Member Function Documentation

void AddLight ( LightPtr  _light)

Add a light to the scene.

Parameters
[in]_lightLight to add.
void AddVisual ( VisualPtr  _vis)

Add a visual to the scene.

Parameters
[in]_visVisual to add.
common::Color AmbientColor ( ) const

Get the ambient color.

Returns
The scene's ambient color.
common::Color BackgroundColor ( ) const

Get the background color.

Returns
The background color.
uint32_t CameraCount ( ) const

Get the number of cameras in this scene.

Returns
Number of cameras.
void Clear ( )
CameraPtr CreateCamera ( const std::string &  _name,
const bool  _autoRender = true 
)

Create a camera.

Parameters
[in]_nameName of the new camera.
[in]_autoRenderTrue to allow Gazebo to automatically render the camera. This should almost always be true.
Returns
Pointer to the new camera.
DepthCameraPtr CreateDepthCamera ( const std::string &  _name,
const bool  _autoRender = true 
)

Create depth camera.

Parameters
[in]_nameName of the new camera.
[in]_autoRenderTrue to allow Gazebo to automatically render the camera. This should almost always be true.
Returns
Pointer to the new camera.
GpuLaserPtr CreateGpuLaser ( const std::string &  _name,
const bool  _autoRender = true 
)

Create laser that generates data from rendering.

Parameters
[in]_nameName of the new laser.
[in]_autoRenderTrue to allow Gazebo to automatically render the camera. This should almost always be true.
Returns
Pointer to the new laser.
void CreateGrid ( const uint32_t  _cellCount,
const float  _cellLength,
const float  _lineWidth,
const common::Color _color 
)

Create a square grid of cells.

Parameters
[in]_cellCountNumber of grid cells in one direction.
[in]_cellLengthLength of one grid cell.
[in]_lineWidthWidth of the grid lines.
[in]_colorColor of the grid lines.
UserCameraPtr CreateUserCamera ( const std::string &  _name,
const bool  _stereoEnabled = false 
)

Create a user camera.

A user camera is one design for use with a GUI.

Parameters
[in]_nameName of the UserCamera.
[in]_stereoEnabledTrue to enable stereo rendering. This is here for compatibility with 3D monitors/TVs.
Returns
A pointer to the new UserCamera.
WideAngleCameraPtr CreateWideAngleCamera ( const std::string &  _name,
const bool  _autoRender = true 
)

Create a wide-angle camera.

Parameters
[in]_nameName of the new camera.
[in]_autoRenderTrue to allow Gazebo to automatically render the camera. This should almost always be true.
Returns
Pointer to the new camera.
void DrawLine ( const math::Vector3 _start,
const math::Vector3 _end,
const std::string &  _name 
)

Draw a named line.

Parameters
[in]_startStart position of the line.
[in]_endEnd position of the line.
[in]_nameName of the line.
Deprecated:
See function that accepts ignition::math parameters.
void DrawLine ( const ignition::math::Vector3d &  _start,
const ignition::math::Vector3d &  _end,
const std::string &  _name 
)

Draw a named line.

Parameters
[in]_startStart position of the line.
[in]_endEnd position of the line.
[in]_nameName of the line.
bool FirstContact ( CameraPtr  _camera,
const ignition::math::Vector2i &  _mousePos,
ignition::math::Vector3d &  _position 
)

Get the world pos of a the first contact at a pixel location.

Parameters
[in]_cameraPointer to the camera.
[in]_mousePos2D position of the mouse in pixels.
[out]_position3D position of the first contact point.
Returns
True if a valid object was hit by the raycast.
common::Color GetAmbientColor ( ) const

Get the ambient color.

Returns
The scene's ambient color.
Deprecated:
See AmbientColor()
common::Color GetBackgroundColor ( ) const

Get the background color.

Returns
The background color.
Deprecated:
See BackgroundColor()
CameraPtr GetCamera ( const uint32_t  _index) const

Get a camera based on an index.

Index must be between 0 and Scene::GetCameraCount.

Parameters
[in]_indexIndex of the camera to get.
Returns
Pointer to the camera. Or NULL if the index is invalid.
CameraPtr GetCamera ( const std::string &  _name) const

Get a camera by name.

Parameters
[in]_nameName of the camera.
Returns
Pointer to the camera. Or NULL if the name is invalid.
uint32_t GetCameraCount ( ) const

Get the number of cameras in this scene.

Returns
Number of cameras.
Deprecated:
See CameraCount()
bool GetFirstContact ( CameraPtr  _camera,
const math::Vector2i _mousePos,
math::Vector3 _position 
)

Get the world pos of a the first contact at a pixel location.

Parameters
[in]_cameraPointer to the camera.
[in]_mousePos2D position of the mouse in pixels.
[out]_position3D position of the first contact point.
Returns
True if a valid object was hit by the raycast.
Deprecated:
See FirstContact()
Grid* GetGrid ( uint32_t  _index) const

Get a grid based on an index.

Index must be between 0 and Scene::GetGridCount.

Parameters
[in]_indexIndex of the grid.
uint32_t GetGridCount ( ) const

Get the number of grids.

Returns
The number of grids.
Deprecated:
See GridCount()
double GetHeightBelowPoint ( const math::Vector3 _pt)

Get the Z-value of the first object below the given point.

Parameters
[in]_ptPosition to search below for a visual.
Returns
The Z-value of the nearest visual below the point. Zero is returned if no visual is found.
Deprecated:
See HeightBelowPoint()
Heightmap* GetHeightmap ( ) const

Get a pointer to the heightmap.

Returns
Pointer to the heightmap, NULL if no heightmap.
uint32_t GetId ( ) const

Get the scene ID.

Returns
The ID of the scene.
Deprecated:
See Id()
std::string GetIdString ( ) const

Get the scene Id as a string.

Returns
The ID as a string.
Deprecated:
See IdString()
bool GetInitialized ( ) const

Return true if the Scene has been initialized.

Returns
True if the scene has been initialized.
Deprecated:
See Initialized()
LightPtr GetLight ( const std::string &  _name) const

Get a light by name.

Parameters
[in]_nameName of the light to get.
Returns
Pointer to the light, or NULL if the light was not found.
LightPtr GetLight ( const uint32_t  _index) const

Get a light based on an index.

The index must be between 0 and Scene::GetLightCount.

Parameters
[in]_indexIndex of the light.
Returns
Pointer to the Light or NULL if index was invalid.
uint32_t GetLightCount ( ) const

Get the count of the lights.

Returns
The number of lights.
Deprecated:
See LightCount()
Ogre::SceneManager* GetManager ( ) const

Get the OGRE scene manager.

Returns
Pointer to the Ogre SceneManager.
Deprecated:
See OgreSceneManager()
VisualPtr GetModelVisualAt ( CameraPtr  _camera,
const math::Vector2i _mousePos 
)

Get a model's visual at a mouse position.

Parameters
[in]_cameraPointer to the camera used to project the mouse position.
[in]_mousePosThe 2d position of the mouse in pixels.
Returns
Pointer to the visual, NULL if none found.
Deprecated:
See ModelVisualAt()
std::string GetName ( ) const

Get the name of the scene.

Returns
Name of the scene.
Deprecated:
See Name()
VisualPtr GetSelectedVisual ( ) const

Get the currently selected visual.

Returns
Pointer to the currently selected visual, or NULL if nothing is selected.
Deprecated:
See SelectedVisual()
bool GetShadowsEnabled ( ) const

Get whether shadows are on or off.

Returns
True if shadows are enabled.
Deprecated:
See ShadowsEnabled()
bool GetShowClouds ( ) const

Get whether or not clouds are displayed.

Returns
True if clouds are displayed.
Deprecated:
See ShowClouds()
common::Time GetSimTime ( ) const

Get the scene simulation time.

Note this is different from World::GetSimTime() because there is a lag between the time new poses are sent out by World and when they are received and applied by the Scene.

Returns
The current simulation time in Scene
Deprecated:
See SimTime()
SkyX::SkyX* GetSkyX ( ) const

Get the sky in the scene.

Returns
Pointer to the sky.
UserCameraPtr GetUserCamera ( const uint32_t  _index) const

Get a user camera by index.

The index value must be between 0 and Scene::GetUserCameraCount.

Parameters
[in]_indexIndex of the UserCamera to get.
Returns
Pointer to the UserCamera, or NULL if the index was invalid.
uint32_t GetUserCameraCount ( ) const

Get the number of user cameras in this scene.

Returns
The number of user cameras.
Deprecated:
See UserCameraCount()
VisualPtr GetVisual ( const std::string &  _name) const

Get a visual by name.

Parameters
[in]_nameName of the visual to retrieve.
Returns
Pointer to the visual, NULL if not found.
VisualPtr GetVisual ( const uint32_t  _id) const

Get a visual by id.

Parameters
[in]_idID of the visual to retrieve.
Returns
Pointer to the visual, NULL if not found.
VisualPtr GetVisualAt ( CameraPtr  _camera,
const math::Vector2i _mousePos,
std::string &  _mod 
)

Get an entity at a pixel location using a camera.

Used for mouse picking.

Parameters
[in]_cameraThe ogre camera, used to do mouse picking
[in]_mousePosThe position of the mouse in screen coordinates
[out]_modUsed for object manipulation
Returns
The selected entity, or NULL
Deprecated:
See VisualAt()
VisualPtr GetVisualAt ( CameraPtr  _camera,
const math::Vector2i _mousePos 
)

Get a visual at a mouse position.

Parameters
[in]_cameraPointer to the camera used to project the mouse position.
[in]_mousePosThe 2d position of the mouse in pixels.
Returns
Pointer to the visual, NULL if none found.
Deprecated:
See VisualAt()
VisualPtr GetVisualBelow ( const std::string &  _visualName)

Get the closest visual below a given visual.

Parameters
[in]_visualNameName of the visual to search below.
Returns
Pointer to the visual below, or NULL if no visual.
Deprecated:
See VisualBelow()
uint32_t GetVisualCount ( ) const

Get the number of visuals.

Returns
The number of visuals in the Scene.
Deprecated:
See VisualCount()
void GetVisualsBelowPoint ( const math::Vector3 _pt,
std::vector< VisualPtr > &  _visuals 
)

Get a visual directly below a point.

Parameters
[in]_pt3D point to get the visual below.
[out]_visualsThe visuals below the point order in proximity.
Deprecated:
See VisualsBelowPoint()
VisualPtr GetWorldVisual ( ) const

Get the top level world visual.

Returns
Pointer to the world visual.
Deprecated:
See WorldVisual()
uint32_t GridCount ( ) const

Get the number of grids.

Returns
The number of grids.
double HeightBelowPoint ( const ignition::math::Vector3d &  _pt)

Get the Z-value of the first object below the given point.

Parameters
[in]_ptPosition to search below for a visual.
Returns
The Z-value of the nearest visual below the point. Zero is returned if no visual is found.
uint32_t Id ( ) const

Get the scene ID.

Returns
The ID of the scene.
std::string IdString ( ) const

Get the scene Id as a string.

Returns
The ID as a string.
void Init ( )
bool Initialized ( ) const

Return true if the Scene has been initialized.

Returns
True if the scene has been initialized.
uint32_t LightCount ( ) const

Get the count of the lights.

Returns
The number of lights.
void Load ( sdf::ElementPtr  _scene)

Load the scene from a set of parameters.

Parameters
[in]_sceneSDF scene element to load.
void Load ( )

Load the scene with default parameters.

VisualPtr ModelVisualAt ( CameraPtr  _camera,
const ignition::math::Vector2i &  _mousePos 
)

Get a model's visual at a mouse position.

Parameters
[in]_cameraPointer to the camera used to project the mouse position.
[in]_mousePosThe 2d position of the mouse in pixels.
Returns
Pointer to the visual, NULL if none found.
std::string Name ( ) const

Get the name of the scene.

Returns
Name of the scene.
Ogre::SceneManager* OgreSceneManager ( ) const

Get the OGRE scene manager.

Returns
Pointer to the Ogre SceneManager.
void PreRender ( )

Process all received messages.

void PrintSceneGraph ( )

Print the scene graph to std_out.

void RemoveCamera ( const std::string &  _name)

Remove a camera from the scene.

Parameters
[in]_nameName of the camera.
void RemoveLight ( LightPtr  _light)

Remove a light to the scene.

Parameters
[in]_lightLight to Remove.
void RemoveProjectors ( )

Remove all projectors.

void RemoveVisual ( VisualPtr  _vis)

Remove a visual from the scene.

Parameters
[in]_visVisual to remove.
void RemoveVisual ( const uint32_t  _id)

Remove a visual from the scene.

Parameters
[in]_idId of the visual to remove.
VisualPtr SelectedVisual ( ) const

Get the currently selected visual.

Returns
Pointer to the currently selected visual, or NULL if nothing is selected.
void SelectVisual ( const std::string &  _name,
const std::string &  _mode 
)

Select a visual by name.

Parameters
[in]_nameName of the visual to select.
[in]_modeSelection mode (normal, or move).
void SetAmbientColor ( const common::Color _color)

Set the ambient color.

Parameters
[in]_colorThe ambient color to use.
void SetBackgroundColor ( const common::Color _color)

Set the background color.

Parameters
[in]_colorThe background color.
void SetFog ( const std::string &  _type,
const common::Color _color,
const double  _density,
const double  _start,
const double  _end 
)

Set the fog parameters.

Parameters
[in]_typeType of fog: "linear", "exp", or "exp2".
[in]_colorColor of the fog.
[in]_densityFog density.
[in]_startDistance from camera to start the fog.
[in]_endDistance from camera at which the fog is at max density.
void SetGrid ( const bool  _enabled)

Set the grid on or off.

Parameters
[in]_enabledSet to true to turn on the grid
void SetShadowsEnabled ( const bool  _value)

Set whether shadows are on or off.

Parameters
[in]_valueTrue to enable shadows, False to disable
void SetSkyXMode ( const unsigned int  _mode)

Set SkyX mode to enable/disable skyx components such as clouds and moon.

Parameters
[in]_modeSkyX mode bitmask.
See Also
Scene::SkyXMode
void SetTransparent ( const bool  _show)

Enable or disable transparency for all visuals.

Parameters
[in]_showTrue to enable transparency for all visuals.
void SetVisible ( const std::string &  _name,
const bool  _visible 
)

Hide or show a visual.

Parameters
[in]_nameName of the visual to change.
[in]_visibleTrue to make visual visible, False to make it invisible.
void SetVisualId ( VisualPtr  _vis,
const uint32_t  _id 
)
void SetWireframe ( const bool  _show)

Enable or disable wireframe for all visuals.

Parameters
[in]_showTrue to enable wireframe for all visuals.
bool ShadowsEnabled ( ) const

Get whether shadows are on or off.

Returns
True if shadows are enabled.
void ShowClouds ( const bool  _show)

Display clouds in the sky.

Parameters
[in]_showTrue to display clouds.
bool ShowClouds ( ) const

Get whether or not clouds are displayed.

Returns
True if clouds are displayed.
void ShowCollisions ( const bool  _show)

Enable or disable collision visualization.

Parameters
[in]_showTrue to enable collision visualization.
void ShowCOMs ( const bool  _show)

Enable or disable center of mass visualization.

Parameters
[in]_showTrue to enable center of mass visualization.
void ShowContacts ( const bool  _show)

Enable or disable contact visualization.

Parameters
[in]_showTrue to enable contact visualization.
void ShowInertias ( const bool  _show)

Enable or disable inertia visualization.

Parameters
[in]_showTrue to enable inertia visualization.
void ShowJoints ( const bool  _show)

Enable or disable joint visualization.

Parameters
[in]_showTrue to enable joint visualization.
void ShowLinkFrames ( const bool  _show)

Enable or disable link frame visualization.

Parameters
[in]_showTrue to enable link frame visualization.
void ShowOrigin ( const bool  _show)

Show/hide the world origin indicator.

Parameters
[in]_showTrue to show the origin.
void ShowSkeleton ( const bool  _show)

Enable or disable skeleton visualization.

Parameters
[in]_showTrue to enable skeleton visualization.
common::Time SimTime ( ) const

Get the scene simulation time.

Note this is different from World::GetSimTime() because there is a lag between the time new poses are sent out by World and when they are received and applied by the Scene.

Returns
The current simulation time in Scene
void SnapVisualToNearestBelow ( const std::string &  _visualName)

Move the visual to be ontop of the nearest visual below it.

Parameters
[in]_visualNameName of the visual to move.
std::string StripSceneName ( const std::string &  _name) const

Remove the name of scene from a string.

Parameters
[in]_nameName to string the scene name from.
Returns
The stripped name.
void ToggleLayer ( const int32_t  _layer)

Toggle layer visilibility.

This will process all visuals. If a visual is on the specified layer its visiblity will be toggled. Visuals with a negative layer index are always visible.

Parameters
[in]_layerIndex of the layer to toggle.
uint32_t UserCameraCount ( ) const

Get the number of user cameras in this scene.

Returns
The number of user cameras.
VisualPtr VisualAt ( CameraPtr  _camera,
const ignition::math::Vector2i &  _mousePos,
std::string &  _mod 
)

Get an entity at a pixel location using a camera.

Used for mouse picking.

Parameters
[in]_cameraThe ogre camera, used to do mouse picking
[in]_mousePosThe position of the mouse in screen coordinates
[out]_modUsed for object manipulation
Returns
The selected entity, or NULL
VisualPtr VisualAt ( CameraPtr  _camera,
const ignition::math::Vector2i &  _mousePos 
)

Get a visual at a mouse position.

Parameters
[in]_cameraPointer to the camera used to project the mouse position.
[in]_mousePosThe 2d position of the mouse in pixels.
Returns
Pointer to the visual, NULL if none found.
VisualPtr VisualBelow ( const std::string &  _visualName)

Get the closest visual below a given visual.

Parameters
[in]_visualNameName of the visual to search below.
Returns
Pointer to the visual below, or NULL if no visual.
uint32_t VisualCount ( ) const

Get the number of visuals.

Returns
The number of visuals in the Scene.
void VisualsBelowPoint ( const ignition::math::Vector3d &  _pt,
std::vector< VisualPtr > &  _visuals 
)

Get a visual directly below a point.

Parameters
[in]_pt3D point to get the visual below.
[out]_visualsThe visuals below the point order in proximity.
VisualPtr WorldVisual ( ) const

Get the top level world visual.

Returns
Pointer to the world visual.

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