This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

LightOmni Class

This class is used to create omni directional light sources. It is possible to modulate the light from omni light sources with a texture.

LightOmni Class

This class inherits from Light

Members


LightOmni (vec4 color, vec3 radius, string texture = 0)

Constructor. Creates a new omni light source with cubemap modulation based on given parameters.

Arguments

  • vec4 color - Color of the new light source.
  • vec3 radius - Radii of the new light source.
  • string texture - Path to a cubemap texture of the new light source.

int getImageTextureImage (Image image)

Reads the light image texture into an Image instance.

Arguments

  • Image image - Image, into which the texture is read.

Return value

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

string getImageTextureName ()

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

Return value

Name of the cubemap texture.

vec3 getRadius ()

Returns the current radii of the omni light source.

Return value

Radii of the light source.

int getShadowMask ()

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

Return value

Shadow bitmask.

int setImageTextureImage (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

  • 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 setImageTextureName (string texture)

Updates the the cubemap texture used with this light source.

Arguments

  • string texture - Name (path) of the new cubemap texture.

void setRadius (vec3 radius)

Updates the current radii of the omni light source.

Arguments

  • vec3 radius - New radii of the light source. If negative values are provided, 0 will be used instead of them.

void setShadowMask (int mask)

Updates the shadow mask for the omni light source. The bitmask defines shadowing of six cubemap 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 - Shadow bitmask.
Last update: 2017-07-03
Build: ()