Panda3D
Public Member Functions | List of all members
XFileMaterial Class Reference

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. More...
 
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. More...
 
bool has_material () const
 Returns true if this material represents something meaningful, or false if the default material is sufficient. More...
 
bool has_texture () const
 Returns true if this material includes a texture map, false otherwise. More...
 
XFileDataNodemake_x_material (XFileNode *x_meshMaterials, const std::string &suffix)
 Creates a Material object for the material list. More...
 
void set_from_egg (EggPrimitive *egg_prim)
 Sets the structure up from the indicated egg data. More...
 

Detailed Description

This represents an X file "material", which consists of a color, lighting, and/or texture specification.

Definition at line 31 of file xFileMaterial.h.

Member Function Documentation

◆ apply_to_egg()

void XFileMaterial::apply_to_egg ( EggPrimitive egg_prim,
XFileToEggConverter converter 
)

Applies the properties in the material to the indicated egg primitive.

Definition at line 90 of file xFileMaterial.cxx.

References SomethingToEggConverter::convert_model_path(), XFileToEggConverter::create_unique_texture(), and EggPrimitive::set_texture().

◆ fill_material()

bool XFileMaterial::fill_material ( XFileDataNode obj)

Fills the structure based on the raw data from the X file's Material object.

Definition at line 183 of file xFileMaterial.cxx.

◆ has_material()

bool XFileMaterial::has_material ( ) const

Returns true if this material represents something meaningful, or false if the default material is sufficient.

Definition at line 149 of file xFileMaterial.cxx.

Referenced by XFileMesh::add_material().

◆ has_texture()

bool XFileMaterial::has_texture ( ) const

Returns true if this material includes a texture map, false otherwise.

Definition at line 157 of file xFileMaterial.cxx.

Referenced by make_x_material().

◆ 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 165 of file xFileMaterial.cxx.

References XFileNode::add_Material(), XFileNode::add_TextureFilename(), and has_texture().

◆ set_from_egg()

void XFileMaterial::set_from_egg ( EggPrimitive egg_prim)

The documentation for this class was generated from the following files: