Description
Scene class used for camera renderings. Includes environment colors, lights, etc.
#include <ChScene.h>
Public Member Functions | |
| ChScene () | |
| Class constructor. | |
| ~ChScene () | |
| Class destructor. | |
| unsigned int | AddPointLight (ChVector3f pos, ChColor color, float max_range, bool const_color=true) |
| Add a point light that emits light in all directions. More... | |
| void | ModifyPointLight (unsigned int light_ID, const ChOptixLight &point_light) |
| Function for modifying an existing point light in the scene. More... | |
| unsigned int | AddDirectionalLight (ChColor color, float elevation, float azimuth) |
| Add a directional light that emits light in a particular direction. More... | |
| void | ModifyDirectionalLight (unsigned int light_ID, const ChOptixLight &directional_light) |
| Function for modifying an existing directional light in the scene. More... | |
| unsigned int | AddSpotLight (ChVector3f pos, ChColor color, float max_range, ChVector3f light_dir, float angle_falloff_start, float angle_range, bool const_color=true) |
| Add a spot light that emits light in a particular direction. More... | |
| void | ModifySpotLight (unsigned int light_ID, const ChOptixLight &spot_light) |
| Function for modifying an existing spot light in the scene. More... | |
| unsigned int | AddRectangleLight (ChVector3f pos, ChColor color, float max_range, ChVector3f length_vec, ChVector3f width_vec, bool const_color=true) |
| Add a rectangle light that emits light forward from a rectangle area. More... | |
| void | ModifyRectangleLight (unsigned int light_ID, const ChOptixLight &rectangle_light) |
| Function for modifying an existing rectangle light in the scene. More... | |
| unsigned int | AddDiskLight (ChVector3f pos, ChColor color, float max_range, ChVector3f light_dir, float radius, bool const_color=true) |
| Add a disk light that emits light forward from a circular area. More... | |
| void | ModifyDiskLight (unsigned int light_ID, const ChOptixLight &disk_light) |
| Function for modifying an existing disk light in the scene. More... | |
| unsigned int | AddEnvironmentLight (std::string env_tex_path, float intensity_scale=1.f) |
| Add the environment light that emits light from all directions based on an environment map. More... | |
| std::vector< ChOptixLight > | GetLights () |
| Function for gaining access to the vector of lights which can be used to modify lighting dynamically. More... | |
| Background | GetBackground () |
| Function for gaining access to the background. More... | |
| void | SetBackground (Background b) |
| Function for gaining access to the background. More... | |
| void | SetAmbientLight (ChVector3f color) |
| Function for setting the ambient light color. More... | |
| ChVector3f | GetAmbientLight () |
| Function for setting the ambient light color. More... | |
| void | ResetLightsChanged () |
| Function for resetting the lights changed variable. | |
| bool | GetLightsChanged () |
| Function for getting the lights changed variable. | |
| void | ResetBackgroundChanged () |
| Function for resetting the background changed variable. | |
| bool | GetBackgroundChanged () |
| Function for getting the background changed variable. | |
| void | SetFogColor (ChVector3f color) |
| Function to set the fog color. | |
| ChVector3f | GetFogColor () |
| Function to get the fog color. | |
| void | SetFogScattering (float coefficient) |
| Function to set the fog scattering coefficient. | |
| void | SetFogScatteringFromDistance (float distance) |
| Function to set the fog scattering coefficient from max visible distance. More... | |
| float | GetFogScattering () |
| Function to get the fog scattering coefficient. | |
| void | SetSceneEpsilon (float e) |
| Allows setting the scene epsilon used for traversal checks. More... | |
| float | GetSceneEpsilon () |
| Accessor to the scene epsilon value. More... | |
| void | AddSprite (std::shared_ptr< ChBody > sprite) |
| Add a sprite (a Chrono body that is only used for visualization and does not affect the physics simulation) to the scene. More... | |
| void | SetSprites (std::vector< std::shared_ptr< ChBody >> sprites) |
| std::shared_ptr< ChBody > | GetSprite (int i) |
| std::vector< std::shared_ptr< ChBody > > | GetSprites () |
| void | UpdateOriginOffset (ChVector3f sensor_pos, bool force=false) |
| Function to change the origin offset if necessary. More... | |
| bool | GetOriginChanged () |
| void | ResetOriginChanged () |
| ChVector3f | GetOriginOffset () |
| Access function for the origin offset. More... | |
| void | SetOriginOffsetThreshold (float threshold) |
| Set the threshold for moving the origin. More... | |
| void | EnableDynamicOrigin (bool enable) |
| Enable dynamic moving of the scene origin. More... | |
Member Function Documentation
◆ AddDirectionalLight()
| CH_SENSOR_API unsigned int chrono::sensor::ChScene::AddDirectionalLight | ( | ChColor | color, |
| float | elevation, | ||
| float | azimuth | ||
| ) |
Add a directional light that emits light in a particular direction.
-— Directional light -— ///
- Parameters
-
color [W/m^2] or [lumen/m^2], color irradiance of the light elevation [rad], elevation angle of the directional light comes from azimuth [rad], azimuth angle of the directional light comes from
- Returns
- the index of the light that has been added
◆ AddDiskLight()
| CH_SENSOR_API unsigned int chrono::sensor::ChScene::AddDiskLight | ( | ChVector3f | pos, |
| ChColor | color, | ||
| float | max_range, | ||
| ChVector3f | light_dir, | ||
| float | radius, | ||
| bool | const_color = true |
||
| ) |
Add a disk light that emits light forward from a circular area.
-— Disk light -— ///
- Parameters
-
pos [m], the world position of the rectangle light color [W/m^2] or [lumen/m^2], color radiance of the light max_range [m], range at which the light intensity falls to 1% of its maximum color intensity. If set to -1, follows inverse square law. light_dir the direction in which the disk light points (no need to be normalized) radius [m], radius of the disk light const_color whether to use constant color (no attenuation with distance)
- Returns
- the index of the added light
◆ AddEnvironmentLight()
| CH_SENSOR_API unsigned int chrono::sensor::ChScene::AddEnvironmentLight | ( | std::string | env_tex_path, |
| float | intensity_scale = 1.f |
||
| ) |
Add the environment light that emits light from all directions based on an environment map.
- Parameters
-
env_tex_path the full path of the environment map texture. intensity_scale a scale factor for the intensity of the environment light. Default value is 1.0 (no scaling).
- Returns
- the index of the light that has been added
◆ AddPointLight()
| CH_SENSOR_API unsigned int chrono::sensor::ChScene::AddPointLight | ( | ChVector3f | pos, |
| ChColor | color, | ||
| float | max_range, | ||
| bool | const_color = true |
||
| ) |
Add a point light that emits light in all directions.
Point light ///.
- Parameters
-
pos The world position of the point light color [W/sr/m^2] or [lumen/sr/m^2], color radiance of the light max_range [m], range at which the light intensity falls to 1% of its maximum color intensity. If set to -1, follows inverse square law.
- Returns
- the index of the light that has been added
◆ AddRectangleLight()
| CH_SENSOR_API unsigned int chrono::sensor::ChScene::AddRectangleLight | ( | ChVector3f | pos, |
| ChColor | color, | ||
| float | max_range, | ||
| ChVector3f | length_vec, | ||
| ChVector3f | width_vec, | ||
| bool | const_color = true |
||
| ) |
Add a rectangle light that emits light forward from a rectangle area.
-— Rectangle light -— ///
- Parameters
-
pos [m], the world position of the rectangle light color [W/m^2] or [lumen/m^2], color radiance of the light max_range [m], range at which the light intensity falls to 1% of its maximum color intensity. If set to -1, follows inverse square law. length_vec [m], one edge vector of the rectangle light width_vec [m], the other edge vector of the rectangle light perpendicular to length_vec. Light direction is: length_vec x width_vec.const_color whether to use constant color (no attenuation with distance)
- Returns
- the index of the added light
◆ AddSpotLight()
| CH_SENSOR_API unsigned int chrono::sensor::ChScene::AddSpotLight | ( | ChVector3f | pos, |
| ChColor | color, | ||
| float | max_range, | ||
| ChVector3f | light_dir, | ||
| float | angle_falloff_start, | ||
| float | angle_range, | ||
| bool | const_color = true |
||
| ) |
Add a spot light that emits light in a particular direction.
-— Spot light -— ///
- Parameters
-
pos the world position of the spot light color color radiance of the light max_range range at which the light intensity falls to 1% of its maximum color intensity. If set to -1, follows inverse square law. light_dir the direction in which the spotlight points (no need to be normalized) angle_falloff_start [m], angle at which the spotlight starts to linearly fall off angle_range [rad], angle range of the spotlight falling off to zero. const_color whether to use constant color (no attenuation with distance)
- Returns
- the index of the light that has been added
◆ AddSprite()
| CH_SENSOR_API void chrono::sensor::ChScene::AddSprite | ( | std::shared_ptr< ChBody > | sprite | ) |
Add a sprite (a Chrono body that is only used for visualization and does not affect the physics simulation) to the scene.
- Parameters
-
sprite the Chrono body to be added as a sprite in the scene
◆ EnableDynamicOrigin()
|
inline |
Enable dynamic moving of the scene origin.
- Parameters
-
enable whether to enable to the moving origin
◆ GetAmbientLight()
|
inline |
Function for setting the ambient light color.
- Returns
- the ambient light in the scene
◆ GetBackground()
|
inline |
Function for gaining access to the background.
Can be used to dynamically change the background color, or texture
- Returns
- m_background the background used for rendering
◆ GetLights()
|
inline |
Function for gaining access to the vector of lights which can be used to modify lighting dynamically.
- Returns
- A vector of lights in the scene currently
◆ GetOriginOffset()
|
inline |
Access function for the origin offset.
- Returns
- the origin offset
◆ GetSceneEpsilon()
|
inline |
Accessor to the scene epsilon value.
- Returns
- the scene epsilon
◆ ModifyDirectionalLight()
| CH_SENSOR_API void chrono::sensor::ChScene::ModifyDirectionalLight | ( | unsigned int | light_ID, |
| const ChOptixLight & | directional_light | ||
| ) |
Function for modifying an existing directional light in the scene.
- Parameters
-
light_ID the index of the directional light to be modified directional_light the new directional light
◆ ModifyDiskLight()
| CH_SENSOR_API void chrono::sensor::ChScene::ModifyDiskLight | ( | unsigned int | light_ID, |
| const ChOptixLight & | disk_light | ||
| ) |
Function for modifying an existing disk light in the scene.
- Parameters
-
light_ID the index of the disk light to be modified disk_light the new disk light
◆ ModifyPointLight()
| CH_SENSOR_API void chrono::sensor::ChScene::ModifyPointLight | ( | unsigned int | light_ID, |
| const ChOptixLight & | point_light | ||
| ) |
Function for modifying an existing point light in the scene.
- Parameters
-
light_ID the index of the point light to be modified point_light the new point light
◆ ModifyRectangleLight()
| CH_SENSOR_API void chrono::sensor::ChScene::ModifyRectangleLight | ( | unsigned int | light_ID, |
| const ChOptixLight & | rectangle_light | ||
| ) |
Function for modifying an existing rectangle light in the scene.
- Parameters
-
light_ID the index of the rectangle light to be modified rectangle_light the new rectangle light
◆ ModifySpotLight()
| CH_SENSOR_API void chrono::sensor::ChScene::ModifySpotLight | ( | unsigned int | light_ID, |
| const ChOptixLight & | spot_light | ||
| ) |
Function for modifying an existing spot light in the scene.
- Parameters
-
light_ID the index of the spot light to be modified spot_light the new spot light
◆ SetAmbientLight()
|
inline |
Function for setting the ambient light color.
- Parameters
-
color the color+intensity of ambient light
◆ SetBackground()
| CH_SENSOR_API void chrono::sensor::ChScene::SetBackground | ( | Background | b | ) |
Function for gaining access to the background.
Can be used to dynamically change the background color, or texture
- Parameters
-
b a new background for the scene
◆ SetFogScatteringFromDistance()
| CH_SENSOR_API void chrono::sensor::ChScene::SetFogScatteringFromDistance | ( | float | distance | ) |
Function to set the fog scattering coefficient from max visible distance.
Function to set the fog scattering coefficient.
◆ SetOriginOffsetThreshold()
|
inline |
Set the threshold for moving the origin.
- Parameters
-
threshold the threshold outside of which to move the scene origin
◆ SetSceneEpsilon()
| CH_SENSOR_API void chrono::sensor::ChScene::SetSceneEpsilon | ( | float | e | ) |
Allows setting the scene epsilon used for traversal checks.
- Parameters
-
e the epsilon value
◆ UpdateOriginOffset()
| void chrono::sensor::ChScene::UpdateOriginOffset | ( | ChVector3f | sensor_pos, |
| bool | force = false |
||
| ) |
Function to change the origin offset if necessary.
- Parameters
-
sensor_pos the position of the sensor force whether to force updating even if threshold is not met
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_sensor/optix/scene/ChScene.h
- /builds/uwsbel/chrono/src/chrono_sensor/optix/scene/ChScene.cpp