# Light

from pandac.PandaModules import Light

Class : Light
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.

## Inheritance:

Light: ReferenceCount
ReferenceCount:

## Methods of Light:

asNode
getClassPriority
getClassType
getColor
getPriority
setColor
setPriority

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
unref

asNode virtual PandaNode *Light::as_node(void) = 0; Undocumented function.

getClassPriority virtual int Light::get_class_priority(void) const = 0; Undocumented function.

getClassType static TypeHandle Light::get_class_type(void); Undocumented function.

getColor LVecBase4f const &Light::get_color(void) const; Description: Returns the basic color of the light.

getPriority int Light::get_priority(void) const; Description: Returns the priority associated with this light. See set_priority().

setColor void Light::set_color(LVecBase4f const &color); Description: Sets the basic color of the light.

setPriority void Light::set_priority(int priority); Description: 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().

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is true if the new reference count is nonzero, false if it is zero.