Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions
PolylightEffect Class Reference

A PolylightEffect can be used on a node to define a LightGroup for that node. More...

#include "polylightEffect.h"

Inheritance diagram for PolylightEffect:
RenderEffect TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Types

enum  ContribType { CT_proximal, CT_all }
typedef pvector< NodePathLightGroup

Public Member Functions

 CPT (RenderEffect) add_light(const NodePath &newlight) const
 CPT (RenderEffect) remove_light(const NodePath &newlight) const
 CPT (RenderEffect) set_weight(PN_stdfloat w) const
 CPT (RenderEffect) set_contrib(ContribType c) const
 CPT (RenderEffect) set_effect_center(const LPoint3 &ec) const
 CPT (RenderAttrib) do_poly_light(const SceneSetup *scene
virtual void cull_callback (CullTraverser *trav, CullTraverserData &data, CPT(TransformState)&node_transform, CPT(RenderState)&node_state) const
 If has_cull_callback() returns true, this function will be called during the cull traversal to perform any additional operations that should be performed at cull time.
virtual TypeHandle force_init_type ()
ContribType get_contrib () const
 Returns CT_all or CT_proximal.
LPoint3 get_effect_center () const
 Return the value of the _effect_center.
virtual TypeHandle get_type () const
PN_stdfloat get_weight () const
 Get the weight value.
virtual bool has_cull_callback () const
 Should be overridden by derived classes to return true if cull_callback() has been defined.
bool has_light (const NodePath &light) const
 Returns true if the indicated light is listed in the PolylightEffect, false otherwise.
virtual void output (ostream &out) const

Static Public Member Functions

static CPT (RenderEffect) make()
static CPT (RenderEffect) make(PN_stdfloat weight
static CPT (RenderEffect) make(PN_stdfloat weight
static TypeHandle get_class_type ()
static void init_type ()

Public Attributes

const CullTraverserData const
TransformState *node_transform 
const
static ContribType contrib
const CullTraverserDatadata
static ContribType const LPoint3effect_center
static ContribType const
LPoint3 const LightGroup & 
lights

Protected Member Functions

 PolylightEffect ()
 Use PolylightEffect::make() to construct a new PolylightEffect object.
 PolylightEffect (const PolylightEffect &copy)
 Copy Constructor used by the const methods to modify data on a copy and return a new one.
virtual int compare_to_impl (const RenderEffect *other) const
 Intended to be overridden by derived PolylightEffect types to return a unique number indicating whether this PolylightEffect is equivalent to the other one.

Detailed Description

A PolylightEffect can be used on a node to define a LightGroup for that node.

A LightGroup contains PolylightNodes which are essentially nodes that add color to the polygons of a model based on distance. PolylightNode is a cheap way to get lighting effects specially for night scenes

Definition at line 39 of file polylightEffect.h.


Constructor & Destructor Documentation

PolylightEffect::PolylightEffect ( ) [inline, protected]

Use PolylightEffect::make() to construct a new PolylightEffect object.

Definition at line 23 of file polylightEffect.I.

PolylightEffect::PolylightEffect ( const PolylightEffect copy) [inline, protected]

Copy Constructor used by the const methods to modify data on a copy and return a new one.

Definition at line 33 of file polylightEffect.I.


Member Function Documentation

int PolylightEffect::compare_to_impl ( const RenderEffect other) const [protected, virtual]

Intended to be overridden by derived PolylightEffect types to return a unique number indicating whether this PolylightEffect is equivalent to the other one.

This should return 0 if the two PolylightEffect 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 PolylightEffect objects whose get_type() functions return the same.

Reimplemented from RenderEffect.

Definition at line 384 of file polylightEffect.cxx.

void PolylightEffect::cull_callback ( CullTraverser trav,
CullTraverserData data,
CPT(TransformState)&  node_transform,
CPT(RenderState)&  node_state 
) const [virtual]

If has_cull_callback() returns true, this function will be called during the cull traversal to perform any additional operations that should be performed at cull time.

This may include additional manipulation of render state or additional visible/invisible decisions, or any other arbitrary operation.

At the time this function is called, the current node's transform and state have not yet been applied to the net_transform and net_state. This callback may modify the node_transform and node_state to apply an effective change to the render state at this level.

Reimplemented from RenderEffect.

Definition at line 104 of file polylightEffect.cxx.

References CullTraverser::get_scene().

PolylightEffect::ContribType PolylightEffect::get_contrib ( ) const [inline]

Returns CT_all or CT_proximal.

Definition at line 57 of file polylightEffect.I.

Return the value of the _effect_center.

Definition at line 67 of file polylightEffect.I.

PN_stdfloat PolylightEffect::get_weight ( ) const [inline]

Get the weight value.

Definition at line 47 of file polylightEffect.I.

bool PolylightEffect::has_cull_callback ( ) const [virtual]

Should be overridden by derived classes to return true if cull_callback() has been defined.

Otherwise, returns false to indicate cull_callback() does not need to be called for this effect during the cull traversal.

Reimplemented from RenderEffect.

Definition at line 82 of file polylightEffect.cxx.

bool PolylightEffect::has_light ( const NodePath light) const

Returns true if the indicated light is listed in the PolylightEffect, false otherwise.

Definition at line 496 of file polylightEffect.cxx.

Referenced by NodePath::has_light().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations