OpenCMISS-Zinc C++ API Documentation
|
The light controls how vertices will be lit on a sceneviewer. More...
#include <light.hpp>
Public Types | |
enum | Type { TYPE_INVALID = CMZN_LIGHT_TYPE_INVALID, TYPE_AMBIENT = CMZN_LIGHT_TYPE_AMBIENT, TYPE_DIRECTIONAL = CMZN_LIGHT_TYPE_DIRECTIONAL, TYPE_POINT = CMZN_LIGHT_TYPE_POINT, TYPE_SPOT = CMZN_LIGHT_TYPE_SPOT } |
Public Member Functions | |
Light (cmzn_light_id light_id) | |
Light (const Light &light) | |
Light & | operator= (const Light &light) |
bool | isValid () const |
cmzn_light_id | getId () const |
bool | isManaged () |
int | setManaged (bool value) |
enum Type | getType () |
int | setType (enum Type type) |
char * | getName () |
int | setName (const char *name) |
double | getConstantAttenuation () |
int | setConstantAttenuation (double constantAttenuation) |
double | getLinearAttenuation () |
int | setLinearAttenuation (double linearAttenuation) |
double | getQuadraticAttenuation () |
int | setQuadraticAttenuation (double quadraticAttenuation) |
int | getColourRGB (double *valuesOut3) |
int | setColourRGB (const double *valuesIn3) |
int | getDirection (double *valuesOut3) |
int | setDirection (const double *valuesIn3) |
int | getPosition (double *valuesOut3) |
int | setPosition (const double *valuesIn3) |
double | getSpotCutoff () |
int | setSpotCutoff (double cutoff) |
double | getSpotExponent () |
int | setSpotExponent (double exponent) |
Protected Attributes | |
cmzn_light_id | id |
The light controls how vertices will be lit on a sceneviewer.
The light controls how vertices will be lit on a sceneviewer. Lighting and colouring of graphics are affected by the light colours, direction, position and type of lighting, in combination with material colours and other parameters.
The type of light. Various types imitate real-world light sources.
|
inline |
Get the 3 component real vector giving the RGB colour of the light.
valuesOut3 | Values of the colour will be output into this 3 component vector. It should be allocated with enough space for 3 components. |
|
inline |
Returns the value of the constant attenuation. Attenuation is the loss of light intensity over a distance. It only applies to spot and point lights.
attenuation factor: 1 / (c + k * l + k * q * q) where c, l, q and k is constant, linear, quadratic attenuation and distance respectively.
|
inline |
Get the 3 component vector giving the direction of the light. It only applies to infinite and spot lights.
valuesOut3 | Values of the direction will be output into this 3 component vector. It should be allocated with enough space for 3 components. |
|
inline |
|
inline |
Returns the value of the linear attenuation. Attenuation is the loss of light intensity over a distance. It only applies to spot and point lights.
attenuation factor: 1 / (c + k * l + k * q * q) where c, l, q and k is constant, linear, quadratic attenuation and distance respectively.
|
inline |
Return an allocated string containing light name.
|
inline |
Get the 3 component vector giving the position of the light. It only applies to point and spot lights.
valuesOut3 | Values of the position will be output into this 3 component vector. It should be allocated with enough space for 3 components. |
|
inline |
Returns the value of the quadratic attenuation. Attenuation is the loss of light intensity over a distance. It only applies to spot and point lights.
attenuation factor: 1 / (c + k * l + k * q * q) where c, l, q and k is constant, linear, quadratic attenuation and distance respectively.
|
inline |
Gets the spotlight cutoff angle in degrees from 0 to 90. It only applies to spot light.
|
inline |
Gets the spotlight exponent which controls how concentrated the spotlight becomes as one approaches its axis. A value of 0.0 gives even illumination throughout the cutoff angle. It only applies to spot light.
|
inline |
Gets the type of the light: AMBIENT, DIRECTIONAL, POINT or SPOT.
|
inline |
Get managed status of light in its owning light module.
|
inline |
Check if this is a valid Light object.
|
inline |
Set the colour of the light using a 3 component vector of the RGB values. For ambient light type, the colour applies to ambient lighting calculations, blending with the ambient colour of materials. For all other light types, the colour applies to diffuse and specular lighting, blending with materials' diffuse and specular colours.
valuesIn3 | Values of the colour to be set, it must be a 3 component vector storing the RGB value. Colour values range from 0.0 to 1.0 (max). |
|
inline |
Set the value of the constant attenuation. Attenuation is the loss of light intensity over a distance. It only applies to spot and point lights.
attenuation factor: 1 / (c + k * l + k * q * q) where c, l, q and k is constant, linear, quadratic attenuation and distance respectively.
constantAttenuation | Non-negative float representing the value of constant attenuation to be set. |
|
inline |
Set the direction of the light using a 3 component vector. It only applies to infinite and spot lights.
valuesIn3 | Values of the direction to set, must be a 3 component vector storing the direction value. |
|
inline |
Set the value of the linear attenuation. Attenuation is the loss of light intensity over a distance. It only applies to spot and point lights.
attenuation factor: 1 / (c + k * l + k * q * q) where c, l, q and k is constant, linear, quadratic attenuation and distance respectively.
linearAttenuation | non-negative float representing the value of linear attenuation to be set. |
|
inline |
Set managed status of light in its owning light module. If true (managed) the light will remain indefinitely in the light module even if no external references are held. If false (unmanaged) the light will be automatically removed from the module when no longer referenced externally, effectively marking it as pending destruction. All new objects are unmanaged unless stated otherwise.
value | The new value for the managed flag: true or false. |
|
inline |
Set/change name for light. Must be unique in the light module.
name | name to be set to the light |
|
inline |
Set the position of the light using a 3 component vector. It only applies to point and spot lights.
valuesIn3 | Values of the position to set, must be a 3 component vector storing the position value. |
|
inline |
Set the value of the quadratic attenuation. Attenuation is the loss of light intensity over a distance. It only applies to spot and point lights.
attenuation factor: 1 / (c + k * l + k * q * q) where c, l, q and k is constant, linear, quadratic attenuation and distance respectively.
quadraticAttenuation | Non-negative float representing the value of quadratic attenuation to be set. |
|
inline |
Sets the spotlight cutoff angle in degrees from 0 to 90. It only applies to spot light.
cutoff | New value to set, the value must be between 0.0 and 90.0. |
|
inline |
Sets the spotlight exponent which controls how concentrated the spotlight becomes as one approaches its axis. A value of 0.0 gives even illumination throughout the cutoff angle. It only applies to spot light.
exponent | New spot exponent value to be set for light. |
|
inline |
Sets the type of the light: AMBIENT, DIRECTIONAL, POINT or SPOT.