26 _color_name_index = 0;
28 _pos.set(0.0, 0.0, 0.0);
29 _normal.set(0.0, 0.0, 0.0);
63 if (_header->get_flt_version() < 1520) {
112 nassertr(
has_color(), LColor(0.0, 0.0, 0.0, 0.0));
114 return _header->get_color(_color_index, (_flags & F_packed_color) != 0,
124 nassertr(
has_color(), LRGBColor(0.0, 0.0, 0.0));
126 return _header->get_rgb(_color_index, (_flags & F_packed_color) != 0,
136 _flags = ((_flags & ~F_no_color) | F_packed_color);
146 if (!FltRecord::extract_record(reader)) {
172 nassertr(
false,
false);
194 if (!_packed_color.extract_record(reader)) {
197 if (_header->get_flt_version() >= 1520) {
219 if (!FltRecord::build_record(writer)) {
242 if (!_packed_color.build_record(writer)) {
246 if (_header->get_flt_version() >= 1520) {
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
PN_float64 get_be_float64()
Extracts a 64-bit big-endian floating-point number.
int get_record_length() const
Returns the length of this record in bytes as it will be written to the flt file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void check_remaining_size(const DatagramIterator &di, const std::string &name=std::string()) const
Checks that the iterator has no bytes left, as it should at the end of a successfully read record.
FltOpcode get_opcode() const
Returns the opcode that this record will be written as.
int32_t get_be_int32()
Extracts a signed 32-bit big-endian integer.
PN_float32 get_be_float32()
Extracts a 32-bit big-endian single-precision floating-point number.
LRGBColor get_rgb() const
If has_color() indicates true, returns the color of the vertex, as a three- component value.
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
void set_rgb(const LRGBColor &rgb)
Sets the color according to the indicated three-component LRGBColor value, and set the alpha to 1....
bool has_color() const
Returns true if the vertex has a primary color indicated, false otherwise.
size_t get_remaining_size() const
Return the bytes left in the datagram.
void set_rgb(const LRGBColor &rgb)
Sets the color of the vertex, using the packed color convention.
void pad_bytes(size_t size)
Adds the indicated number of zero bytes to the datagram.
void add_be_float64(PN_float64 value)
Adds a 64-bit big-endian floating-point number to the datagram.
uint16_t get_be_uint16()
Extracts an unsigned 16-bit big-endian integer.
void add_be_float32(PN_float32 value)
Adds a 32-bit single-precision big-endian floating-point number to the datagram.
void add_be_uint16(uint16_t value)
Adds an unsigned 16-bit big-endian integer to the datagram.
void skip_bytes(size_t size)
Skips over the indicated number of bytes in the datagram.
The base class for all kinds of records in a MultiGen OpenFlight file.
void add_be_int16(int16_t value)
Adds a signed 16-bit big-endian integer to the datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_be_uint32(uint32_t value)
Adds an unsigned 32-bit big-endian integer to the datagram.
FltOpcode get_opcode() const
Returns the opcode associated with the current record.
A class to retrieve the individual data elements previously stored in a Datagram.
int16_t get_be_int16()
Extracts a signed 16-bit big-endian integer.
LColor get_color() const
If has_color() indicates true, returns the color of the vertex, as a four- component value.
TypeHandle is the identifier used to differentiate C++ class types.
void set_opcode(FltOpcode opcode)
Sets the opcode associated with the current record.
Datagram & update_datagram()
Returns a modifiable reference to the datagram associated with the current record.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
size_t get_length() const
Returns the number of bytes in the datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.