##

Scene Class Reference
Rendering

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...
ignition::math::Color | AmbientColor () const
| Get the ambient color. More...
ignition::math::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) GAZEBO_DEPRECATED(9.0)
| Create a square grid of cells. More...
void | CreateGrid (const uint32_t _cellCount, const float _cellLength, const ignition::math::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 ignition::math::Vector3d &_start, const ignition::math::Vector3d &_end, const std::string &_name)
| Draw a named line. More...
bool | EnableVisualizations () const
| Check whether visualizations are enabled or not. More...
void | EnableVisualizations (const bool _enable)
| Enable visualizations, currently only applies to sensor visuals. 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...
CameraPtr | GetCamera (const std::string &_name) const
| Get a camera by name. More...
CameraPtr | GetCamera (const uint32_t _index) const
| Get a camera based on an index. More...
Grid * | GetGrid (uint32_t _index) const
| Get a grid based on an index. More...
Heightmap * | GetHeightmap () const
| Get a pointer to the heightmap. More...
LightPtr | GetLight (const std::string &_name) const GAZEBO_DEPRECATED(9.1)
| Get a light by name. More...
LightPtr | GetLight (const uint32_t _index) const GAZEBO_DEPRECATED(9.1)
| Get a light based on an index. 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...
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...
uint32_t | GridCount () const
| Get the number of grids. More...
bool | HasLayer (const int32_t _layer) const
| Return true if the layer exits. More...
double | HeightBelowPoint (const ignition::math::Vector3d &_pt)
| Get the Z-value of the first object below the given point. More...
unsigned int | HeightmapLOD () const
| Get the Level Of Detail (LOD) value for the heightmap. More...
double | HeightmapSkirtLength () const
| Get the skirt length value for the heightmap LOD tiles. 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...
bool | LayerState (const int32_t _layer) const
| Return whether a layer is on or off. More...
LightPtr | LightById (const uint32_t _id) const
| Get a light by id. More...
LightPtr | LightByIndex (const uint32_t _index) const
| Get a light based on an index. More...
LightPtr | LightByName (const std::string &_name) const
| Get a light by name. More...
uint32_t | LightCount () const
| Get the count of the lights. More...
void | Load ()
| Load the scene with default parameters. More...
void | Load (sdf::ElementPtr _scene)
| Load the scene from a set of 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 (const uint32_t _id)
| Remove a visual from the scene. More...
void | RemoveVisual (VisualPtr _vis)
| 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) GAZEBO_DEPRECATED(9.0)
| Set the ambient color. More...
void | SetAmbientColor (const ignition::math::Color &_color)
| Set the ambient color. More...
void | SetBackgroundColor (const common::Color &_color) GAZEBO_DEPRECATED(9.0)
| Set the background color. More...
void | SetBackgroundColor (const ignition::math::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) GAZEBO_DEPRECATED(9.0)
| Set the fog parameters. More...
void | SetFog (const std::string &_type, const ignition::math::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 | SetHeightmapLOD (const unsigned int _value)
| Set the Level Of Detail (LOD) value for the heightmap. More...
void | SetHeightmapSkirtLength (const double _value)
| Set the skirt length value for the heightmap LOD tiles. More...
void | SetShadowsEnabled (const bool _value)
| Set whether shadows are on or off. More...
bool | SetShadowTextureSize (const unsigned int _size)
| Set the shadow texture size. 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...
unsigned int | ShadowTextureSize () const
| Get the shadow texture size. More...
bool | ShowClouds () const
| Get whether or not clouds are displayed. More...
void | ShowClouds (const bool _show)
| Display clouds in the sky. 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)
| Get a visual at a mouse position. 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 | 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...
bool | Wireframe () const
| Get whether wireframe is enabled for all visuals. More...
VisualPtr | WorldVisual () const
| Get the top level world visual. More...

## Detailed Description

Representation of an entire scene graph.

## Visualization Markers

Visualization markers are shapes and meshes that have no kinematic or dynamic properties. Their primary use is to visually augment the rendering scene.

See `gazebo/examples/stand_alone/marker` for an example program that manipulates visualization markers.

The `gz marker` command line tool can also be used to manipulate visualization markers. For more information use:

$ gz marker -h

### Visualization marker services

The following Ignition Transport services can be use to create, modify, delete, and list visualization markers.

1. /marker
   - Request message type: ign_msgs.Marker
   - Response mssage type: ign_msgs.StringMsg
   - Purpose: Add, modify, or delete a visualization marker.

1. /marker/list
   - Response mssage type: ign_msgs.Marker_V
   - Purpose: Get the list of markers.

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

## Member Enumeration Documentation

## SkyXMode

enum SkyXMode

Enumerator
GZ_SKYX_ALL |
GZ_SKYX_CLOUDS |
GZ_SKYX_MOON |
GZ_SKYX_NONE |

## Constructor & Destructor Documentation

## Scene()

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

Constructor.

Parameters

  [in] | _name | Name of the scene.
  [in] | _enableVisualizations | True to enable visualizations, this should be set to true for user interfaces, and false for sensor generation.

## ~Scene()

virtual ~Scene | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## AddLight()

void AddLight | ( | LightPtr | _light | ) |

Add a light to the scene.

Parameters

  [in] | _light | Light to add.

## AddVisual()

void AddVisual | ( | VisualPtr | _vis | ) |

Add a visual to the scene.

Parameters

  [in] | _vis | Visual to add.

## AmbientColor()

ignition::math::Color AmbientColor | ( |  | ) | const

Get the ambient color.

Returns
  The scene's ambient color.

## BackgroundColor()

ignition::math::Color BackgroundColor | ( |  | ) | const

Get the background color.

Returns
  The background color.

## CameraCount()

uint32_t CameraCount | ( |  | ) | const

Get the number of cameras in this scene.

Returns
  Number of cameras.

## Clear()

void Clear | ( |  | ) |

Clear rendering::Scene.

## CreateCamera()

CameraPtr CreateCamera | ( | const std::string & | _name,
|  | const bool | _autoRender = `true`
| ) |  |

Create a camera.

Parameters

  [in] | _name | Name of the new camera.
  [in] | _autoRender | True to allow Gazebo to automatically render the camera. This should almost always be true.

Returns
  Pointer to the new camera.

## CreateDepthCamera()

DepthCameraPtr CreateDepthCamera | ( | const std::string & | _name,
|  | const bool | _autoRender = `true`
| ) |  |

Create depth camera.

Parameters

  [in] | _name | Name of the new camera.
  [in] | _autoRender | True to allow Gazebo to automatically render the camera. This should almost always be true.

Returns
  Pointer to the new camera.

## CreateGpuLaser()

GpuLaserPtr CreateGpuLaser | ( | const std::string & | _name,
|  | const bool | _autoRender = `true`
| ) |  |

Create laser that generates data from rendering.

Parameters

  [in] | _name | Name of the new laser.
  [in] | _autoRender | True to allow Gazebo to automatically render the camera. This should almost always be true.

Returns
  Pointer to the new laser.

## CreateGrid() [1/2]

void CreateGrid | ( | const uint32_t | _cellCount,
|  | const float | _cellLength,
|  | const float | _lineWidth,
|  | const common::Color & | _color
| ) |  |

Create a square grid of cells.

Parameters

  [in] | _cellCount | Number of grid cells in one direction.
  [in] | _cellLength | Length of one grid cell.
  [in] | _lineWidth | Width of the grid lines.
  [in] | _color | Color of the grid lines.

Deprecated:
  Use function which accepts ignition::math::Color.

## CreateGrid() [2/2]

void CreateGrid | ( | const uint32_t | _cellCount,
|  | const float | _cellLength,
|  | const ignition::math::Color & | _color
| ) |  |

Create a square grid of cells.

Parameters

  [in] | _cellCount | Number of grid cells in one direction.
  [in] | _cellLength | Length of one grid cell.
  [in] | _color | Color of the grid lines.

## CreateUserCamera()

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] | _name | Name of the UserCamera.
  [in] | _stereoEnabled | True to enable stereo rendering. This is here for compatibility with 3D monitors/TVs.

Returns
  A pointer to the new UserCamera.

## CreateWideAngleCamera()

WideAngleCameraPtr CreateWideAngleCamera | ( | const std::string & | _name,
|  | const bool | _autoRender = `true`
| ) |  |

Create a wide-angle camera.

Parameters

  [in] | _name | Name of the new camera.
  [in] | _autoRender | True to allow Gazebo to automatically render the camera. This should almost always be true.

Returns
  Pointer to the new camera.

## DrawLine()

void DrawLine | ( | const ignition::math::Vector3d & | _start,
|  | const ignition::math::Vector3d & | _end,
|  | const std::string & | _name
| ) |  |

Draw a named line.

Parameters

  [in] | _start | Start position of the line.
  [in] | _end | End position of the line.
  [in] | _name | Name of the line.

## EnableVisualizations() [1/2]

bool EnableVisualizations | ( |  | ) | const

Check whether visualizations are enabled or not.

Returns
  True if enabled.

See also
  EnableVisualizations(bool)

## EnableVisualizations() [2/2]

void EnableVisualizations | ( | const bool | _enable | ) |

Enable visualizations, currently only applies to sensor visuals.

Parameters

  [in] | _enable | True to enable, false to disable.

See also
  EnableVisualizations()

## FirstContact()

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] | _camera | Pointer to the camera.
  [in] | _mousePos | 2D position of the mouse in pixels.
  [out] | _position | 3D position of the first contact point.

Returns
  True if a valid object was hit by the raycast.

## GetCamera() [1/2]

CameraPtr GetCamera | ( | const std::string & | _name | ) | const

Get a camera by name.

Parameters

  [in] | _name | Name of the camera.

Returns
  Pointer to the camera. Or NULL if the name is invalid.

## GetCamera() [2/2]

CameraPtr GetCamera | ( | const uint32_t | _index | ) | const

Get a camera based on an index.

Index must be between 0 and Scene::GetCameraCount.

Parameters

  [in] | _index | Index of the camera to get.

Returns
  Pointer to the camera. Or NULL if the index is invalid.

## GetGrid()

Grid* GetGrid | ( | uint32_t | _index | ) | const

Get a grid based on an index.

Index must be between 0 and Scene::GetGridCount.

Parameters

  [in] | _index | Index of the grid.

## GetHeightmap()

Heightmap* GetHeightmap | ( |  | ) | const

Get a pointer to the heightmap.

Returns
  Pointer to the heightmap, NULL if no heightmap.

## GetLight() [1/2]

LightPtr GetLight | ( | const std::string & | _name | ) | const

Get a light by name.

Parameters

  [in] | _name | Name of the light to get.

Returns
  Pointer to the light, or NULL if the light was not found.

Deprecated:
  See LightByName.

## GetLight() [2/2]

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] | _index | Index of the light.

Returns
  Pointer to the Light or NULL if index was invalid.

Deprecated:
  See LightByIndex

## GetSkyX()

SkyX::SkyX* GetSkyX | ( |  | ) | const

Get the sky in the scene.

Returns
  Pointer to the sky.

## GetUserCamera()

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] | _index | Index of the UserCamera to get.

Returns
  Pointer to the UserCamera, or NULL if the index was invalid.

## GetVisual() [1/2]

VisualPtr GetVisual | ( | const std::string & | _name | ) | const

Get a visual by name.

Parameters

  [in] | _name | Name of the visual to retrieve.

Returns
  Pointer to the visual, NULL if not found.

## GetVisual() [2/2]

VisualPtr GetVisual | ( | const uint32_t | _id | ) | const

Get a visual by id.

Parameters

  [in] | _id | ID of the visual to retrieve.

Returns
  Pointer to the visual, NULL if not found.

## GridCount()

uint32_t GridCount | ( |  | ) | const

Get the number of grids.

Returns
  The number of grids.

## HasLayer()

bool HasLayer | ( | const int32_t | _layer | ) | const

Return true if the layer exits.

Parameters

  [in] | _layer | Index of the layer to check for existance.

Returns
  True if the layer exists, otherwise false. All negative value of _layer return true.

## HeightBelowPoint()

double HeightBelowPoint | ( | const ignition::math::Vector3d & | _pt | ) |

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

Parameters

  [in] | _pt | Position 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.

## HeightmapLOD()

unsigned int HeightmapLOD | ( |  | ) | const

Get the Level Of Detail (LOD) value for the heightmap.

Returns
  A render-engine specific value that is used to compute LOD.

See also
  Heightmap::LOD

## HeightmapSkirtLength()

double HeightmapSkirtLength | ( |  | ) | const

Get the skirt length value for the heightmap LOD tiles.

Returns
  Length of skirts on LOD tiles

See also
  Heightmap::SkirtLength

## Id()

uint32_t Id | ( |  | ) | const

Get the scene ID.

Returns
  The ID of the scene.

## IdString()

std::string IdString | ( |  | ) | const

Get the scene Id as a string.

Returns
  The ID as a string.

## Init()

void Init | ( |  | ) |

Init rendering::Scene.

## Initialized()

bool Initialized | ( |  | ) | const

Return true if the Scene has been initialized.

Returns
  True if the scene has been initialized.

## LayerState()

bool LayerState | ( | const int32_t | _layer | ) | const

Return whether a layer is on or off.

A negative layer is always active.

Parameters

  [in] | _layer | Index of the layer to check.

Returns
  True if the layer is active, false otherwise. True is also returned if _layer is negative.

## LightById()

LightPtr LightById | ( | const uint32_t | _id | ) | const

Get a light by id.

Parameters

  [in] | _id | Unique light id.

Returns
  Pointer to the Light or NULL if not found.

## LightByIndex()

LightPtr LightByIndex | ( | const uint32_t | _index | ) | const

Get a light based on an index.

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

Parameters

  [in] | _index | Index of the light.

Returns
  Pointer to the Light or NULL if index was invalid.

## LightByName()

LightPtr LightByName | ( | const std::string & | _name | ) | const

Get a light by name.

Parameters

  [in] | _name | Name of the light to get.

Returns
  Pointer to the light, or NULL if the light was not found.

## LightCount()

uint32_t LightCount | ( |  | ) | const

Get the count of the lights.

Returns
  The number of lights.

## Load() [1/2]

void Load | ( |  | ) |

Load the scene with default parameters.

## Load() [2/2]

void Load | ( | sdf::ElementPtr | _scene | ) |

Load the scene from a set of parameters.

Parameters

  [in] | _scene | SDF scene element to load.

## ModelVisualAt()

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

Get a model's visual at a mouse position.

Parameters

  [in] | _camera | Pointer to the camera used to project the mouse position.
  [in] | _mousePos | The 2d position of the mouse in pixels.

Returns
  Pointer to the visual, NULL if none found.

## Name()

std::string Name | ( |  | ) | const

Get the name of the scene.

Returns
  Name of the scene.

## OgreSceneManager()

Ogre::SceneManager* OgreSceneManager | ( |  | ) | const

Get the OGRE scene manager.

Returns
  Pointer to the Ogre SceneManager.

## PreRender()

void PreRender | ( |  | ) |

Process all received messages.

## PrintSceneGraph()

void PrintSceneGraph | ( |  | ) |

Print the scene graph to std_out.

## RemoveCamera()

void RemoveCamera | ( | const std::string & | _name | ) |

Remove a camera from the scene.

Parameters

  [in] | _name | Name of the camera.

## RemoveLight()

void RemoveLight | ( | LightPtr | _light | ) |

Remove a light to the scene.

Parameters

  [in] | _light | Light to Remove.

## RemoveProjectors()

void RemoveProjectors | ( |  | ) |

Remove all projectors.

## RemoveVisual() [1/2]

void RemoveVisual | ( | const uint32_t | _id | ) |

Remove a visual from the scene.

Parameters

  [in] | _id | Id of the visual to remove.

## RemoveVisual() [2/2]

void RemoveVisual | ( | VisualPtr | _vis | ) |

Remove a visual from the scene.

Parameters

  [in] | _vis | Visual to remove.

## SelectedVisual()

VisualPtr SelectedVisual | ( |  | ) | const

Get the currently selected visual.

Returns
  Pointer to the currently selected visual, or NULL if nothing is selected.

## SelectVisual()

void SelectVisual | ( | const std::string & | _name,
|  | const std::string & | _mode
| ) |  |

Select a visual by name.

Parameters

  [in] | _name | Name of the visual to select.
  [in] | _mode | Selection mode (normal, or move).

## SetAmbientColor() [1/2]

void SetAmbientColor | ( | const common::Color & | _color | ) |

Set the ambient color.

Parameters

  [in] | _color | The ambient color to use.

Deprecated:
  Use function which accepts ignition::math::Color.

## SetAmbientColor() [2/2]

void SetAmbientColor | ( | const ignition::math::Color & | _color | ) |

Set the ambient color.

Parameters

  [in] | _color | The ambient color to use.

## SetBackgroundColor() [1/2]

void SetBackgroundColor | ( | const common::Color & | _color | ) |

Set the background color.

Parameters

  [in] | _color | The background color.

Deprecated:
  Use function which accepts ignition::math::Color.

## SetBackgroundColor() [2/2]

void SetBackgroundColor | ( | const ignition::math::Color & | _color | ) |

Set the background color.

Parameters

  [in] | _color | The background color.

## SetFog() [1/2]

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] | _type | Type of fog: "linear", "exp", or "exp2".
  [in] | _color | Color of the fog.
  [in] | _density | Fog density.
  [in] | _start | Distance from camera to start the fog.
  [in] | _end | Distance from camera at which the fog is at max density.

Deprecated:
  Use function which accepts ignition::math::Color.

## SetFog() [2/2]

void SetFog | ( | const std::string & | _type,
|  | const ignition::math::Color & | _color,
|  | const double | _density,
|  | const double | _start,
|  | const double | _end
| ) |  |

Set the fog parameters.

Parameters

  [in] | _type | Type of fog: "linear", "exp", or "exp2".
  [in] | _color | Color of the fog.
  [in] | _density | Fog density.
  [in] | _start | Distance from camera to start the fog.
  [in] | _end | Distance from camera at which the fog is at max density.

## SetGrid()

void SetGrid | ( | const bool | _enabled | ) |

Set the grid on or off.

Parameters

  [in] | _enabled | Set to true to turn on the grid

## SetHeightmapLOD()

void SetHeightmapLOD | ( | const unsigned int | _value | ) |

Set the Level Of Detail (LOD) value for the heightmap.

Parameters

  [in] | _value | A render-engine specific value used to compute LOD.

See also
  Heightmap::SetLOD

## SetHeightmapSkirtLength()

void SetHeightmapSkirtLength | ( | const double | _value | ) |

Set the skirt length value for the heightmap LOD tiles.

Parameters

  [in] | _value | Length of skirts on LOD tiles

See also
  Heightmap::SetSkirtLength

## SetShadowsEnabled()

void SetShadowsEnabled | ( | const bool | _value | ) |

Set whether shadows are on or off.

Parameters

  [in] | _value | True to enable shadows, False to disable

## SetShadowTextureSize()

bool SetShadowTextureSize | ( | const unsigned int | _size | ) |

Set the shadow texture size.

Parameters

  [in] | _size | Size to set the shadow texture to. This must be a power of 2. The default size is 1024.

Returns
  True if size is set successfully, false otherwise.

## SetSkyXMode()

void SetSkyXMode | ( | const unsigned int | _mode | ) |

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

Parameters

  [in] | _mode | SkyX mode bitmask.

See also
  Scene::SkyXMode

## SetTransparent()

void SetTransparent | ( | const bool | _show | ) |

Enable or disable transparency for all visuals.

Parameters

  [in] | _show | True to enable transparency for all visuals.

## SetVisible()

void SetVisible | ( | const std::string & | _name,
|  | const bool | _visible
| ) |  |

Hide or show a visual.

Parameters

  [in] | _name | Name of the visual to change.
  [in] | _visible | True to make visual visible, False to make it invisible.

## SetVisualId()

void SetVisualId | ( | VisualPtr | _vis,
|  | const uint32_t | _id
| ) |  |

## SetWireframe()

void SetWireframe | ( | const bool | _show | ) |

Enable or disable wireframe for all visuals.

Parameters

  [in] | _show | True to enable wireframe for all visuals.

## ShadowsEnabled()

bool ShadowsEnabled | ( |  | ) | const

Get whether shadows are on or off.

Returns
  True if shadows are enabled.

## ShadowTextureSize()

unsigned int ShadowTextureSize | ( |  | ) | const

Get the shadow texture size.

Returns
  Size of the shadow texture. The default size is 1024.

## ShowClouds() [1/2]

bool ShowClouds | ( |  | ) | const

Get whether or not clouds are displayed.

Returns
  True if clouds are displayed.

## ShowClouds() [2/2]

void ShowClouds | ( | const bool | _show | ) |

Display clouds in the sky.

Parameters

  [in] | _show | True to display clouds.

## ShowCollisions()

void ShowCollisions | ( | const bool | _show | ) |

Enable or disable collision visualization.

Parameters

  [in] | _show | True to enable collision visualization.

## ShowCOMs()

void ShowCOMs | ( | const bool | _show | ) |

Enable or disable center of mass visualization.

Parameters

  [in] | _show | True to enable center of mass visualization.

## ShowContacts()

void ShowContacts | ( | const bool | _show | ) |

Enable or disable contact visualization.

Parameters

  [in] | _show | True to enable contact visualization.

## ShowInertias()

void ShowInertias | ( | const bool | _show | ) |

Enable or disable inertia visualization.

Parameters

  [in] | _show | True to enable inertia visualization.

## ShowJoints()

void ShowJoints | ( | const bool | _show | ) |

Enable or disable joint visualization.

Parameters

  [in] | _show | True to enable joint visualization.

## ShowLinkFrames()

void ShowLinkFrames | ( | const bool | _show | ) |

Enable or disable link frame visualization.

Parameters

  [in] | _show | True to enable link frame visualization.

## ShowOrigin()

void ShowOrigin | ( | const bool | _show | ) |

Show/hide the world origin indicator.

Parameters

  [in] | _show | True to show the origin.

## ShowSkeleton()

void ShowSkeleton | ( | const bool | _show | ) |

Enable or disable skeleton visualization.

Parameters

  [in] | _show | True to enable skeleton visualization.

## SimTime()

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

## SnapVisualToNearestBelow()

void SnapVisualToNearestBelow | ( | const std::string & | _visualName | ) |

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

Parameters

  [in] | _visualName | Name of the visual to move.

## StripSceneName()

std::string StripSceneName | ( | const std::string & | _name | ) | const

Remove the name of scene from a string.

Parameters

  [in] | _name | Name to string the scene name from.

Returns
  The stripped name.

## ToggleLayer()

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] | _layer | Index of the layer to toggle.

## UserCameraCount()

uint32_t UserCameraCount | ( |  | ) | const

Get the number of user cameras in this scene.

Returns
  The number of user cameras.

## VisualAt() [1/2]

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

Get a visual at a mouse position.

Parameters

  [in] | _camera | Pointer to the camera used to project the mouse position.
  [in] | _mousePos | The 2d position of the mouse in pixels.

Returns
  Pointer to the visual, NULL if none found.

## VisualAt() [2/2]

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] | _camera | The ogre camera, used to do mouse picking
  [in] | _mousePos | The position of the mouse in screen coordinates
  [out] | _mod | Used for object manipulation

Returns
  The selected entity, or NULL

## VisualBelow()

VisualPtr VisualBelow | ( | const std::string & | _visualName | ) |

Get the closest visual below a given visual.

Parameters

  [in] | _visualName | Name of the visual to search below.

Returns
  Pointer to the visual below, or NULL if no visual.

## VisualCount()

uint32_t VisualCount | ( |  | ) | const

Get the number of visuals.

Returns
  The number of visuals in the Scene.

## VisualsBelowPoint()

void VisualsBelowPoint | ( | const ignition::math::Vector3d & | _pt,
|  | std::vector< VisualPtr > & | _visuals
| ) |  |

Get a visual directly below a point.

Parameters

  [in] | _pt | 3D point to get the visual below.
  [out] | _visuals | The visuals below the point order in proximity.

## Wireframe()

bool Wireframe | ( |  | ) | const

Get whether wireframe is enabled for all visuals.

Returns
  True if wireframe is enabled for all visuals.

## WorldVisual()

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:

- Scene.hh