ObjectSky Class
See also the UnigineScript analog.
To use this class, include the UnigineObjectSky.h file.
ObjectSky Class
Members
ObjectSky ()
Constructor. Creates a new sky object.void setHumidity (float humidity)
Updates the humidity factor.Arguments
- float humidity - Humidity factor.
int getMaxSlices ()
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.int isSpherical ()
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.void setDensityOffset (const Math::vec3 & offset)
Sets offset for a 3D mask of volumetric clouds and repositions the clouds.Arguments
- const Math::vec3 & offset - Mask offset. Texture coordinates are passed as the first two elements of the vector; the third one is ignored.
void setDensityLayer (int layer)
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.
float getHumidity ()
Returns the current humidity factor.Return value
Humidity factor.void setDensityVelocity (const Math::vec3 & velocity)
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 Math::vec3 & velocity - Velocity in units per second.
void setTransition (float transition)
Updates the probability factor for condensing the water vapor into clouds.Arguments
- float transition - Condensation factor.
Math::vec3 getSize ()
Returns the size of the generated clouds.Return value
Clouds size.float getTransition ()
Returns the current probability factor for condensing the water vapor into clouds.Return value
Condensation factor.int getSimulation ()
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.void setSimulation (int simulation)
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.
Math::vec3 getDensityVelocity ()
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.int setDensityImageName (const char * name)
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.const char * getDensityImageName ()
Returns the density image name used used to generate the clouds.Return value
Density image name.void setDistribute (float distribute)
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].
void setSpherical (int spherical)
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.
int getDensityLayer ()
Returns the layer of the density image used to generate the clouds.Return value
Density image layer number.float getDistribute ()
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.void setExtinction (float extinction)
Updates the probability factor for clouds extinction.Arguments
- float extinction - Extinction factor.
Math::vec3 getDensityOffset ()
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.void setSize (const Math::vec3 & size)
Updates the size of the generated clouds.Arguments
- const Math::vec3 & size - Clouds size.
void setMinSlices (int slices)
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.
float getExtinction ()
Returns the current probability factor for clouds extinction.Return value
Extinction factor.void setMaxSlices (int slices)
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.
int getMinSlices ()
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.Last update: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter