Panda3D
eggGroup.I
1 // Filename: eggGroup.I
2 // Created by: drose (16Jan99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: EggGroup::get_group_type
18 // Access: Published
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE EggGroup::GroupType EggGroup::
22 get_group_type() const {
23  return (GroupType)(_flags & F_group_type);
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: EggGroup::is_instance_type
28 // Access: Published
29 // Description: Returns true if this group is an instance type node;
30 // i.e. it begins the root of a local coordinate space.
31 // This is not related to instancing (multiple copies of
32 // a node in a scene graph).
33 //
34 // This also includes the case of the node including a
35 // billboard flag without an explicit center, which
36 // implicitly makes the node behave like an instance.
37 ////////////////////////////////////////////////////////////////////
38 INLINE bool EggGroup::
40  return
41  (get_group_type() == GT_instance) ||
42  (get_billboard_type() != BT_none && !has_billboard_center());
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: EggGroup::set_billboard_type
47 // Access: Published
48 // Description:
49 ////////////////////////////////////////////////////////////////////
50 INLINE void EggGroup::
51 set_billboard_type(BillboardType type) {
52  // Make sure the user didn't give us any stray bits.
53  nassertv((type & ~F_billboard_type)==0);
54  _flags = (_flags & ~F_billboard_type) | type;
55  // This may change the transform space of this node.
56  update_under(0);
57 }
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function: EggGroup::get_billboard_type
61 // Access: Published
62 // Description:
63 ////////////////////////////////////////////////////////////////////
64 INLINE EggGroup::BillboardType EggGroup::
65 get_billboard_type() const {
66  return (BillboardType)(_flags & F_billboard_type);
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: EggGroup::set_billboard_center
71 // Access: Published
72 // Description: Sets the point around which the billboard will
73 // rotate, if this node contains a billboard
74 // specification.
75 //
76 // If a billboard type is given but no billboard_center
77 // is specified, then the group node is treated as an
78 // <Instance>, and the billboard rotates around the
79 // origin. If, however, a billboard_center is
80 // specified, then the group node is *not* treated as an
81 // <Instance>, and the billboard rotates around the
82 // specified point.
83 //
84 // The point is in the same coordinate system as the
85 // vertices of this node: usually global, but possibly
86 // local if there is an <Instance> somewhere above.
87 // Specifically, this is the coordinate system defined
88 // by get_vertex_frame().
89 ////////////////////////////////////////////////////////////////////
90 INLINE void EggGroup::
91 set_billboard_center(const LPoint3d &billboard_center) {
92  _billboard_center = billboard_center;
93  _flags2 |= F2_billboard_center;
94  // This may change the transform space of this node.
95  update_under(0);
96 }
97 
98 ////////////////////////////////////////////////////////////////////
99 // Function: EggGroup::clear_billboard_center
100 // Access: Published
101 // Description:
102 ////////////////////////////////////////////////////////////////////
103 INLINE void EggGroup::
104 clear_billboard_center() {
105  _flags2 &= ~F2_billboard_center;
106  // This may change the transform space of this node.
107  update_under(0);
108 }
109 
110 ////////////////////////////////////////////////////////////////////
111 // Function: EggGroup::has_billboard_center
112 // Access: Published
113 // Description:
114 ////////////////////////////////////////////////////////////////////
115 INLINE bool EggGroup::
116 has_billboard_center() const {
117  return (_flags2 & F2_billboard_center) != 0;
118 }
119 
120 ////////////////////////////////////////////////////////////////////
121 // Function: EggGroup::get_billboard_center
122 // Access: Published
123 // Description:
124 ////////////////////////////////////////////////////////////////////
125 INLINE const LPoint3d &EggGroup::
126 get_billboard_center() const {
127  nassertr(has_billboard_center(), _billboard_center);
128  return _billboard_center;
129 }
130 
131 ////////////////////////////////////////////////////////////////////
132 // Function: EggGroup::set_cs_type
133 // Access: Published
134 // Description:
135 ////////////////////////////////////////////////////////////////////
136 INLINE void EggGroup::
137 set_cs_type(CollisionSolidType type) {
138  // Make sure the user didn't give us any stray bits.
139  nassertv((type & ~F_cs_type)==0);
140  _flags = (_flags & ~F_cs_type) | type;
141 }
142 
143 ////////////////////////////////////////////////////////////////////
144 // Function: EggGroup::get_cs_type
145 // Access: Published
146 // Description:
147 ////////////////////////////////////////////////////////////////////
148 INLINE EggGroup::CollisionSolidType EggGroup::
149 get_cs_type() const {
150  return (CollisionSolidType)(_flags & F_cs_type);
151 }
152 
153 ////////////////////////////////////////////////////////////////////
154 // Function: EggGroup::set_collision_name
155 // Access: Published
156 // Description:
157 ////////////////////////////////////////////////////////////////////
158 INLINE void EggGroup::
159 set_collision_name(const string &collision_name) {
160  _collision_name = collision_name;
161 }
162 
163 ////////////////////////////////////////////////////////////////////
164 // Function: EggGroup::clear_collision_name
165 // Access: Published
166 // Description:
167 ////////////////////////////////////////////////////////////////////
168 INLINE void EggGroup::
169 clear_collision_name() {
170  _collision_name = "";
171 }
172 
173 ////////////////////////////////////////////////////////////////////
174 // Function: EggGroup::has_collision_name
175 // Access: Published
176 // Description:
177 ////////////////////////////////////////////////////////////////////
178 INLINE bool EggGroup::
179 has_collision_name() const {
180  return !_collision_name.empty();
181 }
182 
183 ////////////////////////////////////////////////////////////////////
184 // Function: EggGroup::get_collision_name
185 // Access: Published
186 // Description:
187 ////////////////////////////////////////////////////////////////////
188 INLINE const string &EggGroup::
189 get_collision_name() const {
190  return _collision_name;
191 }
192 
193 ////////////////////////////////////////////////////////////////////
194 // Function: EggGroup::set_collide_flags
195 // Access: Published
196 // Description:
197 ////////////////////////////////////////////////////////////////////
198 INLINE void EggGroup::
199 set_collide_flags(int flags) {
200  // Make sure the user didn't give us any stray bits.
201  nassertv((flags & ~F_collide_flags)==0);
202  _flags = (_flags & ~F_collide_flags) | flags;
203 }
204 
205 ////////////////////////////////////////////////////////////////////
206 // Function: EggGroup::get_collide_flags
207 // Access: Published
208 // Description:
209 ////////////////////////////////////////////////////////////////////
210 INLINE EggGroup::CollideFlags EggGroup::
211 get_collide_flags() const {
212  return (EggGroup::CollideFlags)(_flags & F_collide_flags);
213 }
214 
215 ////////////////////////////////////////////////////////////////////
216 // Function: EggGroup::set_dcs_type
217 // Access: Published
218 // Description:
219 ////////////////////////////////////////////////////////////////////
220 INLINE void EggGroup::
221 set_dcs_type(EggGroup::DCSType type) {
222  // Make sure the user didn't give us any stray bits.
223  nassertv((type & ~F2_dcs_type)==0);
224  _flags2 = (_flags2 & ~F2_dcs_type) | type;
225 }
226 
227 ////////////////////////////////////////////////////////////////////
228 // Function: EggGroup::get_dcs_type
229 // Access: Published
230 // Description:
231 ////////////////////////////////////////////////////////////////////
232 INLINE EggGroup::DCSType EggGroup::
233 get_dcs_type() const {
234  return (DCSType)(_flags2 & F2_dcs_type);
235 }
236 
237 ////////////////////////////////////////////////////////////////////
238 // Function: EggGroup::has_dcs_type
239 // Access: Published
240 // Description: Returns true if the specified DCS type is not
241 // DC_none and not DC_unspecified.
242 ////////////////////////////////////////////////////////////////////
243 INLINE bool EggGroup::
244 has_dcs_type() const {
245  DCSType type = get_dcs_type();
246  return (type != DC_none && type != DC_unspecified);
247 }
248 
249 ////////////////////////////////////////////////////////////////////
250 // Function: EggGroup::set_dart_type
251 // Access: Published
252 // Description:
253 ////////////////////////////////////////////////////////////////////
254 INLINE void EggGroup::
255 set_dart_type(EggGroup::DartType type) {
256  // Make sure the user didn't give us any stray bits.
257  nassertv((type & ~F_dart_type)==0);
258  _flags = (_flags & ~F_dart_type) | type;
259 }
260 
261 ////////////////////////////////////////////////////////////////////
262 // Function: EggGroup::get_dart_type
263 // Access: Published
264 // Description:
265 ////////////////////////////////////////////////////////////////////
266 INLINE EggGroup::DartType EggGroup::
267 get_dart_type() const {
268  return (DartType)(_flags & F_dart_type);
269 }
270 
271 ////////////////////////////////////////////////////////////////////
272 // Function: EggGroup::set_switch_flag
273 // Access: Published
274 // Description:
275 ////////////////////////////////////////////////////////////////////
276 INLINE void EggGroup::
277 set_switch_flag(bool flag) {
278  if (flag) {
279  _flags |= F_switch_flag;
280  } else {
281  _flags &= ~F_switch_flag;
282  }
283 }
284 
285 ////////////////////////////////////////////////////////////////////
286 // Function: EggGroup::get_switch_flag
287 // Access: Published
288 // Description:
289 ////////////////////////////////////////////////////////////////////
290 INLINE bool EggGroup::
291 get_switch_flag() const {
292  return ((_flags & F_switch_flag) != 0);
293 }
294 
295 ////////////////////////////////////////////////////////////////////
296 // Function: EggGroup::set_switch_fps
297 // Access: Published
298 // Description:
299 ////////////////////////////////////////////////////////////////////
300 INLINE void EggGroup::
301 set_switch_fps(double fps) {
302  _fps = fps;
303 }
304 
305 ////////////////////////////////////////////////////////////////////
306 // Function: EggGroup::get_switch_fps
307 // Access: Published
308 // Description:
309 ////////////////////////////////////////////////////////////////////
310 INLINE double EggGroup::
311 get_switch_fps() const {
312  return _fps;
313 }
314 
315 ////////////////////////////////////////////////////////////////////
316 // Function: EggGroup::add_object_type
317 // Access: Published
318 // Description:
319 ////////////////////////////////////////////////////////////////////
320 INLINE void EggGroup::
321 add_object_type(const string &object_type) {
322  _object_types.push_back(object_type);
323 }
324 
325 ////////////////////////////////////////////////////////////////////
326 // Function: EggGroup::clear_object_types
327 // Access: Published
328 // Description:
329 ////////////////////////////////////////////////////////////////////
330 INLINE void EggGroup::
331 clear_object_types() {
332  _object_types.clear();
333 }
334 
335 ////////////////////////////////////////////////////////////////////
336 // Function: EggGroup::get_num_object_types
337 // Access: Published
338 // Description:
339 ////////////////////////////////////////////////////////////////////
340 INLINE int EggGroup::
341 get_num_object_types() const {
342  return _object_types.size();
343 }
344 
345 ////////////////////////////////////////////////////////////////////
346 // Function: EggGroup::get_object_type
347 // Access: Published
348 // Description:
349 ////////////////////////////////////////////////////////////////////
350 INLINE string EggGroup::
351 get_object_type(int index) const {
352  nassertr(index >= 0 && index < (int)_object_types.size(), string());
353  return _object_types[index];
354 }
355 
356 ////////////////////////////////////////////////////////////////////
357 // Function: EggGroup::set_model_flag
358 // Access: Published
359 // Description:
360 ////////////////////////////////////////////////////////////////////
361 INLINE void EggGroup::
362 set_model_flag(bool flag) {
363  if (flag) {
364  _flags |= F_model_flag;
365  } else {
366  _flags &= ~F_model_flag;
367  }
368 }
369 
370 ////////////////////////////////////////////////////////////////////
371 // Function: EggGroup::get_model_flag
372 // Access: Published
373 // Description:
374 ////////////////////////////////////////////////////////////////////
375 INLINE bool EggGroup::
376 get_model_flag() const {
377  return ((_flags & F_model_flag) != 0);
378 }
379 
380 ////////////////////////////////////////////////////////////////////
381 // Function: EggGroup::set_texlist_flag
382 // Access: Published
383 // Description:
384 ////////////////////////////////////////////////////////////////////
385 INLINE void EggGroup::
386 set_texlist_flag(bool flag) {
387  if (flag) {
388  _flags |= F_texlist_flag;
389  } else {
390  _flags &= ~F_texlist_flag;
391  }
392 }
393 
394 ////////////////////////////////////////////////////////////////////
395 // Function: EggGroup::get_texlist_flag
396 // Access: Published
397 // Description:
398 ////////////////////////////////////////////////////////////////////
399 INLINE bool EggGroup::
400 get_texlist_flag() const {
401  return ((_flags & F_texlist_flag) != 0);
402 }
403 
404 ////////////////////////////////////////////////////////////////////
405 // Function: EggGroup::set_nofog_flag
406 // Access: Published
407 // Description:
408 ////////////////////////////////////////////////////////////////////
409 INLINE void EggGroup::
410 set_nofog_flag(bool flag) {
411  if (flag) {
412  _flags |= F_nofog_flag;
413  } else {
414  _flags &= ~F_nofog_flag;
415  }
416 }
417 
418 ////////////////////////////////////////////////////////////////////
419 // Function: EggGroup::get_nofog_flag
420 // Access: Published
421 // Description:
422 ////////////////////////////////////////////////////////////////////
423 INLINE bool EggGroup::
424 get_nofog_flag() const {
425  return ((_flags & F_nofog_flag) != 0);
426 }
427 
428 ////////////////////////////////////////////////////////////////////
429 // Function: EggGroup::set_decal_flag
430 // Access: Published
431 // Description:
432 ////////////////////////////////////////////////////////////////////
433 INLINE void EggGroup::
434 set_decal_flag(bool flag) {
435  if (flag) {
436  _flags |= F_decal_flag;
437  } else {
438  _flags &= ~F_decal_flag;
439  }
440 }
441 
442 ////////////////////////////////////////////////////////////////////
443 // Function: EggGroup::get_decal_flag
444 // Access: Published
445 // Description:
446 ////////////////////////////////////////////////////////////////////
447 INLINE bool EggGroup::
448 get_decal_flag() const {
449  return ((_flags & F_decal_flag) != 0);
450 }
451 
452 ////////////////////////////////////////////////////////////////////
453 // Function: EggGroup::set_direct_flag
454 // Access: Published
455 // Description:
456 ////////////////////////////////////////////////////////////////////
457 INLINE void EggGroup::
458 set_direct_flag(bool flag) {
459  if (flag) {
460  _flags |= F_direct_flag;
461  } else {
462  _flags &= ~F_direct_flag;
463  }
464 }
465 
466 ////////////////////////////////////////////////////////////////////
467 // Function: EggGroup::get_direct_flag
468 // Access: Published
469 // Description:
470 ////////////////////////////////////////////////////////////////////
471 INLINE bool EggGroup::
472 get_direct_flag() const {
473  return ((_flags & F_direct_flag) != 0);
474 }
475 
476 
477 ////////////////////////////////////////////////////////////////////
478 // Function: EggGroup::set_portal_flag
479 // Access: Published
480 // Description:
481 ////////////////////////////////////////////////////////////////////
482 INLINE void EggGroup::
483 set_portal_flag(bool flag) {
484  if (flag) {
485  _flags2 |= F2_portal_flag;
486  } else {
487  _flags2 &= ~F2_portal_flag;
488  }
489 }
490 
491 ////////////////////////////////////////////////////////////////////
492 // Function: EggGroup::get_portal_flag
493 // Access: Published
494 // Description:
495 ////////////////////////////////////////////////////////////////////
496 INLINE bool EggGroup::
497 get_portal_flag() const {
498  return ((_flags2 & F2_portal_flag) != 0);
499 }
500 
501 ////////////////////////////////////////////////////////////////////
502 // Function: EggGroup::set_occluder_flag
503 // Access: Published
504 // Description:
505 ////////////////////////////////////////////////////////////////////
506 INLINE void EggGroup::
507 set_occluder_flag(bool flag) {
508  if (flag) {
509  _flags2 |= F2_occluder_flag;
510  } else {
511  _flags2 &= ~F2_occluder_flag;
512  }
513 }
514 
515 ////////////////////////////////////////////////////////////////////
516 // Function: EggGroup::get_occluder_flag
517 // Access: Published
518 // Description:
519 ////////////////////////////////////////////////////////////////////
520 INLINE bool EggGroup::
521 get_occluder_flag() const {
522  return ((_flags2 & F2_occluder_flag) != 0);
523 }
524 
525 ////////////////////////////////////////////////////////////////////
526 // Function: EggGroup::set_polylight_flag
527 // Access: Published
528 // Description:
529 ////////////////////////////////////////////////////////////////////
530 INLINE void EggGroup::
531 set_polylight_flag(bool flag) {
532  if (flag) {
533  _flags2 |= F2_polylight_flag;
534  } else {
535  _flags2 &= ~F2_polylight_flag;
536  }
537 }
538 
539 ////////////////////////////////////////////////////////////////////
540 // Function: EggGroup::get_polylight_flag
541 // Access: Published
542 // Description:
543 ////////////////////////////////////////////////////////////////////
544 INLINE bool EggGroup::
545 get_polylight_flag() const {
546  return ((_flags2 & F2_polylight_flag) != 0);
547 }
548 
549 ////////////////////////////////////////////////////////////////////
550 // Function: EggGroup::set_indexed_flag
551 // Access: Published
552 // Description: If this flag is true, geometry at this node and below
553 // will be generated as indexed geometry.
554 ////////////////////////////////////////////////////////////////////
555 INLINE void EggGroup::
556 set_indexed_flag(bool flag) {
557  if (flag) {
558  _flags2 |= F2_indexed_flag;
559  } else {
560  _flags2 &= ~F2_indexed_flag;
561  }
562  _flags2 |= F2_has_indexed_flag;
563 }
564 
565 ////////////////////////////////////////////////////////////////////
566 // Function: EggGroup::clear_indexed_flag
567 // Access: Published
568 // Description:
569 ////////////////////////////////////////////////////////////////////
570 INLINE void EggGroup::
571 clear_indexed_flag() {
572  _flags2 &= ~(F2_indexed_flag | F2_has_indexed_flag);
573 }
574 
575 ////////////////////////////////////////////////////////////////////
576 // Function: EggGroup::has_indexed_flag
577 // Access: Published
578 // Description:
579 ////////////////////////////////////////////////////////////////////
580 INLINE bool EggGroup::
581 has_indexed_flag() const {
582  return (_flags2 & F2_has_indexed_flag) != 0;
583 }
584 
585 ////////////////////////////////////////////////////////////////////
586 // Function: EggGroup::get_indexed_flag
587 // Access: Published
588 // Description:
589 ////////////////////////////////////////////////////////////////////
590 INLINE bool EggGroup::
591 get_indexed_flag() const {
592  nassertr(has_indexed_flag(), false);
593  return ((_flags2 & F2_indexed_flag) != 0);
594 }
595 
596 ////////////////////////////////////////////////////////////////////
597 // Function: EggGroup::set_collide_mask
598 // Access: Published
599 // Description:
600 ////////////////////////////////////////////////////////////////////
601 INLINE void EggGroup::
602 set_collide_mask(CollideMask mask) {
603  _collide_mask = mask;
604  _flags2 |= F2_collide_mask;
605 }
606 
607 ////////////////////////////////////////////////////////////////////
608 // Function: EggGroup::clear_collide_mask
609 // Access: Published
610 // Description:
611 ////////////////////////////////////////////////////////////////////
612 INLINE void EggGroup::
613 clear_collide_mask() {
614  _flags2 &= ~F2_collide_mask;
615  _collide_mask = CollideMask::all_off();
616 }
617 
618 ////////////////////////////////////////////////////////////////////
619 // Function: EggGroup::has_collide_mask
620 // Access: Published
621 // Description:
622 ////////////////////////////////////////////////////////////////////
623 INLINE bool EggGroup::
624 has_collide_mask() const {
625  return (_flags2 & F2_collide_mask) != 0;
626 }
627 
628 ////////////////////////////////////////////////////////////////////
629 // Function: EggGroup::get_collide_mask
630 // Access: Published
631 // Description:
632 ////////////////////////////////////////////////////////////////////
633 INLINE CollideMask EggGroup::
634 get_collide_mask() const {
635  return _collide_mask;
636 }
637 
638 ////////////////////////////////////////////////////////////////////
639 // Function: EggGroup::set_from_collide_mask
640 // Access: Published
641 // Description:
642 ////////////////////////////////////////////////////////////////////
643 INLINE void EggGroup::
644 set_from_collide_mask(CollideMask mask) {
645  _from_collide_mask = mask;
646  _flags2 |= F2_from_collide_mask;
647 }
648 
649 ////////////////////////////////////////////////////////////////////
650 // Function: EggGroup::clear_from_collide_mask
651 // Access: Published
652 // Description:
653 ////////////////////////////////////////////////////////////////////
654 INLINE void EggGroup::
655 clear_from_collide_mask() {
656  _flags2 &= ~F2_from_collide_mask;
657  _from_collide_mask = CollideMask::all_off();
658 }
659 
660 ////////////////////////////////////////////////////////////////////
661 // Function: EggGroup::has_from_collide_mask
662 // Access: Published
663 // Description:
664 ////////////////////////////////////////////////////////////////////
665 INLINE bool EggGroup::
666 has_from_collide_mask() const {
667  return (_flags2 & F2_from_collide_mask) != 0;
668 }
669 
670 ////////////////////////////////////////////////////////////////////
671 // Function: EggGroup::get_from_collide_mask
672 // Access: Published
673 // Description:
674 ////////////////////////////////////////////////////////////////////
675 INLINE CollideMask EggGroup::
676 get_from_collide_mask() const {
677  return _from_collide_mask;
678 }
679 
680 ////////////////////////////////////////////////////////////////////
681 // Function: EggGroup::set_into_collide_mask
682 // Access: Published
683 // Description:
684 ////////////////////////////////////////////////////////////////////
685 INLINE void EggGroup::
686 set_into_collide_mask(CollideMask mask) {
687  _into_collide_mask = mask;
688  _flags2 |= F2_into_collide_mask;
689 }
690 
691 ////////////////////////////////////////////////////////////////////
692 // Function: EggGroup::clear_into_collide_mask
693 // Access: Published
694 // Description:
695 ////////////////////////////////////////////////////////////////////
696 INLINE void EggGroup::
697 clear_into_collide_mask() {
698  _flags2 &= ~F2_into_collide_mask;
699  _into_collide_mask = CollideMask::all_off();
700 }
701 
702 ////////////////////////////////////////////////////////////////////
703 // Function: EggGroup::has_into_collide_mask
704 // Access: Published
705 // Description:
706 ////////////////////////////////////////////////////////////////////
707 INLINE bool EggGroup::
708 has_into_collide_mask() const {
709  return (_flags2 & F2_into_collide_mask) != 0;
710 }
711 
712 ////////////////////////////////////////////////////////////////////
713 // Function: EggGroup::get_into_collide_mask
714 // Access: Published
715 // Description:
716 ////////////////////////////////////////////////////////////////////
717 INLINE CollideMask EggGroup::
718 get_into_collide_mask() const {
719  return _into_collide_mask;
720 }
721 
722 ////////////////////////////////////////////////////////////////////
723 // Function: EggGroup::set_blend_mode
724 // Access: Published
725 // Description:
726 ////////////////////////////////////////////////////////////////////
727 INLINE void EggGroup::
728 set_blend_mode(EggGroup::BlendMode blend_mode) {
729  _blend_mode = blend_mode;
730 }
731 
732 ////////////////////////////////////////////////////////////////////
733 // Function: EggGroup::get_blend_mode
734 // Access: Published
735 // Description:
736 ////////////////////////////////////////////////////////////////////
737 INLINE EggGroup::BlendMode EggGroup::
738 get_blend_mode() const {
739  return _blend_mode;
740 }
741 
742 ////////////////////////////////////////////////////////////////////
743 // Function: EggGroup::set_blend_operand_a
744 // Access: Published
745 // Description:
746 ////////////////////////////////////////////////////////////////////
747 INLINE void EggGroup::
748 set_blend_operand_a(EggGroup::BlendOperand blend_operand_a) {
749  _blend_operand_a = blend_operand_a;
750 }
751 
752 ////////////////////////////////////////////////////////////////////
753 // Function: EggGroup::get_blend_operand_a
754 // Access: Published
755 // Description:
756 ////////////////////////////////////////////////////////////////////
757 INLINE EggGroup::BlendOperand EggGroup::
758 get_blend_operand_a() const {
759  return _blend_operand_a;
760 }
761 
762 ////////////////////////////////////////////////////////////////////
763 // Function: EggGroup::set_blend_operand_b
764 // Access: Published
765 // Description:
766 ////////////////////////////////////////////////////////////////////
767 INLINE void EggGroup::
768 set_blend_operand_b(EggGroup::BlendOperand blend_operand_b) {
769  _blend_operand_b = blend_operand_b;
770 }
771 
772 ////////////////////////////////////////////////////////////////////
773 // Function: EggGroup::get_blend_operand_b
774 // Access: Published
775 // Description:
776 ////////////////////////////////////////////////////////////////////
777 INLINE EggGroup::BlendOperand EggGroup::
778 get_blend_operand_b() const {
779  return _blend_operand_b;
780 }
781 
782 ////////////////////////////////////////////////////////////////////
783 // Function: EggGroup::set_blend_color
784 // Access: Published
785 // Description:
786 ////////////////////////////////////////////////////////////////////
787 INLINE void EggGroup::
788 set_blend_color(const LColor &blend_color) {
789  _blend_color = blend_color;
790  _flags2 |= F2_has_blend_color;
791 }
792 
793 ////////////////////////////////////////////////////////////////////
794 // Function: EggGroup::clear_blend_color
795 // Access: Published
796 // Description: Removes the blend color specification.
797 ////////////////////////////////////////////////////////////////////
798 INLINE void EggGroup::
800  _blend_color = LColor::zero();
801  _flags2 &= ~F2_has_blend_color;
802 }
803 
804 ////////////////////////////////////////////////////////////////////
805 // Function: EggGroup::has_blend_color
806 // Access: Published
807 // Description: Returns true if the blend color has been specified,
808 // false otherwise.
809 ////////////////////////////////////////////////////////////////////
810 INLINE bool EggGroup::
812  return (_flags2 & F2_has_blend_color) != 0;
813 }
814 
815 ////////////////////////////////////////////////////////////////////
816 // Function: EggGroup::get_blend_color
817 // Access: Published
818 // Description: Returns the blend color if one has been specified, or
819 // (0, 0, 0, 0) if one has not.
820 ////////////////////////////////////////////////////////////////////
821 INLINE const LColor &EggGroup::
823  return _blend_color;
824 }
825 
826 ////////////////////////////////////////////////////////////////////
827 // Function: EggGroup::set_lod
828 // Access: Published
829 // Description:
830 ////////////////////////////////////////////////////////////////////
831 INLINE void EggGroup::
832 set_lod(const EggSwitchCondition &lod) {
833  _lod = lod.make_copy();
834 }
835 
836 ////////////////////////////////////////////////////////////////////
837 // Function: EggGroup::clear_lod
838 // Access: Published
839 // Description:
840 ////////////////////////////////////////////////////////////////////
841 INLINE void EggGroup::
842 clear_lod() {
843  _lod = NULL;
844 }
845 
846 ////////////////////////////////////////////////////////////////////
847 // Function: EggGroup::has_lod
848 // Access: Published
849 // Description:
850 ////////////////////////////////////////////////////////////////////
851 INLINE bool EggGroup::
852 has_lod() const {
853  return (_lod != (EggSwitchCondition *)NULL);
854 }
855 
856 ////////////////////////////////////////////////////////////////////
857 // Function: EggGroup::get_lod
858 // Access: Published
859 // Description:
860 ////////////////////////////////////////////////////////////////////
861 INLINE const EggSwitchCondition &EggGroup::
862 get_lod() const {
863  return *_lod;
864 }
865 
866 ////////////////////////////////////////////////////////////////////
867 // Function: EggGroup::set_tag
868 // Access: Published
869 // Description: Associates a user-defined value with a user-defined
870 // key which is stored on the node. This value has no
871 // meaning to Panda; but it is stored indefinitely on
872 // the node until it is requested again. This value
873 // will be copied to the PandaNode that is created for
874 // this particular EggGroup if the egg file is loaded as
875 // a scene.
876 //
877 // Each unique key stores a different string value.
878 // There is no effective limit on the number of
879 // different keys that may be stored or on the length of
880 // any one key's value.
881 ////////////////////////////////////////////////////////////////////
882 INLINE void EggGroup::
883 set_tag(const string &key, const string &value) {
884  _tag_data[key] = value;
885 }
886 
887 ////////////////////////////////////////////////////////////////////
888 // Function: EggGroup::get_tag
889 // Access: Published
890 // Description: Retrieves the user-defined value that was previously
891 // set on this node for the particular key, if any. If
892 // no value has been previously set, returns the empty
893 // string.
894 ////////////////////////////////////////////////////////////////////
895 INLINE string EggGroup::
896 get_tag(const string &key) const {
897  TagData::const_iterator ti;
898  ti = _tag_data.find(key);
899  if (ti != _tag_data.end()) {
900  return (*ti).second;
901  }
902  return string();
903 }
904 
905 ////////////////////////////////////////////////////////////////////
906 // Function: EggGroup::has_tag
907 // Access: Published
908 // Description: Returns true if a value has been defined on this node
909 // for the particular key (even if that value is the
910 // empty string), or false if no value has been set.
911 ////////////////////////////////////////////////////////////////////
912 INLINE bool EggGroup::
913 has_tag(const string &key) const {
914  TagData::const_iterator ti;
915  ti = _tag_data.find(key);
916  return (ti != _tag_data.end());
917 }
918 
919 ////////////////////////////////////////////////////////////////////
920 // Function: EggGroup::clear_tag
921 // Access: Published
922 // Description: Removes the value defined for this key on this
923 // particular node. After a call to clear_tag(),
924 // has_tag() will return false for the indicated key.
925 ////////////////////////////////////////////////////////////////////
926 INLINE void EggGroup::
927 clear_tag(const string &key) {
928  _tag_data.erase(key);
929 }
930 
931 ////////////////////////////////////////////////////////////////////
932 // Function: EggGroup::get_default_pose
933 // Access: Published
934 // Description: Returns a read-only accessor to the initial pose
935 // transform. This is the <DefaultPose> entry for a
936 // Joint, and defines only the initial transform pose
937 // for the unanimated joint; it has nothing to do with
938 // the group's <Transform> entry, which defines the
939 // (eventual) space of the group's vertices.
940 ////////////////////////////////////////////////////////////////////
941 INLINE const EggTransform &EggGroup::
943  return _default_pose;
944 }
945 
946 ////////////////////////////////////////////////////////////////////
947 // Function: EggGroup::modify_default_pose
948 // Access: Published
949 // Description: Returns a writable accessor to the initial pose
950 // transform. This is the <DefaultPose> entry for a
951 // Joint, and defines only the initial transform pose
952 // for the unanimated joint; it has nothing to do with
953 // the group's <Transform> entry, which defines the
954 // (eventual) space of the group's vertices.
955 ////////////////////////////////////////////////////////////////////
956 INLINE EggTransform &EggGroup::
958  return _default_pose;
959 }
960 
961 ////////////////////////////////////////////////////////////////////
962 // Function: EggGroup::set_default_pose
963 // Access: Published
964 // Description: Replaces the initial pose transform. This is the
965 // <DefaultPose> entry for a Joint, and defines only the
966 // initial transform pose for the unanimated joint; it
967 // has nothing to do with the group's <Transform> entry,
968 // which defines the (eventual) space of the group's
969 // vertices.
970 ////////////////////////////////////////////////////////////////////
971 INLINE void EggGroup::
973  _default_pose = transform;
974 }
975 
976 ////////////////////////////////////////////////////////////////////
977 // Function: EggGroup::clear_default_pose
978 // Access: Published
979 // Description: Removes the initial pose transform. See
980 // set_default_pose().
981 ////////////////////////////////////////////////////////////////////
982 INLINE void EggGroup::
984  _default_pose.clear_transform();
985 }
986 
987 ////////////////////////////////////////////////////////////////////
988 // Function: EggGroup::tag_begin
989 // Access: Public
990 // Description: Returns an iterator that can, in conjunction with
991 // tag_end(), be used to traverse the entire set of
992 // tag keys. Each iterator returns a pair<string,
993 // string>.
994 //
995 // This interface is not safe to use outside of
996 // PANDAEGG.DLL.
997 ////////////////////////////////////////////////////////////////////
998 INLINE EggGroup::TagData::const_iterator EggGroup::
999 tag_begin() const {
1000  return _tag_data.begin();
1001 }
1002 
1003 ////////////////////////////////////////////////////////////////////
1004 // Function: EggGroup::tag_end
1005 // Access: Public
1006 // Description: Returns an iterator that can, in conjunction with
1007 // tag_begin(), be used to traverse the entire set of
1008 // tag keys. Each iterator returns a pair<string,
1009 // string>.
1010 //
1011 // This interface is not safe to use outside of
1012 // PANDAEGG.DLL.
1013 ////////////////////////////////////////////////////////////////////
1014 INLINE EggGroup::TagData::const_iterator EggGroup::
1015 tag_end() const {
1016  return _tag_data.end();
1017 }
1018 
1019 ////////////////////////////////////////////////////////////////////
1020 // Function: EggGroup::tag_size
1021 // Access: Published
1022 // Description: Returns the number of elements between tag_begin()
1023 // and tag_end().
1024 //
1025 // This interface is not safe to use outside of
1026 // PANDAEGG.DLL.
1027 ////////////////////////////////////////////////////////////////////
1028 INLINE EggGroup::TagData::size_type EggGroup::
1029 tag_size() const {
1030  return _tag_data.size();
1031 }
1032 
1033 ////////////////////////////////////////////////////////////////////
1034 // Function: EggGroup::vref_begin
1035 // Access: Public
1036 // Description: Returns an iterator that can, in conjunction with
1037 // vref_end(), be used to traverse the entire set of
1038 // referenced vertices. Each iterator returns a
1039 // pair<PT(EggVertex), double>.
1040 //
1041 // This interface is not safe to use outside of
1042 // PANDAEGG.DLL.
1043 ////////////////////////////////////////////////////////////////////
1044 INLINE EggGroup::VertexRef::const_iterator EggGroup::
1045 vref_begin() const {
1046  return _vref.begin();
1047 }
1048 
1049 ////////////////////////////////////////////////////////////////////
1050 // Function: EggGroup::vref_end
1051 // Access: Public
1052 // Description: Returns an iterator that can, in conjunction with
1053 // vref_begin(), be used to traverse the entire set of
1054 // referenced vertices. Each iterator returns a
1055 // pair<PT(EggVertex), double>.
1056 //
1057 // This interface is not safe to use outside of
1058 // PANDAEGG.DLL.
1059 ////////////////////////////////////////////////////////////////////
1060 INLINE EggGroup::VertexRef::const_iterator EggGroup::
1061 vref_end() const {
1062  return _vref.end();
1063 }
1064 
1065 ////////////////////////////////////////////////////////////////////
1066 // Function: EggGroup::vref_size
1067 // Access: Published
1068 // Description: Returns the number of elements between vref_begin()
1069 // and vref_end().
1070 //
1071 // This interface is not safe to use outside of
1072 // PANDAEGG.DLL.
1073 ////////////////////////////////////////////////////////////////////
1074 INLINE EggGroup::VertexRef::size_type EggGroup::
1075 vref_size() const {
1076  return _vref.size();
1077 }
1078 
1079 INLINE void EggGroup::
1080 set_scroll_u(const double u_speed) {
1081  _u_speed = u_speed;
1082 }
1083 
1084 INLINE void EggGroup::
1085 set_scroll_v(const double v_speed) {
1086  _v_speed = v_speed;
1087 }
1088 
1089 INLINE void EggGroup::
1090 set_scroll_w(const double w_speed) {
1091  _w_speed = w_speed;
1092 }
1093 
1094 INLINE void EggGroup::
1095 set_scroll_r(const double r_speed) {
1096  _r_speed = r_speed;
1097 }
1098 
1099 INLINE double EggGroup::
1100 get_scroll_u() const {
1101  return _u_speed;
1102 }
1103 
1104 INLINE double EggGroup::
1105 get_scroll_v() const {
1106  return _v_speed;
1107 }
1108 
1109 INLINE double EggGroup::
1110 get_scroll_w() const {
1111  return _w_speed;
1112 }
1113 
1114 INLINE double EggGroup::
1115 get_scroll_r() const {
1116  return _r_speed;
1117 }
1118 
1119 
1120 INLINE bool EggGroup::
1121 has_scrolling_uvs() {
1122  return (_u_speed != 0) || (_v_speed != 0) || (_w_speed != 0) || (_r_speed != 0);
1123 }
TagData::const_iterator tag_begin() const
Returns an iterator that can, in conjunction with tag_end(), be used to traverse the entire set of ta...
Definition: eggGroup.I:999
const EggTransform & get_default_pose() const
Returns a read-only accessor to the initial pose transform.
Definition: eggGroup.I:942
void clear_transform()
Resets the transform to empty, identity.
Definition: eggTransform.I:125
void transform(const LMatrix4d &mat)
Applies the indicated transformation to the node and all of its descendants.
Definition: eggNode.I:313
void set_indexed_flag(bool flag)
If this flag is true, geometry at this node and below will be generated as indexed geometry...
Definition: eggGroup.I:556
VertexRef::const_iterator vref_begin() const
Returns an iterator that can, in conjunction with vref_end(), be used to traverse the entire set of r...
Definition: eggGroup.I:1045
TagData::const_iterator tag_end() const
Returns an iterator that can, in conjunction with tag_begin(), be used to traverse the entire set of ...
Definition: eggGroup.I:1015
void clear_blend_color()
Removes the blend color specification.
Definition: eggGroup.I:799
static BitMask< PN_uint32, nbits > all_off()
Returns a BitMask whose bits are all off.
Definition: bitMask.I:86
TagData::size_type tag_size() const
Returns the number of elements between tag_begin() and tag_end().
Definition: eggGroup.I:1029
void set_billboard_center(const LPoint3d &billboard_center)
Sets the point around which the billboard will rotate, if this node contains a billboard specificatio...
Definition: eggGroup.I:91
EggTransform & modify_default_pose()
Returns a writable accessor to the initial pose transform.
Definition: eggGroup.I:957
bool is_instance_type() const
Returns true if this group is an instance type node; i.e.
Definition: eggGroup.I:39
const LColor & get_blend_color() const
Returns the blend color if one has been specified, or (0, 0, 0, 0) if one has not.
Definition: eggGroup.I:822
VertexRef::size_type vref_size() const
Returns the number of elements between vref_begin() and vref_end().
Definition: eggGroup.I:1075
void set_tag(const string &key, const string &value)
Associates a user-defined value with a user-defined key which is stored on the node.
Definition: eggGroup.I:883
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
bool has_tag(const string &key) const
Returns true if a value has been defined on this node for the particular key (even if that value is t...
Definition: eggGroup.I:913
bool has_blend_color() const
Returns true if the blend color has been specified, false otherwise.
Definition: eggGroup.I:811
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:544
string get_tag(const string &key) const
Retrieves the user-defined value that was previously set on this node for the particular key...
Definition: eggGroup.I:896
bool has_dcs_type() const
Returns true if the specified DCS type is not DC_none and not DC_unspecified.
Definition: eggGroup.I:244
This corresponds to a <SwitchCondition> entry within a group.
void clear_default_pose()
Removes the initial pose transform.
Definition: eggGroup.I:983
VertexRef::const_iterator vref_end() const
Returns an iterator that can, in conjunction with vref_begin(), be used to traverse the entire set of...
Definition: eggGroup.I:1061
static const LVecBase4f & zero()
Returns a zero-length vector.
Definition: lvecBase4.h:493
void set_default_pose(const EggTransform &transform)
Replaces the initial pose transform.
Definition: eggGroup.I:972
This represents the <Transform> entry of a group or texture node: a list of component transform opera...
Definition: eggTransform.h:33
void clear_tag(const string &key)
Removes the value defined for this key on this particular node.
Definition: eggGroup.I:927