Indicates which set of lights should be considered "on" to illuminate geometry at this level and below. More...
Public Types | |
enum | Operation { OSet = 0, OAdd = 1, ORemove = 2 } |
Public Member Functions | |
RenderAttrib const | addLight (Light light) |
Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights. | |
RenderAttrib const | addOffLight (NodePath const light) |
Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights turned off by this attrib. | |
RenderAttrib const | addOnLight (NodePath const light) |
Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights turned on by this attrib. | |
LightAttrib const | filterToMax (int max_lights) |
Returns a new LightAttrib, very much like this one, but with the number of on_lights reduced to be no more than max_lights. | |
Light | getLight (int n) |
Returns the nth light listed in the attribute. | |
NodePath | getMostImportantLight () |
Returns the most important light (that is, the light with the highest priority) in the LightAttrib, excluding any ambient lights. | |
int | getNumLights () |
Returns the number of lights listed in the attribute. | |
int | getNumOffLights () |
Returns the number of lights that are turned off by the attribute. | |
int | getNumOnLights () |
Returns the number of lights that are turned on by the attribute. | |
NodePath | getOffLight (int n) |
Returns the nth light turned off by the attribute, sorted in arbitrary (pointer) order. | |
list | getOffLights () |
NodePath | getOnLight (int n) |
Returns the nth light turned on by the attribute, sorted in render order. | |
list | getOnLights () |
Operation | getOperation () |
Returns the basic operation type of the LightAttrib. | |
bool | hasAllOff () |
Returns true if this attrib turns off all lights (although it may also turn some on). | |
bool | hasLight (Light light) |
Returns true if the indicated light is listed in the attrib, false otherwise. | |
bool | hasOffLight (NodePath const light) |
Returns true if the indicated light is turned off by the attrib, false otherwise. | |
bool | hasOnLight (NodePath const light) |
Returns true if the indicated light is turned on by the attrib, false otherwise. | |
bool | isIdentity () |
Returns true if this is an identity attrib: it does not change the set of lights in use. | |
RenderAttrib const | removeLight (Light light) |
Returns a new LightAttrib, just like this one, but with the indicated light removed from the list of lights. | |
RenderAttrib const | removeOffLight (NodePath const light) |
Returns a new LightAttrib, just like this one, but with the indicated light removed from the list of lights turned off by this attrib. | |
RenderAttrib const | removeOnLight (NodePath const light) |
Returns a new LightAttrib, just like this one, but with the indicated light removed from the list of lights turned on by this attrib. | |
Static Public Member Functions | |
static int | getClassSlot () |
static TypeHandle | getClassType () |
static RenderAttrib const | make () |
Constructs a new LightAttrib object that does nothing. | |
static RenderAttrib const | make (Operation op, Light light) |
Constructs a new LightAttrib object that turns on (or off, according to op) the indicated light(s). | |
static RenderAttrib const | make (Operation op, Light light1, Light light2) |
Constructs a new LightAttrib object that turns on (or off, according to op) the indicate light(s). | |
static RenderAttrib const | make (Operation op, Light light1, Light light2, Light light3) |
Constructs a new LightAttrib object that turns on (or off, according to op) the indicate light(s). | |
static RenderAttrib const | make (Operation op, Light light1, Light light2, Light light3, Light light4) |
Constructs a new LightAttrib object that turns on (or off, according to op) the indicate light(s). | |
static RenderAttrib const | makeAllOff () |
Constructs a new LightAttrib object that turns off all lights (and hence disables lighting). | |
static RenderAttrib const | makeDefault () |
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be. |
Indicates which set of lights should be considered "on" to illuminate geometry at this level and below.
A LightAttrib can either add lights or remove lights from the total set of "on" lights.
enum Operation |
RenderAttrib const addLight | ( | Light | light | ) |
Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights.
This method is now deprecated. Use add_on_light() or add_off_light() instead.
RenderAttrib const addOffLight | ( | NodePath const | light | ) |
Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights turned off by this attrib.
RenderAttrib const addOnLight | ( | NodePath const | light | ) |
Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights turned on by this attrib.
LightAttrib const filterToMax | ( | int | max_lights | ) |
Returns a new LightAttrib, very much like this one, but with the number of on_lights reduced to be no more than max_lights.
The number of off_lights in the new LightAttrib is undefined.
The number of AmbientLights is not included in the count. All AmbientLights in the original attrib are always included in the result, regardless of the value of max_lights.
static int getClassSlot | ( | ) | [static] |
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from RenderAttrib.
Returns the nth light listed in the attribute.
This method is now deprecated. LightAttribs nowadays have a separate list of on_lights and off_lights, so this method doesn't make sense. Query the lists independently.
Returns the most important light (that is, the light with the highest priority) in the LightAttrib, excluding any ambient lights.
Returns an empty NodePath if no non-ambient lights are found.
int getNumLights | ( | ) |
Returns the number of lights listed in the attribute.
This method is now deprecated. LightAttribs nowadays have a separate list of on_lights and off_lights, so this method doesn't make sense. Query the lists independently.
int getNumOffLights | ( | ) |
Returns the number of lights that are turned off by the attribute.
int getNumOnLights | ( | ) |
Returns the number of lights that are turned on by the attribute.
NodePath getOffLight | ( | int | n | ) |
Returns the nth light turned off by the attribute, sorted in arbitrary (pointer) order.
list getOffLights | ( | ) |
NodePath getOnLight | ( | int | n | ) |
Returns the nth light turned on by the attribute, sorted in render order.
list getOnLights | ( | ) |
Returns the basic operation type of the LightAttrib.
If this is O_set, the lights listed here completely replace any lights that were already on. If this is O_add, the lights here are added to the set of of lights that were already on, and if O_remove, the lights here are removed from the set of lights that were on.
This method is now deprecated. LightAttribs nowadays have a separate list of on_lights and off_lights, so this method doesn't make sense. Query the lists independently.
bool hasAllOff | ( | ) |
Returns true if this attrib turns off all lights (although it may also turn some on).
Returns true if the indicated light is listed in the attrib, false otherwise.
This method is now deprecated. LightAttribs nowadays have a separate list of on_lights and off_lights, so this method doesn't make sense. Query the lists independently.
bool hasOffLight | ( | NodePath const | light | ) |
Returns true if the indicated light is turned off by the attrib, false otherwise.
bool hasOnLight | ( | NodePath const | light | ) |
Returns true if the indicated light is turned on by the attrib, false otherwise.
bool isIdentity | ( | ) |
Returns true if this is an identity attrib: it does not change the set of lights in use.
static RenderAttrib const make | ( | ) | [static] |
Constructs a new LightAttrib object that does nothing.
static RenderAttrib const make | ( | Operation | op, |
Light | light | ||
) | [static] |
Constructs a new LightAttrib object that turns on (or off, according to op) the indicated light(s).
This method is now deprecated. Use add_on_light() or add_off_light() instead.
static RenderAttrib const make | ( | Operation | op, |
Light | light1, | ||
Light | light2 | ||
) | [static] |
Constructs a new LightAttrib object that turns on (or off, according to op) the indicate light(s).
This method is now deprecated. Use add_on_light() or add_off_light() instead.
Constructs a new LightAttrib object that turns on (or off, according to op) the indicate light(s).
This method is now deprecated. Use add_on_light() or add_off_light() instead.
static RenderAttrib const make | ( | Operation | op, |
Light | light1, | ||
Light | light2, | ||
Light | light3, | ||
Light | light4 | ||
) | [static] |
Constructs a new LightAttrib object that turns on (or off, according to op) the indicate light(s).
This method is now deprecated. Use add_on_light() or add_off_light() instead.
static RenderAttrib const makeAllOff | ( | ) | [static] |
Constructs a new LightAttrib object that turns off all lights (and hence disables lighting).
static RenderAttrib const makeDefault | ( | ) | [static] |
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.
RenderAttrib const removeLight | ( | Light | light | ) |
Returns a new LightAttrib, just like this one, but with the indicated light removed from the list of lights.
This method is now deprecated. Use remove_on_light() or remove_off_light() instead.
RenderAttrib const removeOffLight | ( | NodePath const | light | ) |
Returns a new LightAttrib, just like this one, but with the indicated light removed from the list of lights turned off by this attrib.
RenderAttrib const removeOnLight | ( | NodePath const | light | ) |
Returns a new LightAttrib, just like this one, but with the indicated light removed from the list of lights turned on by this attrib.