Structs



TQ3DirectionalLightData


typedef struct TQ3DirectionalLightData {
    TQ3LightData                                lightData;
    TQ3Boolean                                  castsShadows;
    TQ3Vector3D                                 direction;
} TQ3DirectionalLightData;
Discussion

Describes the state for a directional light.

A directional light is defined by a vector, which indicates the world-space direction away from the light source.

Field Descriptions
lightData
The common state for the light.
castsShadows
Indicates if the light casts shadows.
direction
The direction of the light.

TQ3LightData


typedef struct TQ3LightData {
    TQ3Boolean                                  isOn;
    float                                       brightness;
    TQ3ColorRGB                                 color;
} TQ3LightData;
Discussion

Describes the common state for a light.

The common light state includes the on/off state, brightness, and color. Brightness and color values should be between 0.0 and 1.0 inclusive.

Some renderers may support over-saturated lights (where the brightness value is greater than 1.0), or even negative brightness (where the value is less than 0.0).

The effect of such brightness values is renderer-specific, and may result in kQ3NoticeBrightnessGreaterThanOne or kQ3NoticeBrightnessLessThanZero warnings.

Field Descriptions
isOn
Controls if the light is active or not.
brightness
The brightness of the light.
color
The colour of the light.

TQ3PointLightData


typedef struct TQ3PointLightData {
    TQ3LightData                                lightData;
    TQ3Boolean                                  castsShadows;
    TQ3AttenuationType                          attenuation;
    TQ3Point3D                                  location;
} TQ3PointLightData;
Discussion

Describes the state for a point light.

A point light is defined by a coordinate in world space, and an attenuation value which controls how the light diminishes with distance.

Field Descriptions
lightData
The common state for the light.
castsShadows
Indicates if the light casts shadows.
attenuation
The attenuation style of the light.
location
The location of the light.

TQ3SpotLightData


typedef struct TQ3SpotLightData {
    TQ3LightData                                lightData;
    TQ3Boolean                                  castsShadows;
    TQ3AttenuationType                          attenuation;
    TQ3Point3D                                  location;
    TQ3Vector3D                                 direction;
    float                                       hotAngle;
    float                                       outerAngle;
    TQ3FallOffType                              fallOff;
} TQ3SpotLightData;
Discussion

Describes the state for a spot light.

A spot light is defined by a coordinate in world space, a vector away from that coordinate, and an attenuation value which controls how the light diminishes with distance.

A spot light casts a cone of light, where the cone is defined by two angles. The hot angle is the angle from the center of the light cone to the point where the light intensity starts to drop, and the outerAngle is the angle from the center of the light to the point where the light intensity has fallen to zero.

The way the light intensity diminishes between the hotAngle and outerAngle values is controlled by the light fallOff value.

Both hotAngle and outerAngle are half-angles from the center of the light cone, and are specified in radians. They both range from 0.0 to kQ3Pi/2.0 (inclusive), and the outerAngle must be equal than or greater to the hotAngle.

Field Descriptions
lightData
The common state for the light.
castsShadows
Indicates if the light casts shadows.
attenuation
The attenuation style of the light.
location
The location of the light.
direction
The direction of the light.
hotAngle
The half-angle where the light intensity starts to drop.
outerAngle
The half-angle where the light intensity reaches zero.
fallOff
The fall off between the hotAngle and the outerAngle.

© 1999-2008 Quesa Developers (Last Updated 5/10/2008)