This reference page is linked to from the following overview topics: Using the C++ Classes.
Light represents a light in the scene.
#include <Light.h>
Public Types |
|
enum | LightType
{ kPoint, kDirectional, kSpot, kLinear, kClipPlane, kClipBox } |
Public Member Functions |
|
Light () | |
Light (const Light &nodeToCopy) | |
Light & | operator= (const Light &) |
void | setLightPosition (const awLinear::Point &value) |
The position is specified in world space.
|
|
awLinear::Point | getLightPosition () const |
void | setLightDirection (const awLinear::Normal &value) |
The direction is specified in world space.
|
|
awLinear::Normal | getLightDirection () const |
awString::IString | getValueAsString (const awString::IString &name) const |
You can access the position, direction and
type through this interface as well. |
|
bool | setValueAsString (const awString::IString &name, const awSupport::Parameter::Type type, const awString::IString &valueString) |
awSupport::ParameterRef | getParameterByName (const awString::IString &name) const |
You can get to all parameters this way.
|
|
virtual void | setIsVisible (bool isVisible) |
virtual void | setIsAlternateVisible (bool isVisible) |
virtual void | setDirty (int, bool dirty, bool propagate=true, Node *dirtySource=NULL) |
virtual bool | isLeafNode () const |
virtual void | accept (NodeVisitor &visitor) |
virtual awString::IString | getTemplateGeomId () const |
Returns an id of the root node of its
template geometry. |
|
void | setLightType (LightType type) |
kPoint is the initialized default. |
|
LightType | getLightType () const |
void | setLightTypeByName (const awString::IString &) |
The names for the light types are defined in
ParameterConstants and are case independent. |
|
awString::IString | getLightTypeName () const |
void | updateMatrixFromAttributes () |
const LightingRef | attributes () const |
bool | setAttributes (LightingRef lighting) |
const LightingRef | overriddenAttributes () |
Get attributes whose parameters take higher
priority than the original ones. |
|
const LightingRef | effectiveAttributes () const |
Get the final attributes for rendering,
including all parameters in overriddenAttributes and parameters in
original attributes that haven't been overridden. |
|
const
aw::unordered_set < ShadowCasterRef > & |
getShadowCasters () const |
void | resetShadowCasters () |
void | addShadowCaster (ShadowCasterRef) |
void | removeShadowCaster (ShadowCasterRef) |
bool | isIllumination () const |
bool | isClipping () const |
void | setIsLightOn (bool isOn) |
bool | isLightOn () const |
void | setDefaultAttributes (LightingRef lighting) |
Sets the default attributes. |
|
const LightingRef | getDefaultAttributes (bool overriddenOnly=false) const |
Returns the default attributes if
overriddenOnly is false, otherwise only returns the overridden ones
of the default attributes. |
|
Static Public Member Functions |
|
static const awString::IString & | getGripId (LightType type) |
Returns a nodeId of the root of the geometry
for this light type light grip. |
|
Protected Member Functions |
|
virtual | ~Light () |
virtual void | parentTransformDirty () |
Static Protected Attributes |
|
static const awString::IString | thePointGripId |
static const awString::IString | theDirectGripId |
static const awString::IString | theSpotGripId |
static const awString::IString | theLinearGripId |
static const awString::IString | theClipPlaneGridId |
static const awString::IString | theClipBoxGridId |
enum LightType |
{ kPoint, kDirectional, kSpot, kLinear, kClipPlane, kClipBox, };
Light | ( | ) |
virtual ~Light | ( | ) | [protected, virtual] |
void setLightPosition | ( | const awLinear::Point & | value | ) |
The position is specified in world space.
Since this node is derived from the transform, we will take this value and adjust the transform to reflect the new world space position.
awLinear::Point getLightPosition | ( | ) | const |
void setLightDirection | ( | const awLinear::Normal & | value | ) |
The direction is specified in world space.
Since this node is derived from the transform, we will take this value and adjust the transform to reflect the new world space direction.
awLinear::Normal getLightDirection | ( | ) | const |
awString::IString getValueAsString | ( | const awString::IString & | name | ) | const |
You can access the position, direction and type through this interface as well.
setValueAsString() will return true if we created the parameter. If the parameter already exists set... will return false, and type will be ignored.
bool setValueAsString | ( | const awString::IString & | name, |
const awSupport::Parameter::Type | type, | ||
const awString::IString & | valueString | ||
) |
awSupport::ParameterRef getParameterByName | ( | const awString::IString & | name | ) | const |
You can get to all parameters this way.
However, setting the position, direction or type using this interface will mess things up as the other values will not be updated, and neither will the correct dirty flag.
virtual void setIsVisible | ( | bool | isVisible | ) | [virtual] |
Reimplemented from Node.
virtual void setIsAlternateVisible | ( | bool | isVisible | ) | [virtual] |
Reimplemented from Node.
virtual void setDirty | ( | int | , |
bool | dirty, | ||
bool | propagate = true , |
||
Node * | dirtySource =
NULL |
||
) | [virtual] |
Reimplemented from Node.
virtual bool isLeafNode | ( | ) | const [virtual] |
Reimplemented from Node.
virtual void accept | ( | NodeVisitor & | visitor | ) | [virtual] |
Reimplemented from Node.
virtual awString::IString getTemplateGeomId | ( | ) | const [virtual] |
Returns an id of the root node of its template geometry.
Implements Locator.
void setLightType | ( | LightType | type | ) |
kPoint is the initialized default.
LightType getLightType | ( | ) | const |
void setLightTypeByName | ( | const awString::IString & | ) |
The names for the light types are defined in ParameterConstants and are case independent.
awString::IString getLightTypeName | ( | ) | const |
void updateMatrixFromAttributes | ( | ) |
static const awString::IString& getGripId | ( | LightType | type | ) | [static] |
Returns a nodeId of the root of the geometry for this light type light grip.
const LightingRef attributes | ( | ) | const |
bool setAttributes | ( | LightingRef | lighting | ) |
const LightingRef overriddenAttributes | ( | ) |
Get attributes whose parameters take higher priority than the original ones.
const LightingRef effectiveAttributes | ( | ) | const |
Get the final attributes for rendering, including all parameters in overriddenAttributes and parameters in original attributes that haven't been overridden.
const aw::unordered_set<ShadowCasterRef>& getShadowCasters | ( | ) | const |
void resetShadowCasters | ( | ) |
void addShadowCaster | ( | ShadowCasterRef | ) |
void removeShadowCaster | ( | ShadowCasterRef | ) |
bool isIllumination | ( | ) | const |
bool isClipping | ( | ) | const |
void setIsLightOn | ( | bool | isOn | ) |
bool isLightOn | ( | ) | const |
void setDefaultAttributes | ( | LightingRef | lighting | ) |
Sets the default attributes.
const LightingRef getDefaultAttributes | ( | bool | overriddenOnly =
false |
) | const |
Returns the default attributes if overriddenOnly is false, otherwise only returns the overridden ones of the default attributes.
virtual void parentTransformDirty | ( | ) | [protected, virtual] |
Reimplemented from Node.
const awString::IString thePointGripId
[static, protected] |
const awString::IString theDirectGripId
[static, protected] |
const awString::IString theSpotGripId
[static, protected] |
const awString::IString theLinearGripId
[static, protected] |
const awString::IString theClipPlaneGridId
[static, protected] |
const awString::IString theClipBoxGridId
[static, protected] |