Panda3D
|
Represents a single material in the material palette. More...
#include "fltMaterial.h"
Public Types | |
enum | Flags { F_materials_used = 0x80000000 } |
Public Member Functions | |
FltMaterial (FltHeader *header) | |
bool | build_14_record (Datagram &datagram) |
Fills up the current record on the FltRecordWriter with data for this record, formatted as a part of a v14 material palette. | |
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 v14 material palette. | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Public Attributes | |
PN_stdfloat | _alpha |
LRGBColor | _ambient |
LRGBColor | _diffuse |
LRGBColor | _emissive |
unsigned int | _flags |
int | _material_index |
string | _material_name |
PN_stdfloat | _shininess |
LRGBColor | _specular |
Protected Member Functions | |
virtual bool | build_record (FltRecordWriter &writer) const |
Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer. | |
virtual bool | extract_record (FltRecordReader &reader) |
Fills in the information in this record based on the information given in the indicated datagram, whose opcode has already been read. | |
Friends | |
class | FltHeader |
Represents a single material in the material palette.
Definition at line 30 of file fltMaterial.h.
bool FltMaterial::build_14_record | ( | Datagram & | datagram | ) |
Fills up the current record on the FltRecordWriter with data for this record, formatted as a part of a v14 material palette.
Returns true on success, false if there is some error.
Definition at line 159 of file fltMaterial.cxx.
References Datagram::add_be_float32(), Datagram::add_be_uint32(), Datagram::add_fixed_string(), and Datagram::pad_bytes().
bool FltMaterial::build_record | ( | FltRecordWriter & | writer | ) | const [protected, virtual] |
Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer.
Returns true on success, false if there is some error.
Reimplemented from FltRecord.
Definition at line 87 of file fltMaterial.cxx.
References Datagram::add_be_float32(), Datagram::add_be_int32(), Datagram::add_be_uint32(), Datagram::add_fixed_string(), FltRecord::build_record(), Datagram::pad_bytes(), FltRecordWriter::set_opcode(), and FltRecordWriter::update_datagram().
bool FltMaterial::extract_14_record | ( | int | index, |
DatagramIterator & | di | ||
) |
Fills in the information in this record based on the information from the current position within the v14 material palette.
Leaves the iterator at the beginning of the next material.
Definition at line 126 of file fltMaterial.cxx.
References DatagramIterator::get_be_float32(), DatagramIterator::get_be_uint32(), DatagramIterator::get_fixed_string(), and DatagramIterator::skip_bytes().
bool FltMaterial::extract_record | ( | FltRecordReader & | reader | ) | [protected, virtual] |
Fills in the information in this record based on the information given in the indicated datagram, whose opcode has already been read.
Returns true on success, false if the datagram is invalid.
Reimplemented from FltRecord.
Definition at line 47 of file fltMaterial.cxx.
References FltRecord::check_remaining_size(), FltRecord::extract_record(), FltRecordReader::get_iterator(), and FltRecordReader::get_opcode().
static void FltMaterial::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from FltRecord.
Definition at line 64 of file fltMaterial.h.