Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Types | Public Member Functions | Static Public Member Functions
PolylightNode Class Reference

A PolylightNode. More...

Inheritance diagram for PolylightNode:
PandaNode TypedWritable Namable LinkedListNode ReferenceCount TypedObject

List of all members.

Public Types

enum  Attenuation_Type { ALINEAR = 0, AQUADRATIC = 1 }
enum  Flicker_Type { FRANDOM = 0, FSIN = 1, FCUSTOM = 2 }

Public Member Functions

 PolylightNode (string name)
 Use PolylightNode() to construct a new PolylightNode object.
int compareTo (PolylightNode const other)
 Returns a number less than zero if this PolylightNode sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.
 disable ()
 Disable this light.
 enable ()
 Enable this light.
 flickerOff ()
 Turn flickering off.
 flickerOn ()
 Set flickering to true so at every loop this light's color is varied based on flicker_type.
float getA0 ()
 Get the quadratic attenuation factor a0 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
float getA1 ()
 Get the quadratic attenuation factor a1 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
float getA2 ()
 Get the quadratic attenuation factor a2 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
Attenuation_Type getAttenuation ()
 Get "linear" or "quadratic" attenuation type.
VBase4 getColor ()
 Returns the light's color as LColor.
VBase4 getColorScenegraph ()
 This differs from get_color in that when applying the light color we need to make sure that a color flattening external to the PolylightNode is not ignored.
Flicker_Type getFlickerType ()
 Returns FRANDOM or FSIN.
float getFreq ()
 Get frequency of sin flicker.
float getOffset ()
 Get the offset value for the random and sin flicker variations.
VBase3 getPos ()
 Returns position as a LPoint3.
float getRadius ()
 Get radius of the spherical light volume.
float getScale ()
 Get the scale value for the random and sin flicker variations.
float getStepSize ()
 Get the step size for the sin function in flicker This is the increment size for the value supplied to the sin function.
bool isEnabled ()
 Is this light is enabled/disabled?
bool isFlickering ()
 Check is this light is flickering.
bool operator!= (PolylightNode const other)
 Returns true if the two lights are not equivalent.
bool operator< (PolylightNode const other)
 Returns true if this PolylightNode sorts before the other one, false otherwise.
bool operator== (PolylightNode const other)
 Returns true if the two lights are equivalent that is, all their properties are same.
 setA0 (float a0)
 Set the quadratic attenuation factor a0 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
 setA1 (float a1)
 Set the quadratic attenuation factor a1 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
 setA2 (float a2)
 Set the quadratic attenuation factor a2 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
bool setAttenuation (Attenuation_Type type)
 Set ALINEAR or AQUADRATIC attenuation.
 setColor (VBase4 const color)
 Set the light's color...
 setColor (float r, float g, float b)
 Set the light's color...
bool setFlickerType (Flicker_Type type)
 Flicker type can be FRANDOM or FSIN At a later point there might be a FCUSTOM Custom flicker will be a set of fix points recorded by animating the light's intensity.
 setFreq (float f)
 Set frequency of sin flicker.
 setOffset (float offset)
 Set the offset value for the random and sin flicker variations...
 setPos (VBase3 const position)
 Set this light's position.
 setPos (float x, float y, float z)
 Set this light's position.
 setRadius (float r)
 Set radius of the spherical light volume.
 setScale (float scale)
 Set the scale value for the random and sin flicker variations...
 setStepSize (float step)
 Set the step size for the sin function in flicker This is the increment size for the value supplied to the sin function.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

A PolylightNode.


Member Enumeration Documentation

Enumerator:
ALINEAR 
AQUADRATIC 
Enumerator:
FRANDOM 
FSIN 
FCUSTOM 

Constructor & Destructor Documentation

PolylightNode ( string  name)

Use PolylightNode() to construct a new PolylightNode object.


Member Function Documentation

int compareTo ( PolylightNode const  other)

Returns a number less than zero if this PolylightNode sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.

Two PolylightNodes are considered equivalent if they consist of exactly the same properties Otherwise, they are different; different PolylightNodes will be ranked in a consistent but undefined ordering; the ordering is useful only for placing the PolylightNodes in a sorted container like an STL set.

disable ( )

Disable this light.

enable ( )

Enable this light.

Turn flickering off.

flickerOn ( )

Set flickering to true so at every loop this light's color is varied based on flicker_type.

float getA0 ( )

Get the quadratic attenuation factor a0 fd = 1 / ( a0 + a1*distance + a2*distance*distance)

float getA1 ( )

Get the quadratic attenuation factor a1 fd = 1 / ( a0 + a1*distance + a2*distance*distance)

float getA2 ( )

Get the quadratic attenuation factor a2 fd = 1 / ( a0 + a1*distance + a2*distance*distance)

Get "linear" or "quadratic" attenuation type.

static TypeHandle getClassType ( ) [static]

Reimplemented from PandaNode.

Returns the light's color as LColor.

This differs from get_color in that when applying the light color we need to make sure that a color flattening external to the PolylightNode is not ignored.

Returns FRANDOM or FSIN.

float getFreq ( )

Get frequency of sin flicker.

float getOffset ( )

Get the offset value for the random and sin flicker variations.

Returns position as a LPoint3.

float getRadius ( )

Get radius of the spherical light volume.

float getScale ( )

Get the scale value for the random and sin flicker variations.

float getStepSize ( )

Get the step size for the sin function in flicker This is the increment size for the value supplied to the sin function.

bool isEnabled ( )

Is this light is enabled/disabled?

bool isFlickering ( )

Check is this light is flickering.

bool operator!= ( PolylightNode const  other)

Returns true if the two lights are not equivalent.

bool operator< ( PolylightNode const  other)

Returns true if this PolylightNode sorts before the other one, false otherwise.

The sorting order of two nonequivalent PolylightNodes is consistent but undefined, and is useful only for storing PolylightNodes in a sorted container like an STL set.

bool operator== ( PolylightNode const  other)

Returns true if the two lights are equivalent that is, all their properties are same.

setA0 ( float  a0)

Set the quadratic attenuation factor a0 fd = 1 / ( a0 + a1*distance + a2*distance*distance)

setA1 ( float  a1)

Set the quadratic attenuation factor a1 fd = 1 / ( a0 + a1*distance + a2*distance*distance)

setA2 ( float  a2)

Set the quadratic attenuation factor a2 fd = 1 / ( a0 + a1*distance + a2*distance*distance)

Set ALINEAR or AQUADRATIC attenuation.

setColor ( VBase4 const  color)

Set the light's color...

setColor ( float  r,
float  g,
float  b 
)

Set the light's color...

3 floats between 0 and 1

bool setFlickerType ( Flicker_Type  type)

Flicker type can be FRANDOM or FSIN At a later point there might be a FCUSTOM Custom flicker will be a set of fix points recorded by animating the light's intensity.

setFreq ( float  f)

Set frequency of sin flicker.

setOffset ( float  offset)

Set the offset value for the random and sin flicker variations...

used to tweak the flicker This value is added to the variation

setPos ( VBase3 const  position)

Set this light's position.

setPos ( float  x,
float  y,
float  z 
)

Set this light's position.

setRadius ( float  r)

Set radius of the spherical light volume.

setScale ( float  scale)

Set the scale value for the random and sin flicker variations...

used to tweak the flicker This value is multiplied with the variation

setStepSize ( float  step)

Set the step size for the sin function in flicker This is the increment size for the value supplied to the sin function.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties