Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzu_light.h File Reference

Represents a light in a scene. More...

Functions

kzsError kzuLightNodeCreate (const struct KzcMemoryManager *memoryManager, kzString name, struct KzuUIDomain *uiDomain, struct KzuLightNode **out_lightNode)
 Creates a new light node. More...
 
kzsError kzuLightNodeCreateDirectional (const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, kzString name, struct KzuLightNode **out_lightNode)
 Creates new directional light. More...
 
kzsError kzuLightNodeCreatePoint (const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, kzString name, struct KzuLightNode **out_lightNode)
 Creates new point light. More...
 
kzsError kzuLightNodeCreateSpot (const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, kzString name, struct KzuLightNode **out_lightNode)
 Creates new spot light. More...
 
kzsError kzuLightNodeRegisterToFactory (const struct KzuFactory *factory)
 Registers light node type to factory. More...
 
kzsError kzuLightNodeInitialize (struct KzuLightNode *lightNode, struct KzuStructPropertyType *lightType)
 Sets the light type for light node. More...
 
struct KzuLightNodekzuLightNodeFromObjectNode (const struct KzuObjectNode *objectNode)
 Get light object node from object node. More...
 
struct KzuObjectNodekzuLightNodeToObjectNode (const struct KzuLightNode *lightNode)
 Returns an object node from light node. More...
 
struct KzuStructPropertyTypekzuLightNodeGetLightType (const struct KzuLightNode *lightNode)
 Returns light property type from light. More...
 

Variables

const kzString KZU_DIRECTIONAL_LIGHT_PROPERTY
 Directional light. More...
 
const kzString KZU_POINT_LIGHT_PROPERTY
 Point light. More...
 
const kzString KZU_SPOT_LIGHT_PROPERTY
 Spot light. More...
 
const KzuObjectType KZU_OBJECT_TYPE_LIGHT
 Object type identifier for Light objects. More...
 

Detailed Description

Represents a light in a scene.

Contains a constructor for a directional, point and spot light. Node inherited from KzuObjectNode.

Light Messages

KzuLightNode does not send or receive any messages.

Common Light Properties

These properties are common for all types of lights.

KZU_PROPERTY_TYPE_LIGHT_ENABLED Boolean property specifies whether the light is on or off. If the value is KZ_FALSE, the light does not affect rendering. The default value is KZ_TRUE.

Directional Light Properties

These properties affect only directional lights.

KZU_PROPERTY_TYPE_DIRECTIONAL_LIGHT_COLOR KzcColorRGBA property specifies the color of the light. The default value is {0.4980392, 0.4980392, 0.4980392, 1}.

KZU_PROPERTY_TYPE_DIRECTIONAL_LIGHT_DIRECTION KzcVector3 property value is set based on the light's transformation matrix.

Point Light Properties

These properties affect only point lights.

KZU_PROPERTY_TYPE_POINT_LIGHT_COLOR KzcColorRGBA property specifies the color of the light. The default value is {0.4980392, 0.4980392, 0.4980392, 1}.

KZU_PROPERTY_TYPE_POINT_LIGHT_ATTENUATION KzcVector3 property specifies three factors that are used to lessen the effect of the light for objects that are farther away. The three factors specify a constant, linear and quadratic attenuation respectively. The default value is {1, 0, 0}.

KZU_PROPERTY_TYPE_POINT_LIGHT_POSITION KzcVector3 property value is set based on the light's transformation matrix.

Spot Light Properties

These properties affect only spot lights.

KZU_PROPERTY_TYPE_SPOT_LIGHT_COLOR KzcColorRGBA property specifies the color of the light. The default value is {0.4980392, 0.4980392, 0.4980392, 1}.

KZU_PROPERTY_TYPE_SPOT_LIGHT_ATTENUATION KzcVector3 property specifies three factors that are used to lessen the effect of the light for objects that are farther away. The three factors specify a constant, linear and quadratic attenuation respectively. The default value is {1, 0, 0}.

KZU_PROPERTY_TYPE_SPOT_LIGHT_CUTOFF_ANGLE float property specifies the angle of the light cone in degrees. The default value is 90.

KZU_PROPERTY_TYPE_SPOT_LIGHT_DIRECTION KzcVector3 property value is set based on the light's transformation matrix.

KZU_PROPERTY_TYPE_SPOT_LIGHT_EXPONENT float property specifies how fast the fully lit area of the center of the light cone turns into non-lit area.

KZU_PROPERTY_TYPE_SPOT_LIGHT_POSITION KzcVector3 property value is set based on the light's transformation matrix.

Copyright 2008-2019 by Rightware. All rights reserved.

Function Documentation

kzsError kzuLightNodeCreate ( const struct KzcMemoryManager memoryManager,
kzString  name,
struct KzuUIDomain uiDomain,
struct KzuLightNode **  out_lightNode 
)

Creates a new light node.

The type of the light can be set with kzuLightNodeInitialize().

kzsError kzuLightNodeCreateDirectional ( const struct KzcMemoryManager memoryManager,
struct KzuUIDomain uiDomain,
kzString  name,
struct KzuLightNode **  out_lightNode 
)

Creates new directional light.

kzsError kzuLightNodeCreatePoint ( const struct KzcMemoryManager memoryManager,
struct KzuUIDomain uiDomain,
kzString  name,
struct KzuLightNode **  out_lightNode 
)

Creates new point light.

kzsError kzuLightNodeCreateSpot ( const struct KzcMemoryManager memoryManager,
struct KzuUIDomain uiDomain,
kzString  name,
struct KzuLightNode **  out_lightNode 
)

Creates new spot light.

kzsError kzuLightNodeRegisterToFactory ( const struct KzuFactory factory)

Registers light node type to factory.

kzsError kzuLightNodeInitialize ( struct KzuLightNode lightNode,
struct KzuStructPropertyType lightType 
)

Sets the light type for light node.

struct KzuLightNode* kzuLightNodeFromObjectNode ( const struct KzuObjectNode objectNode)

Get light object node from object node.

struct KzuObjectNode* kzuLightNodeToObjectNode ( const struct KzuLightNode lightNode)

Returns an object node from light node.

struct KzuStructPropertyType* kzuLightNodeGetLightType ( const struct KzuLightNode lightNode)

Returns light property type from light.

Variable Documentation

const kzString KZU_DIRECTIONAL_LIGHT_PROPERTY

Directional light.

const kzString KZU_POINT_LIGHT_PROPERTY

Point light.

const kzString KZU_SPOT_LIGHT_PROPERTY

Spot light.

const KzuObjectType KZU_OBJECT_TYPE_LIGHT

Object type identifier for Light objects.