|
|
|
Indicates which set of lights should be considered "on" to illuminate geometry at this level and below.
More...
#include "lightAttrib.h"
List of all members.
Classes |
| class | BamAuxData |
Public Types |
|
typedef pvector< PT(PandaNode) > | NodeList |
| enum | Operation { O_set,
O_add,
O_remove
} |
Public Member Functions |
| virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
| | Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
|
|
| CPT (RenderAttrib) add_on_light(const NodePath &light) const |
|
| CPT (RenderAttrib) remove_on_light(const NodePath &light) const |
|
| CPT (RenderAttrib) add_off_light(const NodePath &light) const |
|
| CPT (RenderAttrib) remove_off_light(const NodePath &light) const |
|
| CPT (LightAttrib) filter_to_max(int max_lights) const |
|
| CPT (RenderAttrib) add_light(Light *light) const |
|
| CPT (RenderAttrib) remove_light(Light *light) const |
| virtual void | finalize (BamReader *manager) |
| | Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.
|
|
virtual TypeHandle | force_init_type () |
| Light * | get_light (int n) const |
| | Returns the nth light listed in the attribute.
|
| NodePath | get_most_important_light () const |
| | Returns the most important light (that is, the light with the highest priority) in the LightAttrib, excluding any ambient lights.
|
| int | get_num_lights () const |
| | Returns the number of lights listed in the attribute.
|
| int | get_num_off_lights () const |
| | Returns the number of lights that are turned off by the attribute.
|
| int | get_num_on_lights () const |
| | Returns the number of lights that are turned on by the attribute.
|
| NodePath | get_off_light (int n) const |
| | Returns the nth light turned off by the attribute, sorted in arbitrary (pointer) order.
|
| NodePath | get_on_light (int n) const |
| | Returns the nth light turned on by the attribute, sorted in render order.
|
| Operation | get_operation () const |
| | Returns the basic operation type of the LightAttrib.
|
|
virtual int | get_slot () const |
|
virtual TypeHandle | get_type () const |
| bool | has_all_off () const |
| | Returns true if this attrib turns off all lights (although it may also turn some on).
|
| bool | has_light (Light *light) const |
| | Returns true if the indicated light is listed in the attrib, false otherwise.
|
| bool | has_off_light (const NodePath &light) const |
| | Returns true if the indicated light is turned off by the attrib, false otherwise.
|
| bool | has_on_light (const NodePath &light) const |
| | Returns true if the indicated light is turned on by the attrib, false otherwise.
|
| bool | is_identity () const |
| | Returns true if this is an identity attrib: it does not change the set of lights in use.
|
|
| MAKE_SEQ (get_on_lights, get_num_on_lights, get_on_light) |
|
| MAKE_SEQ (get_off_lights, get_num_off_lights, get_off_light) |
|
virtual void | output (ostream &out) const |
|
virtual void | write (ostream &out, int indent_level) const |
| virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
| | Writes the contents of this object to the datagram for shipping out to a Bam file.
|
Static Public Member Functions |
|
static | CPT (RenderAttrib) make(Operation op |
|
static | CPT (RenderAttrib) make(Operation op |
|
static | CPT (RenderAttrib) make(Operation op |
|
static | CPT (RenderAttrib) make_default() |
|
static | CPT (RenderAttrib) make(Operation op |
|
static | CPT (RenderAttrib) make_all_off() |
|
static | CPT (RenderAttrib) make() |
|
static int | get_class_slot () |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
| static void | register_with_read_factory () |
| | Tells the BamReader how to create objects of type LightAttrib.
|
Public Attributes |
|
static Light * | light |
|
static Light * | light1 |
|
static Light Light * | light2 |
|
static Light Light Light * | light3 |
|
static Light Light Light Light * | light4 |
Protected Member Functions |
| | LightAttrib () |
| | Use LightAttrib::make() to construct a new LightAttrib object.
|
| | LightAttrib (const LightAttrib ©) |
| | Use LightAttrib::make() to construct a new LightAttrib object.
|
| virtual int | compare_to_impl (const RenderAttrib *other) const |
| | Intended to be overridden by derived LightAttrib types to return a unique number indicating whether this LightAttrib is equivalent to the other one.
|
|
virtual | CPT (RenderAttrib) compose_impl(const RenderAttrib *other) const |
|
virtual | CPT (RenderAttrib) invert_compose_impl(const RenderAttrib *other) const |
| 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 LightAttrib.
|
Static Protected Member Functions |
| static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
| | This function is called by the BamReader's factory when a new object of type LightAttrib is encountered in the Bam file.
|
Detailed Description
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.
Definition at line 33 of file lightAttrib.h.
Constructor & Destructor Documentation
| LightAttrib::LightAttrib |
( |
| ) |
[inline, protected] |
| LightAttrib::LightAttrib |
( |
const LightAttrib & |
copy | ) |
[inline, protected] |
Use LightAttrib::make() to construct a new LightAttrib object.
The copy constructor is only defined to facilitate methods like add_on_light().
Definition at line 35 of file lightAttrib.I.
Member Function Documentation
| int LightAttrib::compare_to_impl |
( |
const RenderAttrib * |
other | ) |
const [protected, virtual] |
| void LightAttrib::finalize |
( |
BamReader * |
manager | ) |
[virtual] |
| Light * LightAttrib::get_light |
( |
int |
n | ) |
const |
| NodePath LightAttrib::get_most_important_light |
( |
| ) |
const |
| int LightAttrib::get_num_lights |
( |
| ) |
const |
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.
Definition at line 273 of file lightAttrib.cxx.
References get_num_off_lights(), and get_num_on_lights().
| int LightAttrib::get_num_off_lights |
( |
| ) |
const [inline] |
| int LightAttrib::get_num_on_lights |
( |
| ) |
const [inline] |
| NodePath LightAttrib::get_off_light |
( |
int |
n | ) |
const [inline] |
| NodePath LightAttrib::get_on_light |
( |
int |
n | ) |
const [inline] |
| LightAttrib::Operation LightAttrib::get_operation |
( |
| ) |
const |
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.
Definition at line 247 of file lightAttrib.cxx.
References get_num_off_lights(), and has_all_off().
| bool LightAttrib::has_all_off |
( |
| ) |
const [inline] |
| bool LightAttrib::has_light |
( |
Light * |
light | ) |
const |
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.
Definition at line 318 of file lightAttrib.cxx.
References get_num_off_lights(), has_off_light(), and has_on_light().
| bool LightAttrib::has_off_light |
( |
const NodePath & |
light | ) |
const [inline] |
| bool LightAttrib::has_on_light |
( |
const NodePath & |
light | ) |
const [inline] |
| bool LightAttrib::is_identity |
( |
| ) |
const [inline] |
| void LightAttrib::register_with_read_factory |
( |
| ) |
[static] |
The documentation for this class was generated from the following files:
| | |