Panda3D
|
This represents an X file "material", which consists of a color, lighting, and/or texture specification. More...
#include "xFileMaterial.h"
Public Member Functions | |
void | apply_to_egg (EggPrimitive *egg_prim, XFileToEggConverter *converter) |
Applies the properties in the material to the indicated egg primitive. | |
int | compare_to (const XFileMaterial &other) const |
bool | fill_material (XFileDataNode *obj) |
Fills the structure based on the raw data from the X file's Material object. | |
bool | has_material () const |
Returns true if this material represents something meaningful, or false if the default material is sufficient. | |
bool | has_texture () const |
Returns true if this material includes a texture map, false otherwise. | |
XFileDataNode * | make_x_material (XFileNode *x_meshMaterials, const std::string &suffix) |
Creates a Material object for the material list. | |
void | set_from_egg (EggPrimitive *egg_prim) |
Sets the structure up from the indicated egg data. | |
This represents an X file "material", which consists of a color, lighting, and/or texture specification.
Definition at line 31 of file xFileMaterial.h.
XFileMaterial::XFileMaterial | ( | ) |
Definition at line 28 of file xFileMaterial.cxx.
XFileMaterial::~XFileMaterial | ( | ) |
Definition at line 42 of file xFileMaterial.cxx.
void XFileMaterial::apply_to_egg | ( | EggPrimitive * | egg_prim, |
XFileToEggConverter * | converter ) |
Applies the properties in the material to the indicated egg primitive.
Definition at line 89 of file xFileMaterial.cxx.
References SomethingToEggConverter::convert_model_path(), XFileToEggConverter::create_unique_material(), XFileToEggConverter::create_unique_texture(), EggPrimitive::set_material, and EggPrimitive::set_texture().
Referenced by XFileMesh::create_polygons().
int XFileMaterial::compare_to | ( | const XFileMaterial & | other | ) | const |
Definition at line 125 of file xFileMaterial.cxx.
bool XFileMaterial::fill_material | ( | XFileDataNode * | obj | ) |
Fills the structure based on the raw data from the X file's Material object.
Definition at line 182 of file xFileMaterial.cxx.
References XFileNode::get_num_objects(), XFileNode::get_object(), XFileDataNode::get_template_name(), and XFileDataNode::is_standard_object().
Referenced by XFileMesh::fill_material_list().
bool XFileMaterial::has_material | ( | ) | const |
Returns true if this material represents something meaningful, or false if the default material is sufficient.
Definition at line 148 of file xFileMaterial.cxx.
Referenced by XFileMesh::add_material(), and XFileMesh::add_material().
bool XFileMaterial::has_texture | ( | ) | const |
Returns true if this material includes a texture map, false otherwise.
Definition at line 156 of file xFileMaterial.cxx.
Referenced by make_x_material().
XFileDataNode * XFileMaterial::make_x_material | ( | XFileNode * | x_meshMaterials, |
const std::string & | suffix ) |
Creates a Material object for the material list.
Definition at line 164 of file xFileMaterial.cxx.
References XFileNode::add_Material(), XFileNode::add_TextureFilename(), and has_texture().
Referenced by XFileMesh::make_x_material_list().
void XFileMaterial::set_from_egg | ( | EggPrimitive * | egg_prim | ) |
Sets the structure up from the indicated egg data.
Definition at line 49 of file xFileMaterial.cxx.
References EggAttributes::get_color(), EggMaterial::get_diff, EggMaterial::get_emit, EggFilenameNode::get_filename(), EggPrimitive::get_material, EggMaterial::get_spec, EggPrimitive::get_texture, EggPrimitive::has_material, and EggPrimitive::has_texture().
Referenced by XFileMesh::add_material().