|
| Light (const Light ©) |
|
virtual PandaNode * | as_node ()=0 |
|
virtual void | attrib_ref () |
| This is called when the light is added to a LightAttrib. More...
|
|
virtual void | attrib_unref () |
| This is called when the light is removed from a LightAttrib. More...
|
|
virtual void | bind (GraphicsStateGuardianBase *gsg, const NodePath &light, int light_id)=0 |
|
virtual const LVecBase3 & | get_attenuation () const |
| Returns the terms of the attenuation equation for the light. More...
|
|
virtual int | get_class_priority () const =0 |
|
const LColor & | get_color () const |
|
PN_stdfloat | get_color_temperature () const |
|
virtual PN_stdfloat | get_exponent () const |
| For spotlights, returns the exponent that controls the amount of light falloff from the center of the spotlight. More...
|
|
int | get_priority () const |
|
virtual const LColor & | get_specular_color () const |
| Returns the color of specular highlights generated by the light. More...
|
|
virtual TypeHandle | get_type () const |
|
virtual bool | get_vector_to_light (LVector3 &result, const LPoint3 &from_object_point, const LMatrix4 &to_object_space) |
| Computes the vector from a particular vertex to this light. More...
|
|
GeomNode * | get_viz () |
| Returns a GeomNode that may be rendered to visualize the Light. More...
|
|
bool | has_color_temperature () const |
| Returns true if the color was specified as a temperature in kelvins, and get_color_temperature is defined. More...
|
|
virtual bool | is_ambient_light () const |
| Returns true if this is an AmbientLight, false if it is some other kind of light. More...
|
|
virtual void | output (std::ostream &out) const =0 |
|
void | set_color (const LColor &color) |
|
void | set_color_temperature (PN_stdfloat temperature) |
|
void | set_priority (int priority) |
|
virtual void | write (std::ostream &out, int indent_level) const =0 |
|
The abstract interface to all kinds of lights.
The actual light objects also inherit from PandaNode, and can therefore be added to the scene graph at some arbitrary point to define the coordinate system of effect.
Definition at line 38 of file light.h.
const LVecBase3 & Light::get_attenuation |
( |
| ) |
const |
|
virtual |
Returns the terms of the attenuation equation for the light.
These are, in order, the constant, linear, and quadratic terms based on the distance from the point to the vertex.
Reimplemented in Spotlight, and PointLight.
Definition at line 156 of file light.cxx.
PN_stdfloat Light::get_exponent |
( |
| ) |
const |
|
virtual |
For spotlights, returns the exponent that controls the amount of light falloff from the center of the spotlight.
For other kinds of lights, returns 0.
Reimplemented in Spotlight.
Definition at line 136 of file light.cxx.
bool Light::get_vector_to_light |
( |
LVector3 & |
result, |
|
|
const LPoint3 & |
from_object_point, |
|
|
const LMatrix4 & |
to_object_space |
|
) |
| |
|
virtual |
Computes the vector from a particular vertex to this light.
The exact vector depends on the type of light (e.g. point lights return a different result than directional lights).
The input parameters are the vertex position in question, expressed in object space, and the matrix which converts from light space to object space. The result is expressed in object space.
The return value is true if the result is successful, or false if it cannot be computed (e.g. for an ambient light).
Reimplemented in Spotlight, PointLight, and DirectionalLight.
Definition at line 188 of file light.cxx.
void Light::set_color_temperature |
Sets the color temperature of the light in kelvins.
This will recalculate the light's color.
The default value is 6500 K, corresponding to a perfectly white light assuming a D65 white point.
- Since
- 1.10.0
Definition at line 55 of file light.h.
Changes the relative importance of this light relative to the other lights that are applied simultaneously.
The priority number is used to decide which of the requested lights are to be selected for rendering when more lights are requested than the hardware will support. The highest-priority n lights are selected for rendering.
This is similar to TextureStage::set_priority().
Definition at line 64 of file light.h.