Panda3D
Functions
lightAttrib.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "lightAttrib.h"
#include "pandaNode.h"
#include "nodePath.h"
#include "graphicsStateGuardianBase.h"
#include "bamReader.h"
#include "bamWriter.h"
#include "datagram.h"
#include "datagramIterator.h"
#include "config_pgraph.h"
#include "attribNodeRegistry.h"
#include "indent.h"
#include <iterator>

Go to the source code of this file.

Functions

 CPT (RenderAttrib) LightAttrib
 Constructs a new LightAttrib object that turns on (or off, according to op) the indicated light(s). More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
2002-03-26

Definition in file lightAttrib.cxx.

Function Documentation

◆ CPT()

CPT ( RenderAttrib  )

Constructs a new LightAttrib object that turns on (or off, according to op) the indicated light(s).

Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights turned on by this attrib.

Constructs a new LightAttrib object that turns off all lights (and hence disables lighting).

Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights.

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

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.

This method is now deprecated. Use add_on_light() or add_off_light() instead. 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. Constructs a new LightAttrib object that does nothing.

Returns a new LightAttrib, just like this one, but with the indicated light removed from the list of lights turned on by this attrib. Returns a new LightAttrib, just like this one, but with the indicated light added to the list of lights turned off by this attrib. Returns a new LightAttrib, just like this one, but with the indicated light removed from the list of lights turned off by this attrib. 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. Returns the total contribution of all the ambient lights. Intended to be overridden by derived LightAttrib types to return a unique number indicating whether this LightAttrib is equivalent to the other one.

This should return 0 if the two LightAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.

This will only be called with two LightAttrib objects whose get_type() functions return the same. Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties. RenderAttribs that compare the same with compare_to_impl(), above, should return the same hash; RenderAttribs that compare differently should return a different hash. Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib objects of the same type interact.

This should return the result of applying the other RenderAttrib to a node in the scene graph below this RenderAttrib, which was already applied. In most cases, the result is the same as the other RenderAttrib (that is, a subsequent RenderAttrib completely replaces the preceding one). On the other hand, some kinds of RenderAttrib (for instance, ColorTransformAttrib) might combine in meaningful ways. Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib objects of the same type interact.

See invert_compose() and compose_impl(). Makes sure the lights are sorted in order of priority. Also counts the number of non-ambient lights.

Definition at line 95 of file lightAttrib.cxx.