23 int CullFaceAttrib::_attrib_slot;
35 make(CullFaceAttrib::Mode mode) {
37 return return_new(attrib);
49 return return_new(attrib);
66 CullFaceAttrib::Mode CullFaceAttrib::
67 get_effective_mode()
const {
70 case M_cull_clockwise:
71 case M_cull_unchanged:
72 return M_cull_counter_clockwise;
74 case M_cull_counter_clockwise:
75 return M_cull_clockwise;
83 case M_cull_clockwise:
84 case M_cull_unchanged:
85 return M_cull_clockwise;
87 case M_cull_counter_clockwise:
88 return M_cull_counter_clockwise;
101 void CullFaceAttrib::
102 output(std::ostream &out)
const {
103 out << get_type() <<
":";
108 case M_cull_clockwise:
109 out <<
"cull_clockwise";
111 case M_cull_counter_clockwise:
112 out <<
"cull_counter_clockwise";
114 case M_cull_unchanged:
115 out <<
"cull_unchanged";
139 if (_mode != ta->_mode) {
140 return (
int)_mode - (int)ta->_mode;
142 return (
int)_reverse - (int)ta->_reverse;
151 size_t CullFaceAttrib::
152 get_hash_impl()
const {
174 if (!_reverse && ta->_mode != M_cull_unchanged) {
183 if (ta->_mode != M_cull_unchanged) {
186 bool reverse = (_reverse && !ta->_reverse) || (!_reverse && ta->_reverse);
189 return return_new(attrib);
205 if (_reverse && ta->_mode != M_cull_unchanged) {
210 if (ta->_mode != M_cull_unchanged) {
213 bool reverse = (!_reverse && !ta->_reverse) || (_reverse && ta->_reverse);
216 return return_new(attrib);
222 void CullFaceAttrib::
223 register_with_read_factory() {
251 attrib->fillin(scan, manager);
260 void CullFaceAttrib::
262 RenderAttrib::fillin(scan, manager);
bool get_bool()
Extracts a boolean value.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
CPT(RenderAttrib) CullFaceAttrib
Constructs a new CullFaceAttrib object that specifies how to cull geometry.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Indicates which faces should be culled based on their vertex ordering.
static size_t add_hash(size_t start, const Key &key)
Adds the indicated key into a running hash.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_int8(int8_t value)
Adds a signed 8-bit integer to the datagram.
void add_bool(bool value)
Adds a boolean value to the datagram.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_actual_mode
Returns the actual culling mode, without considering the effects of the reverse flag.
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 WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A class to retrieve the individual data elements previously stored in a Datagram.
int8_t get_int8()
Extracts a signed 8-bit integer.
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_reverse
Returns the 'reverse' flag.