Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
CullFaceAttrib Class Reference

Indicates which faces should be culled based on their vertex ordering. More...

#include "cullFaceAttrib.h"

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

List of all members.

Public Types

enum  Mode { M_cull_none, M_cull_clockwise, M_cull_counter_clockwise, M_cull_unchanged }

Public Member Functions

virtual TypeHandle force_init_type ()
Mode get_actual_mode () const
 Returns the actual culling mode, without considering the effects of the reverse flag.
Mode get_effective_mode () const
 Returns the effective culling mode.
bool get_reverse () const
 Returns the 'reverse' flag.
virtual int get_slot () const
virtual TypeHandle get_type () const
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(Mode mode
static CPT (RenderAttrib) make_reverse()
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 CullFaceAttrib.

Protected Member Functions

virtual int compare_to_impl (const RenderAttrib *other) const
 Intended to be overridden by derived CullFaceAttrib types to return a unique number indicating whether this CullFaceAttrib is equivalent to the other one.
virtual CPT (RenderAttrib) compose_impl(const RenderAttrib *other) const
virtual CPT (RenderAttrib) invert_compose_impl(const RenderAttrib *other) 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 CullFaceAttrib.
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 CullFaceAttrib is encountered in the Bam file.

Detailed Description

Indicates which faces should be culled based on their vertex ordering.

Definition at line 29 of file cullFaceAttrib.h.


Member Function Documentation

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

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

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

Reimplemented from RenderAttrib.

Definition at line 156 of file cullFaceAttrib.cxx.

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

Reimplemented from RenderAttrib.

Definition at line 307 of file cullFaceAttrib.cxx.

References DatagramIterator::get_bool(), and DatagramIterator::get_int8().

Referenced by make_from_bam().

CullFaceAttrib::Mode CullFaceAttrib::get_actual_mode ( ) const [inline]

Returns the actual culling mode, without considering the effects of the reverse flag.

See also get_effective_mode().

Definition at line 37 of file cullFaceAttrib.I.

Referenced by NodePath::get_two_sided().

CullFaceAttrib::Mode CullFaceAttrib::get_effective_mode ( ) const

Returns the effective culling mode.

This is the same as the actual culling mode, unless the reverse flag is set, which swaps CW for CCW and vice-versa. Also, M_cull_unchanged is mapped to M_cull_none.

Definition at line 82 of file cullFaceAttrib.cxx.

Referenced by GeomNode::apply_attribs_to_vertices().

size_t CullFaceAttrib::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 176 of file cullFaceAttrib.cxx.

References integer_hash< Key, Compare >::add_hash().

bool CullFaceAttrib::get_reverse ( ) const [inline]

Returns the 'reverse' flag.

If this is true, the actual cull direction (clockwise vs. counterclockwise) is the reverse of what is specified here. This allows support for make_reverse(), which defines a CullFaceAttrib that reverses whatever the sense of culling would have been.

Definition at line 53 of file cullFaceAttrib.I.

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

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

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

Definition at line 288 of file cullFaceAttrib.cxx.

References fillin().

Referenced by register_with_read_factory().

Tells the BamReader how to create objects of type CullFaceAttrib.

Definition at line 261 of file cullFaceAttrib.cxx.

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

void CullFaceAttrib::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 272 of file cullFaceAttrib.cxx.

References Datagram::add_bool(), and Datagram::add_int8().


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