|
|
|
The abstract interface to all kinds of lights.
More...
#include "light.h"
List of all members.
Classes |
| class | CData |
Public Member Functions |
|
| Light (const Light ©) |
|
virtual PandaNode * | as_node ()=0 |
|
virtual void | bind (GraphicsStateGuardianBase *gsg, const NodePath &light, int light_id)=0 |
|
virtual int | get_class_priority () const =0 |
| const LColor & | get_color () const |
| | Returns the basic color of the light.
|
| int | get_priority () const |
| | Returns the priority associated with this light.
|
|
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.
|
| GeomNode * | get_viz () |
| | Returns a GeomNode that may be rendered to visualize the Light.
|
| virtual bool | is_ambient_light () const |
| | Returns true if this is an AmbientLight, false if it is some other kind of light.
|
|
virtual void | output (ostream &out) const =0 |
| void | set_color (const LColor &color) |
| | Sets the basic color of the light.
|
| void | set_priority (int priority) |
| | Changes the relative importance of this light relative to the other lights that are applied simultaneously.
|
|
virtual void | write (ostream &out, int indent_level) const =0 |
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static UpdateSeq | get_sort_seq () |
| | Returns a global sequence number that is incremented any time any Light in the world changes sort or priority.
|
|
static void | init_type () |
Protected Types |
| enum | ClassPriority { CP_ambient_priority,
CP_point_priority,
CP_directional_priority,
CP_spot_priority
} |
Protected Member Functions |
| virtual void | fill_viz_geom (GeomNode *viz_geom) |
| | Fills the indicated GeomNode up with Geoms suitable for rendering this light.
|
| void | fillin (DatagramIterator &scan, BamReader *manager) |
| | This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new Light.
|
| void | mark_viz_stale () |
| | Indicates that the internal visualization object will need to be updated.
|
| void | write_datagram (BamWriter *manager, Datagram &dg) |
| | Writes the contents of this object to the datagram for shipping out to a Bam file.
|
Detailed Description
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 42 of file light.h.
Member Function Documentation
| void Light::fill_viz_geom |
( |
GeomNode * |
viz_geom | ) |
[protected, virtual] |
| const LColor & Light::get_color |
( |
| ) |
const [inline] |
| int Light::get_priority |
( |
| ) |
const [inline] |
| UpdateSeq Light::get_sort_seq |
( |
| ) |
[inline, static] |
Returns a global sequence number that is incremented any time any Light in the world changes sort or priority.
This is used by LightAttrib to determine when it is necessary to re-sort its internal array of stages.
Definition at line 132 of file light.I.
| 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 DirectionalLight, PointLight, and Spotlight.
Definition at line 97 of file light.cxx.
Returns a GeomNode that may be rendered to visualize the Light.
This is used during the cull traversal to render the Lights that have been made visible.
Definition at line 109 of file light.cxx.
References fill_viz_geom().
| bool Light::is_ambient_light |
( |
| ) |
const [virtual] |
| void Light::mark_viz_stale |
( |
| ) |
[inline, protected] |
| void Light::set_color |
( |
const LColor & |
color | ) |
[inline] |
| void Light::set_priority |
( |
int |
priority | ) |
[inline] |
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 103 of file light.I.
The documentation for this class was generated from the following files:
| | |