Go to the documentation of this file.
28 _relative_priority = 0;
29 _draw_type = DT_solid_cull_backface;
31 _color_name_index = 0;
32 _alt_color_name_index = 0;
33 _billboard_type = BT_none;
34 _detail_texture_index = -1;
37 _dfad_material_code = 0;
39 _ir_material_code = 0;
41 _lod_generation_control = 0;
42 _line_style_index = 0;
44 _light_mode = LM_face_no_normal;
45 _texture_mapping_index = 0;
64 color.set(1.0, 1.0, 1.0, 1.0);
69 color.set(material->_diffuse[0],
70 material->_diffuse[1],
71 material->_diffuse[2],
75 _header->get_rgb(_color_index, (_flags & F_packed_color) != 0,
77 color.set(rgb[0], rgb[1], rgb[2], 1.0);
81 PN_stdfloat alpha = 1.0 - (_transparency / 65535.0);
92 set_rgb(LRGBColor(color[0], color[1], color[2]));
93 _transparency = (int)floor((1.0 - color[3]) * 65535.0);
104 return LRGBColor(1.0, 1.0, 1.0);
110 return material->_diffuse;
113 return _header->get_rgb(_color_index, (_flags & F_packed_color) != 0,
124 _flags = ((_flags & ~F_no_color) | F_packed_color);
127 _material_index = -1;
136 return (_flags & F_no_alt_color) == 0;
147 return _header->get_color(_alt_color_index, (_flags & F_packed_color) != 0,
148 _alt_packed_color, _transparency);
159 return _header->get_rgb(_alt_color_index, (_flags & F_packed_color) != 0,
174 _draw_type = (DrawType)iterator.
get_int8();
175 _texwhite = (iterator.
get_int8() != 0);
179 _billboard_type = (BillboardType)iterator.
get_int8();
187 _lod_generation_control = iterator.
get_uint8();
188 _line_style_index = iterator.
get_uint8();
189 if (_header->get_flt_version() >= 1420) {
191 _light_mode = (LightMode)iterator.
get_uint8();
195 if (!_packed_color.extract_record(reader)) {
198 if (!_alt_packed_color.extract_record(reader)) {
202 if (_header->get_flt_version() >= 1520) {
238 datagram.
add_uint8(_lod_generation_control);
245 if (!_packed_color.build_record(writer)) {
248 if (!_alt_packed_color.build_record(writer)) {
252 if (_header->get_flt_version() >= 1520) {
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.
int16_t get_be_int16()
Extracts a signed 16-bit big-endian integer.
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
A base class for any of a broad family of flt beads that include an ID.
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
A class to retrieve the individual data elements previously stored in a Datagram.
uint16_t get_be_uint16()
Extracts an unsigned 16-bit big-endian integer.
bool has_material() const
Returns true if the face has a material applied, false otherwise.
uint32_t get_be_uint32()
Extracts an unsigned 32-bit big-endian integer.
void add_be_int16(int16_t value)
Adds a signed 16-bit big-endian integer to the datagram.
void set_color(const LColor &color)
Sets the primary color of the face, using the packed color convention.
void add_be_uint16(uint16_t value)
Adds an unsigned 16-bit big-endian integer to the datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void pad_bytes(size_t size)
Adds the indicated number of zero bytes to the datagram.
FltMaterial * get_material() const
Returns the material applied to this face, or NULL if no material was applied.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
TypeHandle is the identifier used to differentiate C++ class types.
Represents a single material in the material palette.
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int8_t get_int8()
Extracts a signed 8-bit integer.
bool has_color() const
Returns true if the face has a primary color indicated, false otherwise.
int32_t get_be_int32()
Extracts a signed 32-bit big-endian integer.
Datagram & update_datagram()
Returns a modifiable reference to the datagram associated with the current record.
LColor get_alt_color() const
If has_alt_color() indicates true, returns the alternate color of the face, as a four-component value...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool has_alt_color() const
Returns true if the face has an alternate color indicated, false otherwise.
void skip_bytes(size_t size)
Skips over the indicated number of bytes in the datagram.
bool has_texture() const
Returns true if the face has a texture applied, false otherwise.
void add_int8(int8_t value)
Adds a signed 8-bit integer to the datagram.
void set_rgb(const LRGBColor &rgb)
Sets the color according to the indicated three-component LRGBColor value, and set the alpha to 1....
uint8_t get_uint8()
Extracts an unsigned 8-bit integer.
void add_be_uint32(uint32_t value)
Adds an unsigned 32-bit big-endian integer to the datagram.
LColor get_color() const
Returns the primary color of the face, as a four-component value (including alpha as the transparency...
LRGBColor get_rgb() const
Returns the primary color of the face, as a three-component value ignoring transparency.
LRGBColor get_alt_rgb() const
If has_alt_color() indicates true, returns the alternate color of the face, as a three-component valu...
void add_be_int32(int32_t value)
Adds a signed 32-bit big-endian integer to the datagram.
void set_rgb(const LRGBColor &rgb)
Sets the primary color of the face, using the packed color convention; does not affect transparency.