Panda3D
Public Member Functions | Static Public Member Functions | List of all members
Light Class Reference

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. More...

Inheritance diagram for Light:
LightLensNode LightNode DirectionalLight PointLight Spotlight AmbientLight

Public Member Functions

PandaNode asNode ()
 
const LVecBase3 getAttenuation ()
 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. More...
 
int getClassPriority ()
 
const LColor getColor ()
 Returns the basic color of the light. More...
 
float getExponent ()
 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. More...
 
int getPriority ()
 Returns the priority associated with this light. See set_priority(). More...
 
const LColor getSpecularColor ()
 Returns the color of specular highlights generated by the light. This value is meaningless for ambient lights. More...
 
bool isAmbientLight ()
 Returns true if this is an AmbientLight, false if it is some other kind of light. More...
 
 setColor (const LColor color)
 Sets the basic color of the light. More...
 
 setPriority (int priority)
 Changes the relative importance of this light relative to the other lights that are applied simultaneously. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 

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.

Member Function Documentation

◆ asNode()

PandaNode asNode ( )

◆ getAttenuation()

const LVecBase3 getAttenuation ( )

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.

◆ getClassPriority()

int getClassPriority ( )

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getColor()

const LColor getColor ( )

Returns the basic color of the light.

◆ getExponent()

float getExponent ( )

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.

◆ getPriority()

int getPriority ( )

Returns the priority associated with this light. See set_priority().

◆ getSpecularColor()

const LColor getSpecularColor ( )

Returns the color of specular highlights generated by the light. This value is meaningless for ambient lights.

◆ isAmbientLight()

bool isAmbientLight ( )

Returns true if this is an AmbientLight, false if it is some other kind of light.

◆ setColor()

setColor ( const LColor  color)

Sets the basic color of the light.

◆ setPriority()

setPriority ( int  priority)

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().