27 _ambient.set(0.0, 0.0, 0.0);
28 _diffuse.set(0.0, 0.0, 0.0);
29 _specular.set(0.0, 0.0, 0.0);
30 _emissive.set(0.0, 0.0, 0.0);
42 if (!FltRecord::extract_record(reader)) {
46 nassertr(reader.
get_opcode() == FO_15_material,
false);
49 _material_index = iterator.get_be_int32();
50 _material_name = iterator.get_fixed_string(12);
51 _flags = iterator.get_be_uint32();
52 _ambient[0] = iterator.get_be_float32();
53 _ambient[1] = iterator.get_be_float32();
54 _ambient[2] = iterator.get_be_float32();
55 _diffuse[0] = iterator.get_be_float32();
56 _diffuse[1] = iterator.get_be_float32();
57 _diffuse[2] = iterator.get_be_float32();
58 _specular[0] = iterator.get_be_float32();
59 _specular[1] = iterator.get_be_float32();
60 _specular[2] = iterator.get_be_float32();
61 _emissive[0] = iterator.get_be_float32();
62 _emissive[1] = iterator.get_be_float32();
63 _emissive[2] = iterator.get_be_float32();
64 _shininess = iterator.get_be_float32();
65 _alpha = iterator.get_be_float32();
66 iterator.skip_bytes(4);
79 if (!FltRecord::build_record(writer)) {
115 _material_index = index;
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...
bool build_14_record(Datagram &datagram)
Fills up the current record on the FltRecordWriter with data for this record, formatted as a part of ...
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.
PN_float32 get_be_float32()
Extracts a 32-bit big-endian single-precision floating-point number.
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
void pad_bytes(size_t size)
Adds the indicated number of zero bytes to the datagram.
bool extract_14_record(int index, DatagramIterator &di)
Fills in the information in this record based on the information from the current position within the...
void add_be_float32(PN_float32 value)
Adds a 32-bit single-precision big-endian floating-point number to the datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
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.
void add_fixed_string(const std::string &str, size_t size)
Adds a fixed-length string to the datagram.
void add_be_int32(int32_t value)
Adds a signed 32-bit big-endian integer to the datagram.
TypeHandle is the identifier used to differentiate C++ class types.
uint32_t get_be_uint32()
Extracts an unsigned 32-bit big-endian integer.
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 ...
std::string get_fixed_string(size_t size)
Extracts a fixed-length string.