43 GT_group = 0x00000000,
44 GT_instance = 0x00000001,
45 GT_joint = 0x00000002,
49 DC_unspecified = 0x00000000,
51 DC_local = 0x00000020,
53 DC_no_touch = 0x00000040,
54 DC_default = 0x00000050,
60 BT_point_camera_relative = 0x00000040,
61 BT_point_world_relative = 0x00000080,
63 enum CollisionSolidType {
66 CST_none = 0x00000000,
67 CST_plane = 0x00010000,
68 CST_polygon = 0x00020000,
69 CST_polyset = 0x00030000,
70 CST_sphere = 0x00040000,
71 CST_tube = 0x00050000,
72 CST_inv_sphere = 0x00060000,
74 CST_floor_mesh = 0x00080000,
80 CF_descend = 0x00100000,
81 CF_event = 0x00200000,
83 CF_solid = 0x00800000,
84 CF_center = 0x01000000,
85 CF_turnstile = 0x02000000,
86 CF_level = 0x04000000,
87 CF_intangible = 0x08000000,
93 DT_structured = 0x10000000,
95 DT_nosync = 0x30000000,
96 DT_default = 0x40000000,
117 BO_one_minus_incoming_color,
119 BO_one_minus_fbuffer_color,
121 BO_one_minus_incoming_alpha,
123 BO_one_minus_fbuffer_alpha,
125 BO_one_minus_constant_color,
127 BO_one_minus_constant_alpha,
128 BO_incoming_color_saturate,
130 BO_one_minus_color_scale,
132 BO_one_minus_alpha_scale,
135 explicit EggGroup(
const std::string &name =
"");
140 virtual void write(std::ostream &out,
int indent_level)
const;
141 void write_billboard_flags(std::ostream &out,
int indent_level)
const;
142 void write_collide_flags(std::ostream &out,
int indent_level)
const;
143 void write_model_flags(std::ostream &out,
int indent_level)
const;
144 void write_switch_flags(std::ostream &out,
int indent_level)
const;
145 void write_object_types(std::ostream &out,
int indent_level)
const;
146 void write_decal_flags(std::ostream &out,
int indent_level)
const;
147 void write_tags(std::ostream &out,
int indent_level)
const;
148 void write_render_mode(std::ostream &out,
int indent_level)
const;
162 void set_group_type(GroupType type);
163 INLINE GroupType get_group_type()
const;
164 INLINE
bool is_instance_type()
const;
166 INLINE
void set_billboard_type(BillboardType type);
167 INLINE BillboardType get_billboard_type()
const;
169 INLINE
void set_billboard_center(
const LPoint3d &billboard_center);
170 INLINE
void clear_billboard_center();
171 INLINE
bool has_billboard_center()
const;
172 INLINE
const LPoint3d &get_billboard_center()
const;
174 INLINE
void set_cs_type(CollisionSolidType type);
175 INLINE CollisionSolidType get_cs_type()
const;
177 INLINE
void set_collide_flags(
int flags);
178 INLINE CollideFlags get_collide_flags()
const;
180 INLINE
void set_collision_name(
const std::string &collision_name);
181 INLINE
void clear_collision_name();
182 INLINE
bool has_collision_name()
const;
183 INLINE
const std::string &get_collision_name()
const;
185 INLINE
void set_dcs_type(DCSType type);
186 INLINE DCSType get_dcs_type()
const;
187 INLINE
bool has_dcs_type()
const;
189 INLINE
void set_dart_type(DartType type);
190 INLINE DartType get_dart_type()
const;
192 INLINE
void set_switch_flag(
bool flag);
193 INLINE
bool get_switch_flag()
const;
195 INLINE
void set_switch_fps(
double fps);
196 INLINE
double get_switch_fps()
const;
198 INLINE
void add_object_type(
const std::string &object_type);
199 INLINE
void clear_object_types();
200 INLINE
int get_num_object_types()
const;
201 INLINE std::string get_object_type(
int index)
const;
202 MAKE_SEQ(get_object_types, get_num_object_types, get_object_type);
203 bool has_object_type(
const std::string &object_type)
const;
204 bool remove_object_type(
const std::string &object_type);
206 INLINE
void set_model_flag(
bool flag);
207 INLINE
bool get_model_flag()
const;
209 INLINE
void set_texlist_flag(
bool flag);
210 INLINE
bool get_texlist_flag()
const;
212 INLINE
void set_nofog_flag(
bool flag);
213 INLINE
bool get_nofog_flag()
const;
215 INLINE
void set_decal_flag(
bool flag);
216 INLINE
bool get_decal_flag()
const;
218 INLINE
void set_direct_flag(
bool flag);
219 INLINE
bool get_direct_flag()
const;
221 INLINE
void set_portal_flag(
bool flag);
222 INLINE
bool get_portal_flag()
const;
224 INLINE
void set_occluder_flag(
bool flag);
225 INLINE
bool get_occluder_flag()
const;
227 INLINE
void set_polylight_flag(
bool flag);
228 INLINE
bool get_polylight_flag()
const;
230 INLINE
void set_indexed_flag(
bool flag);
231 INLINE
void clear_indexed_flag();
232 INLINE
bool has_indexed_flag()
const;
233 INLINE
bool get_indexed_flag()
const;
236 INLINE
void clear_collide_mask();
237 INLINE
bool has_collide_mask()
const;
240 INLINE
void set_from_collide_mask(
CollideMask mask);
241 INLINE
void clear_from_collide_mask();
242 INLINE
bool has_from_collide_mask()
const;
245 INLINE
void set_into_collide_mask(
CollideMask mask);
246 INLINE
void clear_into_collide_mask();
247 INLINE
bool has_into_collide_mask()
const;
250 INLINE
void set_blend_mode(BlendMode blend_mode);
251 INLINE BlendMode get_blend_mode()
const;
252 INLINE
void set_blend_operand_a(BlendOperand blend_operand_a);
253 INLINE BlendOperand get_blend_operand_a()
const;
254 INLINE
void set_blend_operand_b(BlendOperand blend_operand_b);
255 INLINE BlendOperand get_blend_operand_b()
const;
256 INLINE
void set_blend_color(
const LColor &blend_color);
257 INLINE
void clear_blend_color();
258 INLINE
bool has_blend_color()
const;
259 INLINE
const LColor &get_blend_color()
const;
262 INLINE
void clear_lod();
263 INLINE
bool has_lod()
const;
266 INLINE
void set_tag(
const std::string &key,
const std::string &value);
267 INLINE std::string get_tag(
const std::string &key)
const;
268 INLINE
bool has_tag(
const std::string &key)
const;
269 INLINE
void clear_tag(
const std::string &key);
273 INLINE
void set_default_pose(
const EggTransform &transform);
274 INLINE
void clear_default_pose();
276 INLINE
void set_scroll_u(
const double u_speed);
277 INLINE
void set_scroll_v(
const double v_speed);
278 INLINE
void set_scroll_w(
const double w_speed);
279 INLINE
void set_scroll_r(
const double r_speed);
280 INLINE
double get_scroll_u()
const;
281 INLINE
double get_scroll_v()
const;
282 INLINE
double get_scroll_w()
const;
283 INLINE
double get_scroll_r()
const;
285 INLINE
bool has_scrolling_uvs();
287 MAKE_PROPERTY(group_type, get_group_type, set_group_type);
288 MAKE_PROPERTY(billboard_type, get_billboard_type, set_billboard_type);
289 MAKE_PROPERTY2(billboard_center, has_billboard_center, get_billboard_center,
290 set_billboard_center, clear_billboard_center);
291 MAKE_PROPERTY(cs_type, get_cs_type, set_cs_type);
292 MAKE_PROPERTY(collide_flags, get_collide_flags, set_collide_flags);
293 MAKE_PROPERTY(collision_name, get_collision_name, set_collision_name);
294 MAKE_PROPERTY(dcs_type, get_dcs_type, set_dcs_type);
295 MAKE_PROPERTY(dart_type, get_dart_type, set_dart_type);
296 MAKE_PROPERTY(switch_flag, get_switch_flag, set_switch_flag);
297 MAKE_PROPERTY(switch_fps, get_switch_fps, set_switch_fps);
298 MAKE_SEQ_PROPERTY(object_types, get_num_object_types, get_object_type);
299 MAKE_PROPERTY(model_flag, get_model_flag, set_model_flag);
300 MAKE_PROPERTY(texlist_flag, get_texlist_flag, set_texlist_flag);
301 MAKE_PROPERTY(nofog_flag, get_nofog_flag, set_nofog_flag);
302 MAKE_PROPERTY(decal_flag, get_decal_flag, set_decal_flag);
303 MAKE_PROPERTY(direct_flag, get_direct_flag, set_direct_flag);
304 MAKE_PROPERTY(portal_flag, get_portal_flag, set_portal_flag);
305 MAKE_PROPERTY(occluder_flag, get_occluder_flag, set_occluder_flag);
306 MAKE_PROPERTY2(indexed_flag, has_indexed_flag, get_indexed_flag,
307 set_indexed_flag, clear_indexed_flag);
308 MAKE_PROPERTY2(collide_mask, has_collide_mask, get_collide_mask,
309 set_collide_mask, clear_collide_mask);
310 MAKE_PROPERTY2(from_collide_mask, has_from_collide_mask, get_from_collide_mask,
311 set_from_collide_mask, clear_from_collide_mask);
312 MAKE_PROPERTY2(into_collide_mask, has_into_collide_mask, get_into_collide_mask,
313 set_into_collide_mask, clear_into_collide_mask);
314 MAKE_PROPERTY(blend_mode, get_blend_mode, set_blend_mode);
315 MAKE_PROPERTY(blend_operand_a, get_blend_operand_a, set_blend_operand_a);
316 MAKE_PROPERTY(blend_operand_b, get_blend_operand_b, set_blend_operand_b);
317 MAKE_PROPERTY2(blend_color, has_blend_color, get_blend_color,
318 set_blend_color, clear_blend_color);
319 MAKE_PROPERTY2(lod, has_lod, get_lod, set_lod, clear_lod);
320 MAKE_PROPERTY(default_pose, get_default_pose, set_default_pose);
321 MAKE_PROPERTY(scroll_u, get_scroll_u, set_scroll_u);
322 MAKE_PROPERTY(scroll_v, get_scroll_v, set_scroll_v);
323 MAKE_PROPERTY(scroll_w, get_scroll_w, set_scroll_w);
324 MAKE_PROPERTY(scroll_r, get_scroll_r, set_scroll_r);
327 INLINE TagData::const_iterator tag_begin()
const;
328 INLINE TagData::const_iterator tag_end()
const;
329 INLINE TagData::size_type tag_size()
const;
332 void ref_vertex(
EggVertex *vert,
double membership = 1.0);
334 void unref_all_vertices();
335 double get_vertex_membership(
const EggVertex *vert)
const;
336 void set_vertex_membership(
EggVertex *vert,
double membership);
340 INLINE VertexRef::const_iterator vref_begin()
const;
341 INLINE VertexRef::const_iterator vref_end()
const;
342 INLINE VertexRef::size_type vref_size()
const;
346 void test_vref_integrity()
const;
348 void test_vref_integrity()
const { }
351 void add_group_ref(
EggGroup *group);
352 int get_num_group_refs()
const;
353 EggGroup *get_group_ref(
int n)
const;
354 MAKE_SEQ(get_group_refs, get_num_group_refs, get_group_ref);
355 void remove_group_ref(
int n);
356 void clear_group_refs();
358 static GroupType string_group_type(
const std::string &strval);
359 static DartType string_dart_type(
const std::string &strval);
360 static DCSType string_dcs_type(
const std::string &strval);
361 static BillboardType string_billboard_type(
const std::string &strval);
362 static CollisionSolidType string_cs_type(
const std::string &strval);
363 static CollideFlags string_collide_flags(
const std::string &strval);
364 static BlendMode string_blend_mode(
const std::string &strval);
365 static BlendOperand string_blend_operand(
const std::string &strval);
371 void write_vertex_ref(std::ostream &out,
int indent_level)
const;
372 virtual bool egg_start_parse_body();
373 virtual void adjust_under();
374 virtual void r_transform(
const LMatrix4d &mat,
const LMatrix4d &inv,
375 CoordinateSystem to_cs);
376 virtual void r_flatten_transforms();
378 virtual void transform_changed();
383 F_group_type = 0x00000003,
385 F_billboard_type = 0x000000e0,
386 F_switch_flag = 0x00000100,
387 F_model_flag = 0x00000400,
388 F_texlist_flag = 0x00000800,
389 F_nofog_flag = 0x00001000,
390 F_decal_flag = 0x00002000,
391 F_direct_flag = 0x00004000,
392 F_cs_type = 0x000f0000,
393 F_collide_flags = 0x0ff00000,
394 F_dart_type = 0xf0000000,
397 F2_collide_mask = 0x00000001,
398 F2_from_collide_mask = 0x00000002,
399 F2_into_collide_mask = 0x00000004,
400 F2_billboard_center = 0x00000008,
402 F2_dcs_type = 0x00000070,
403 F2_portal_flag = 0x00000080,
404 F2_polylight_flag = 0x00000100,
405 F2_indexed_flag = 0x00000200,
406 F2_has_indexed_flag = 0x00000400,
407 F2_has_blend_color = 0x00000800,
408 F2_occluder_flag = 0x00001000,
413 CollideMask _collide_mask, _from_collide_mask, _into_collide_mask;
414 BlendMode _blend_mode;
415 BlendOperand _blend_operand_a;
416 BlendOperand _blend_operand_b;
418 LPoint3d _billboard_center;
419 vector_string _object_types;
420 std::string _collision_name;
438 GroupRefs _group_refs;
446 static void init_type() {
447 EggGroupNode::init_type();
448 EggRenderMode::init_type();
450 EggGroupNode::get_class_type(),
451 EggRenderMode::get_class_type());
454 return get_class_type();
456 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
462 std::ostream &operator << (std::ostream &out, EggGroup::GroupType t);
463 std::ostream &operator << (std::ostream &out, EggGroup::DartType t);
464 std::ostream &operator << (std::ostream &out, EggGroup::DCSType t);
465 std::ostream &operator << (std::ostream &out, EggGroup::BillboardType t);
466 std::ostream &operator << (std::ostream &out, EggGroup::CollisionSolidType t);
467 std::ostream &operator << (std::ostream &out, EggGroup::CollideFlags t);
468 std::ostream &operator << (std::ostream &out, EggGroup::BlendMode t);
469 std::ostream &operator << (std::ostream &out, EggGroup::BlendOperand t);
virtual bool determine_indexed()
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" sc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for nodes in the hierarchy that are not leaf nodes.
virtual EggRenderMode * determine_draw_order()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual EggRenderMode * determine_depth_test_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
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.
This is our own Panda specialization on the default STL vector.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
This class stores miscellaneous rendering properties that is associated with geometry,...
virtual EggTransform * as_transform()
Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform,...
virtual void write(std::ostream &out, int indent_level) const
Writes the group and all of its children to the indicated output stream in Egg format.
virtual bool determine_decal()
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual EggRenderMode * determine_visibility_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
virtual EggRenderMode * determine_depth_write_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual EggRenderMode * determine_alpha_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
virtual bool is_joint() const
Returns true if this particular node represents a <Joint> entry or not.
virtual EggRenderMode * determine_bin()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
TypeHandle is the identifier used to differentiate C++ class types.
virtual EggRenderMode * determine_depth_offset()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
This corresponds to a <SwitchCondition> entry within a group.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.