Unigine::ObjectSky Class
See also the UnigineScript analog.
To use this class, include the UnigineObjectSky.h file.
Unigine::ObjectSky Class
Members
static int type ()
ObjectSky type.Return value
ObjectSky type identifier.static Ptr< ObjectSky > create (const NodePtr & node)
ObjectSky constructor.Arguments
- const NodePtr & node - Node smart pointer.
static Ptr< ObjectSky > create (const ObjectPtr & object)
ObjectSky constructor.Arguments
- const ObjectPtr & object - Object smart pointer.
static Ptr< ObjectSky > create ()
ObjectSky constructor.virtual void setSpherical (int spherical) =0
Sets a value indicating if a sky background cube map should be mapped onto a whole sphere rather then a hemisphere.Arguments
- int spherical - 1 for the whole sphere; 0 for a sky hemisphere.
virtual int isSpherical () const =0
Returns a value indicating whether a sky background cube map should be mapped onto a whole sphere rather then a hemisphere.Return value
1 if the sky is a sphere; 0, if a hemisphere.virtual void setSimulation (int simulation) =0
Sets a flag to simulate volumetric clouds in the background when the volume surface is disabled or no material is assigned to it. When weather is controlled by Tracker, clouds are enabled and rendered much faster, since all required calculations are already done.Arguments
- int simulation - 1 to simulate clouds in the background; 0 not to perform any calculations.
virtual int getSimulation () const =0
Returns a flag if volumetric clouds are simulated in the background when the volume surface is disabled or no material is assigned to it. When weather is controlled by Tracker, clouds are enabled and rendered much faster, since all required calculations are already done.Return value
1 if the simulation is activated; otherwise - 0.virtual void setSize (const vec3 & size) =0
Updates the size of the generated clouds.Arguments
- const vec3 & size - Clouds size.
virtual vec3 getSize () const =0
Returns the size of the generated clouds.Return value
Clouds size.virtual void setMinSlices (int slices) =0
Updates the minimum number of cloud slices, which are rendered when the player is within the clouds bounding box. The minimum number of slices will gradually increase up to the maximum number as the player moves away from the clouds.Arguments
- int slices - Minimum number of cloud slices.
virtual int getMinSlices () const =0
Returns the minimum number of cloud slices, which are rendered when the player is within the clouds bounding box.Return value
Minimum number of cloud slices.virtual void setMaxSlices (int slices) =0
Updates the maximum number of cloud slices, which are rendered when the player moves away from the clouds (along the Z axis) further than their bounding box height. The maximum number will gradually decrease down to the minimum number as the player moves closer to the clouds.Arguments
- int slices - Maximum number of cloud slices.
virtual int getMaxSlices () const =0
Returns the maximum number of cloud slices, which are rendered when the player moves away from the clouds (along the Z axis) further than their bounding box height.Return value
Maximum number of cloud slices.virtual void setDistribute (float distribute) =0
Sets the density of volumetric clouds in the distance. If a low value is set, more clouds are rendered in the distance while there are less of them near the camera (the number of slices is not chnaged).Arguments
- float distribute - Distribution power. The provided value is clamped to the range [2;4].
virtual float getDistribute () const =0
Returns the density of volumetric clouds in the distance. If a low value is used, more clouds are rendered in the distance while there are less of them near the camera (the number of slices is not changed). 4 means visual optimization.Return value
Distribution power.virtual void setHumidity (float value) =0
Updates the humidity factor.Arguments
- float value - Humidity factor.
virtual float getHumidity () const =0
Returns the current humidity factor.Return value
Humidity factor.virtual void setTransition (float value) =0
Updates the probability factor for condensing the water vapor into clouds.Arguments
- float value - Condensation factor.
virtual float getTransition () const =0
Returns the current probability factor for condensing the water vapor into clouds.Return value
Condensation factor.virtual void setExtinction (float value) =0
Updates the probability factor for clouds extinction.Arguments
- float value - Extinction factor.
virtual float getExtinction () const =0
Returns the current probability factor for clouds extinction.Return value
Extinction factor.virtual int setDensityImageName (const char * name) =0
Updates a density image used to generate the clouds.Arguments
- const char * name - Density image name.
Return value
1 if the density image is successfully set; otherwise, 0.virtual const char * getDensityImageName () const =0
Returns the density image name used used to generate the clouds.Return value
Density image name.virtual void setDensityVelocity (const vec3 & velocity) =0
Updates the velocity vector values for shifting the density image and thus imitating wind in the clouds. If velocity values are set for the X- and Y-coordinates, the shift only applies to the chosen density image layer. If velocity value is set for the Z-coordinate, all the layers will be shifted between.Arguments
- const vec3 & velocity - Velocity in units per second.
virtual vec3 getDensityVelocity () const =0
Returns the current velocity vector values for shifting the density image and thus imitating wind in the clouds.Return value
Velocity in units per second.virtual void setDensityOffset (const vec3 & offset) =0
Sets offset for a 3D mask of volumetric clouds and repositions the clouds.Arguments
- const vec3 & offset - Mask offset. Texture coordinates are passed as the first two elements of the vector; the third one is ignored.
virtual vec3 getDensityOffset () const =0
Returns the current offset of a 3D mask of volumetric clouds. Texture coordinates are received in the first two elements of the vector.Return value
Mask offset.virtual void setDensityLayer (int layer) =0
Updates a layer of the density image that will be used to generate the clouds.Arguments
- int layer - Density image layer number from 0 to 3.
virtual int getDensityLayer () const =0
Returns the layer of the density image used to generate the clouds.Return value
Density image layer number.Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)