Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
FogAttrib Class Reference

Applies a Fog to the geometry at and below this node. More...

#include "fogAttrib.h"

Inheritance diagram for FogAttrib:
RenderAttrib TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

virtual int complete_pointers (TypedWritable **plist, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
virtual TypeHandle force_init_type ()
Fogget_fog () const
 If the FogAttrib is not an 'off' FogAttrib, returns the fog that is associated.
virtual int get_slot () const
virtual TypeHandle get_type () const
bool is_off () const
 Returns true if the FogAttrib is an 'off' FogAttrib, indicating that it should disable fog.
virtual void output (ostream &out) const
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 CPT (RenderAttrib) make(Fog *fog)
static CPT (RenderAttrib) make_off()
static CPT (RenderAttrib) make_default()
static int get_class_slot ()
static TypeHandle get_class_type ()
static void init_type ()
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type FogAttrib.

Protected Member Functions

virtual int compare_to_impl (const RenderAttrib *other) const
 Intended to be overridden by derived FogAttrib types to return a unique number indicating whether this FogAttrib is equivalent to the other one.
virtual CPT (RenderAttrib) get_auto_shader_attrib_impl(const RenderState *state) const
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 FogAttrib.
virtual size_t get_hash_impl () const
 Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type FogAttrib is encountered in the Bam file.

Detailed Description

Applies a Fog to the geometry at and below this node.

Definition at line 27 of file fogAttrib.h.


Member Function Documentation

int FogAttrib::compare_to_impl ( const RenderAttrib other) const [protected, virtual]

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

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

Reimplemented from RenderAttrib.

Definition at line 93 of file fogAttrib.cxx.

int FogAttrib::complete_pointers ( TypedWritable **  p_list,
BamReader manager 
) [virtual]

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

Reimplemented from TypedWritable.

Definition at line 165 of file fogAttrib.cxx.

void FogAttrib::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 FogAttrib.

Reimplemented from RenderAttrib.

Definition at line 204 of file fogAttrib.cxx.

References BamReader::read_pointer().

Referenced by make_from_bam().

Fog * FogAttrib::get_fog ( ) const [inline]

If the FogAttrib is not an 'off' FogAttrib, returns the fog that is associated.

Otherwise, return NULL.

Definition at line 45 of file fogAttrib.I.

Referenced by GraphicsStateGuardian::fetch_specified_part(), NodePath::get_fog(), and CullTraverser::traverse().

size_t FogAttrib::get_hash_impl ( ) const [protected, virtual]

Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.

RenderAttribs that compare the same with compare_to_impl(), above, should return the same hash; RenderAttribs that compare differently should return a different hash.

Reimplemented from RenderAttrib.

Definition at line 117 of file fogAttrib.cxx.

References pointer_hash::add_hash().

bool FogAttrib::is_off ( ) const [inline]

Returns true if the FogAttrib is an 'off' FogAttrib, indicating that it should disable fog.

Definition at line 33 of file fogAttrib.I.

Referenced by ShaderGenerator::analyze_renderstate(), NodePath::has_fog(), and NodePath::has_fog_off().

TypedWritable * FogAttrib::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of type FogAttrib is encountered in the Bam file.

It should create the FogAttrib and extract its information from the file.

Definition at line 185 of file fogAttrib.cxx.

References fillin().

Referenced by register_with_read_factory().

Tells the BamReader how to create objects of type FogAttrib.

Definition at line 140 of file fogAttrib.cxx.

References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().

void FogAttrib::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 RenderAttrib.

Definition at line 151 of file fogAttrib.cxx.

References BamWriter::write_pointer().


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