Panda3D
|
A Level-of-Detail node with alpha based switching. More...
#include "fadeLodNode.h"
Public Member Functions | |
FadeLODNode (const string &name) | |
virtual bool | cull_callback (CullTraverser *trav, CullTraverserData &data) |
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 () |
int | get_fade_bin_draw_order () const |
Returns the draw order that is assigned (along with the bin name) to the fading part of the geometry during a transition. | |
const string & | get_fade_bin_name () const |
Returns the cull bin that is assigned to the fading part of the geometry during a transition. | |
int | get_fade_state_override () const |
Returns the override value that is applied to the state changes necessary to apply the fade effect. | |
PN_stdfloat | get_fade_time () const |
get the time taken to complete an LOD switch | |
virtual TypeHandle | get_type () const |
virtual PandaNode * | make_copy () const |
Returns a newly-allocated Node that is a shallow copy of this one. | |
virtual void | output (ostream &out) const |
Outputs the Namable. | |
void | set_fade_bin (const string &name, int draw_order) |
Specifies the cull bin and draw order that is assigned to the fading part of the geometry during a transition. | |
void | set_fade_state_override (int override) |
Specifies the override value that is applied to the state changes necessary to apply the fade effect. | |
void | set_fade_time (PN_stdfloat t) |
set the time taken to complete an LOD switch | |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type LODNode. | |
Protected Member Functions | |
FadeLODNode (const FadeLODNode ©) | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new FadeLODNode. | |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type LODNode is encountered in the Bam file. |
A Level-of-Detail node with alpha based switching.
Definition at line 26 of file fadeLodNode.h.
bool FadeLODNode::cull_callback | ( | CullTraverser * | trav, |
CullTraverserData & | data | ||
) | [virtual] |
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.
Note that this function will *not* be called unless set_cull_callback() is called in the constructor of the derived class. It is necessary to call set_cull_callback() to indicated that we require cull_callback() to be called.
By the time this function is called, the node has already passed the bounding-volume test for the viewing frustum, and the node's transform and state have already been applied to the indicated CullTraverserData object.
The return value is true if this node should be visible, or false if it should be culled.
Reimplemented from LODNode.
Definition at line 99 of file fadeLodNode.cxx.
References LODNode::compute_child(), LODNode::consider_verify_lods(), Camera::get_aux_scene_data(), SceneSetup::get_camera_node(), PandaNode::get_child(), AuxSceneData::get_expiration_time(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), AuxSceneData::get_last_render_time(), WorkingNodePath::get_node_path(), PandaNode::get_num_children(), LODNode::get_out(), CullTraverser::get_scene(), LODNode::is_any_shown(), Camera::set_aux_scene_data(), AuxSceneData::set_duration(), AuxSceneData::set_last_render_time(), LODNode::show_switches_cull_callback(), and CullTraverser::traverse().
void FadeLODNode::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new FadeLODNode.
Reimplemented from LODNode.
Definition at line 426 of file fadeLodNode.cxx.
Referenced by make_from_bam().
int FadeLODNode::get_fade_bin_draw_order | ( | ) | const [inline] |
Returns the draw order that is assigned (along with the bin name) to the fading part of the geometry during a transition.
Definition at line 56 of file fadeLodNode.I.
const string & FadeLODNode::get_fade_bin_name | ( | ) | const [inline] |
Returns the cull bin that is assigned to the fading part of the geometry during a transition.
Definition at line 44 of file fadeLodNode.I.
int FadeLODNode::get_fade_state_override | ( | ) | const [inline] |
Returns the override value that is applied to the state changes necessary to apply the fade effect.
This should be larger than any attrib overrides on the fading geometry.
Definition at line 69 of file fadeLodNode.I.
PN_stdfloat FadeLODNode::get_fade_time | ( | ) | const [inline] |
get the time taken to complete an LOD switch
Definition at line 32 of file fadeLodNode.I.
PandaNode * FadeLODNode::make_copy | ( | ) | const [virtual] |
TypedWritable * FadeLODNode::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type LODNode is encountered in the Bam file.
It should create the LODNode and extract its information from the file.
Reimplemented from LODNode.
Definition at line 407 of file fadeLodNode.cxx.
References fillin().
Referenced by register_with_read_factory().
void FadeLODNode::output | ( | ostream & | out | ) | const [virtual] |
Outputs the Namable.
This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.
Reimplemented from LODNode.
Definition at line 265 of file fadeLodNode.cxx.
void FadeLODNode::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type LODNode.
Reimplemented from LODNode.
Definition at line 383 of file fadeLodNode.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
void FadeLODNode::set_fade_bin | ( | const string & | name, |
int | draw_order | ||
) |
Specifies the cull bin and draw order that is assigned to the fading part of the geometry during a transition.
Definition at line 278 of file fadeLodNode.cxx.
void FadeLODNode::set_fade_state_override | ( | int | override | ) |
Specifies the override value that is applied to the state changes necessary to apply the fade effect.
This should be larger than any attrib overrides on the fading geometry.
Definition at line 294 of file fadeLodNode.cxx.
void FadeLODNode::set_fade_time | ( | PN_stdfloat | t | ) | [inline] |
set the time taken to complete an LOD switch
Definition at line 22 of file fadeLodNode.I.
void FadeLODNode::write_datagram | ( | BamWriter * | manager, |
Datagram & | dg | ||
) | [virtual] |
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from LODNode.
Definition at line 394 of file fadeLodNode.cxx.