26class EXPCL_PANDA_EGG EggMaterial :
public EggNode {
28 explicit EggMaterial(
const std::string &mref_name);
29 EggMaterial(
const EggMaterial ©);
31 virtual void write(std::ostream &out,
int indent_level)
const;
41 INLINE
void set_base(
const LColor &base);
46 INLINE
void set_diff(
const LColor &diff);
47 INLINE
void clear_diff();
48 INLINE
bool has_diff()
const;
51 INLINE
void set_amb(
const LColor &amb);
52 INLINE
void clear_amb();
53 INLINE
bool has_amb()
const;
56 INLINE
void set_emit(
const LColor &emit);
57 INLINE
void clear_emit();
58 INLINE
bool has_emit()
const;
61 INLINE
void set_spec(
const LColor &spec);
62 INLINE
void clear_spec();
63 INLINE
bool has_spec()
const;
66 INLINE
void set_shininess(
double shininess);
67 INLINE
void clear_shininess();
68 INLINE
bool has_shininess()
const;
69 INLINE
double get_shininess()
const;
81 INLINE
void set_ior(
double ior);
86 INLINE
void set_local(
bool local);
87 INLINE
void clear_local();
88 INLINE
bool has_local()
const;
89 INLINE
bool get_local()
const;
93 MAKE_PROPERTY2(diff, has_diff,
get_diff, set_diff, clear_diff);
94 MAKE_PROPERTY2(amb, has_amb,
get_amb, set_amb, clear_amb);
95 MAKE_PROPERTY2(emit, has_emit,
get_emit, set_emit, clear_emit);
96 MAKE_PROPERTY2(spec, has_spec,
get_spec, set_spec, clear_spec);
97 MAKE_PROPERTY2(shininess, has_shininess, get_shininess, set_shininess, clear_shininess);
102 MAKE_PROPERTY2(local, has_local, get_local, set_local, clear_local);
135 static void init_type() {
136 EggNode::init_type();
138 EggNode::get_class_type());
140 virtual TypeHandle get_type()
const {
141 return get_class_type();
143 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
146 static TypeHandle _type_handle;
154class EXPCL_PANDA_EGG UniqueEggMaterials {
156 INLINE UniqueEggMaterials(
int eq = ~0);
virtual void write(std::ostream &out, int indent_level) const
Writes the material definition to the indicated output stream in Egg format.
get_emit
It is legal to call this even if has_emit() returns false.
bool sorts_less_than(const EggMaterial &other, int eq) const
An ordering operator to compare two materials for sorting order.
get_spec
It is legal to call this even if has_spec() returns false.
get_diff
It is legal to call this even if has_diff() returns false.
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),...
get_amb
It is legal to call this even if has_amb() returns false.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...