25 EggMaterial(
const std::string &mref_name)
42 _shininess(copy._shininess),
43 _roughness(copy._roughness),
44 _metallic(copy._metallic),
57 write(std::ostream &out,
int indent_level)
const {
61 indent(out, indent_level + 2)
62 <<
"<Scalar> baser { " <<
get_base()[0] <<
" }\n";
63 indent(out, indent_level + 2)
64 <<
"<Scalar> baseg { " <<
get_base()[1] <<
" }\n";
65 indent(out, indent_level + 2)
66 <<
"<Scalar> baseb { " <<
get_base()[2] <<
" }\n";
68 indent(out, indent_level + 2)
69 <<
"<Scalar> basea { " <<
get_base()[3] <<
" }\n";
74 indent(out, indent_level + 2)
75 <<
"<Scalar> diffr { " <<
get_diff()[0] <<
" }\n";
76 indent(out, indent_level + 2)
77 <<
"<Scalar> diffg { " <<
get_diff()[1] <<
" }\n";
78 indent(out, indent_level + 2)
79 <<
"<Scalar> diffb { " <<
get_diff()[2] <<
" }\n";
81 indent(out, indent_level + 2)
82 <<
"<Scalar> diffa { " <<
get_diff()[3] <<
" }\n";
87 indent(out, indent_level + 2)
88 <<
"<Scalar> ambr { " <<
get_amb()[0] <<
" }\n";
89 indent(out, indent_level + 2)
90 <<
"<Scalar> ambg { " <<
get_amb()[1] <<
" }\n";
91 indent(out, indent_level + 2)
92 <<
"<Scalar> ambb { " <<
get_amb()[2] <<
" }\n";
94 indent(out, indent_level + 2)
95 <<
"<Scalar> amba { " <<
get_amb()[3] <<
" }\n";
100 indent(out, indent_level + 2)
101 <<
"<Scalar> emitr { " <<
get_emit()[0] <<
" }\n";
102 indent(out, indent_level + 2)
103 <<
"<Scalar> emitg { " <<
get_emit()[1] <<
" }\n";
104 indent(out, indent_level + 2)
105 <<
"<Scalar> emitb { " <<
get_emit()[2] <<
" }\n";
107 indent(out, indent_level + 2)
108 <<
"<Scalar> emita { " <<
get_emit()[3] <<
" }\n";
113 indent(out, indent_level + 2)
114 <<
"<Scalar> specr { " <<
get_spec()[0] <<
" }\n";
115 indent(out, indent_level + 2)
116 <<
"<Scalar> specg { " <<
get_spec()[1] <<
" }\n";
117 indent(out, indent_level + 2)
118 <<
"<Scalar> specb { " <<
get_spec()[2] <<
" }\n";
120 indent(out, indent_level + 2)
121 <<
"<Scalar> speca { " <<
get_spec()[3] <<
" }\n";
125 if (has_shininess()) {
126 indent(out, indent_level + 2)
127 <<
"<Scalar> shininess { " << get_shininess() <<
" }\n";
131 indent(out, indent_level + 2)
136 indent(out, indent_level + 2)
141 indent(out, indent_level + 2)
142 <<
"<Scalar> ior { " <<
get_ior() <<
" }\n";
146 indent(out, indent_level + 2)
147 <<
"<Scalar> local { " << get_local() <<
" }\n";
150 indent(out, indent_level) <<
"}\n";
167 if (eq & E_attributes) {
168 if (_flags != other._flags ||
174 (has_shininess() && get_shininess() != other.get_shininess()) ||
178 (has_local() && get_local() != other.get_local())) {
183 if (eq & E_mref_name) {
184 if (get_name() != other.get_name()) {
199 if (eq & E_attributes) {
200 if (_flags != other._flags) {
201 return _flags < (int)other._flags;
215 if (has_shininess() && get_shininess() != other.get_shininess()) {
216 return get_shininess() < other.get_shininess();
227 if (has_local() && get_local() != other.get_local()) {
228 return get_local() < other.get_local();
232 if (eq & E_mref_name) {
233 if (get_name() != other.get_name()) {
234 return get_name() < other.get_name();
void write_header(std::ostream &out, int indent_level, const char *egg_keyword) const
Writes the first line of the egg object, e.g.
bool is_equivalent_to(const EggMaterial &other, int eq) const
Returns true if the two materials are equivalent in all relevant properties (according to eq),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
get_spec
It is legal to call this even if has_spec() returns false.
bool sorts_less_than(const EggMaterial &other, int eq) const
An ordering operator to compare two materials for sorting order.
A base class for things that may be directly added into the egg hierarchy.
get_emit
It is legal to call this even if has_emit() returns false.
virtual void write(std::ostream &out, int indent_level) const
Writes the material definition to the indicated output stream in Egg format.
get_base
It is legal to call this even if has_base() returns false.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_diff
It is legal to call this even if has_diff() returns false.
get_amb
It is legal to call this even if has_amb() returns false.