This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

LightOmni Class

Interface for light omni handling.

To use this class, include the UnigineLightOmni.h file.

LightOmni Class

Members


LightOmni (const Math::vec4 & color, float attenuation_distance, const char * name = 0)

Arguments

  • const Math::vec4 & color
  • float attenuation_distance
  • const char * name

const char * getImageTextureName ()

Returns the name (path) of the cubemap texture used with this light source.

Return value

Name of the cubemap texture.

int getImageTextureImage (const Ptr<Image> & image)

Reads the light image texture into an Image instance.

Arguments

  • const Ptr<Image> & image - Image, into which the texture is read.

Return value

Returns 1 if the texture is read successfully; otherwise, 0.

int getShadowMask ()

Returns the current shadow mask set for the omni light source. The bit mask defines shadowing of six cube map sides in the following way: positive and negative X-axis, positive and negative Y-axis, and positive and negative Z-axis.

Return value

Integer, each bit of which is used to set a mask.

float getShapeLength ()

Returns a length of the capsule-shaped or rectangular light source.

Return value

Length of the light source shape.

void setShadowMask (int mask)

Updates the shadow mask for the omni light source. The bit mask defines shadowing of six cube map sides in the following way: positive and negative X-axis, positive and negative Y-axis, and positive and negative Z-axis. By default, no mask is applied.

Arguments

  • int mask - Integer, each bit of which is used to set a mask.

void setAttenuationDistance (float distance)

Updates the distance from the light source shape, at which the light source doesn't illuminate anything.

Arguments

  • float distance - Distance from the light source shape, at which the light source doesn't illuminate anything.

void setShapeLength (float length)

Updates the length of the capsule-shaped or rectangular light source.

Arguments

  • float length - Length of the light source shape.

int setImageTextureImage (const Ptr<Image> & image, int dynamic = 0)

Sets a given Image instance as the light image texture. If you need to set a texture of all the lights in the scene, set dynamic flag to 1.

Arguments

  • const Ptr<Image> & image - New texture to set.
  • int dynamic - Dynamic texture flag.
    • If set to 0, changing a texture of the light instance will also affect all the lights in the scene.
    • If set to 1, an image will be successfully set only for the current light instance.

Return value

Returns 1 if the texture is set successfully; otherwise, 0.

void setImageTexture (const Ptr<Texture> & texture)

Sets the light image texture smart pointer.

Arguments

  • const Ptr<Texture> & texture - Texture smart pointer.

float getAttenuationDistance ()

Returns the distance from the light source shape, at which the light source doesn't illuminate anything.

Return value

Distance from the light source shape, at which the light source doesn't illuminate anything.

Ptr<Texture> getImageTexture ()

Gets a light image texture smart pointer.

Return value

Returns image texture smart pointer.

void setShapeRadius (float radius)

Updates the radius of the spherical, capsule-shaped or rectangular light source.
Notice
In case of the rectangular shape, the corner radius is set.

Arguments

  • float radius - Radius of the light source shape.

float getShapeHeight ()

Returns the height of the rectangular light source.

Return value

Height of the light source shape.

Math::vec3 getSize ()

Returns the size of the area illuminated by the light source. Depending on the shape type, the size varies:
  • If the light is point-shaped, each component of the vector will be equal to the attenuation distance:
    Source code(C++)
    vec3(attenuation_distance)
  • If the light is spherical, each component of the vector will be equal to the attenuation distance+sphere radius:
    Source code(C++)
    vec3(attenuation_distance + sphere_radius)
  • If the light is capsule-shaped, the 1st component of the vector will be equal to attenuation distance+capsule length:
    Source code(C++)
    vec3(attenuation_distance + capsule_length,attenuation_distance,attenuation_distance)
  • If the light is rectangular, the 2nd component of the vector will be equal to attenuation distance+rectangle height:
    Source code(C++)
    vec3(attenuation_distance,attenuation_distance + rectangle_height,attenuation_distance)

Return value

A size of the illuminated area.

void setImageTextureName (const char * name)

Updates the the cube map texture used with this light source.

Arguments

  • const char * name - Name (path) of the new cube map texture.

void setShapeType (int type)

Updates the shape of the light source.
Notice
A light source of the rectangular shape produces the light and the speck in a form of a rounded rectangle.

Arguments

  • int type - Shape of the light source (one of the SHAPE_* variables).

int getShapeType ()

Returns the shape of the light source.
Notice
A light source of the rectangular shape produces the light and the speck in a form of a rounded rectangle.

Return value

Shape of the light source (one of the SHAPE_* variables).

float getShapeRadius ()

Returns a radius of the spherical, capsule-shaped or rectangular light source.
Notice
In case of the rectangular shape, the corner radius will be returned.

Return value

Radius of the light source shape.

void setShapeHeight (float height)

Updates the height of the rectangular light source.

Arguments

  • float height - Height of the light source shape.
Last update: 03.07.2017
Build: ()