Panda3D

eggGroup.I

00001 // Filename: eggGroup.I
00002 // Created by:  drose (16Jan99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: EggGroup::get_group_type
00018 //       Access: Published
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE EggGroup::GroupType EggGroup::
00022 get_group_type() const {
00023   return (GroupType)(_flags & F_group_type);
00024 }
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //     Function: EggGroup::is_instance_type
00028 //       Access: Published
00029 //  Description: Returns true if this group is an instance type node;
00030 //               i.e. it begins the root of a local coordinate space.
00031 //               This is not related to instancing (multiple copies of
00032 //               a node in a scene graph).
00033 //
00034 //               This also includes the case of the node including a
00035 //               billboard flag without an explicit center, which
00036 //               implicitly makes the node behave like an instance.
00037 ////////////////////////////////////////////////////////////////////
00038 INLINE bool EggGroup::
00039 is_instance_type() const {
00040   return 
00041     (get_group_type() == GT_instance) ||
00042     (get_billboard_type() != BT_none && !has_billboard_center());
00043 }
00044 
00045 ////////////////////////////////////////////////////////////////////
00046 //     Function: EggGroup::set_billboard_type
00047 //       Access: Published
00048 //  Description:
00049 ////////////////////////////////////////////////////////////////////
00050 INLINE void EggGroup::
00051 set_billboard_type(BillboardType type) {
00052   // Make sure the user didn't give us any stray bits.
00053   nassertv((type & ~F_billboard_type)==0);
00054   _flags = (_flags & ~F_billboard_type) | type;
00055   // This may change the transform space of this node.
00056   update_under(0);
00057 }
00058 
00059 ////////////////////////////////////////////////////////////////////
00060 //     Function: EggGroup::get_billboard_type
00061 //       Access: Published
00062 //  Description:
00063 ////////////////////////////////////////////////////////////////////
00064 INLINE EggGroup::BillboardType EggGroup::
00065 get_billboard_type() const {
00066   return (BillboardType)(_flags & F_billboard_type);
00067 }
00068 
00069 ////////////////////////////////////////////////////////////////////
00070 //     Function: EggGroup::set_billboard_center
00071 //       Access: Published
00072 //  Description: Sets the point around which the billboard will
00073 //               rotate, if this node contains a billboard
00074 //               specification.
00075 //
00076 //               If a billboard type is given but no billboard_center
00077 //               is specified, then the group node is treated as an
00078 //               <Instance>, and the billboard rotates around the
00079 //               origin.  If, however, a billboard_center is
00080 //               specified, then the group node is *not* treated as an
00081 //               <Instance>, and the billboard rotates around the
00082 //               specified point.
00083 //
00084 //               The point is in the same coordinate system as the
00085 //               vertices of this node: usually global, but possibly
00086 //               local if there is an <Instance> somewhere above.
00087 //               Specifically, this is the coordinate system defined
00088 //               by get_vertex_frame().
00089 ////////////////////////////////////////////////////////////////////
00090 INLINE void EggGroup::
00091 set_billboard_center(const LPoint3d &billboard_center) {
00092   _billboard_center = billboard_center;
00093   _flags2 |= F2_billboard_center;
00094   // This may change the transform space of this node.
00095   update_under(0);
00096 }
00097 
00098 ////////////////////////////////////////////////////////////////////
00099 //     Function: EggGroup::clear_billboard_center
00100 //       Access: Published
00101 //  Description:
00102 ////////////////////////////////////////////////////////////////////
00103 INLINE void EggGroup::
00104 clear_billboard_center() {
00105   _flags2 &= ~F2_billboard_center;
00106   // This may change the transform space of this node.
00107   update_under(0);
00108 }
00109 
00110 ////////////////////////////////////////////////////////////////////
00111 //     Function: EggGroup::has_billboard_center
00112 //       Access: Published
00113 //  Description:
00114 ////////////////////////////////////////////////////////////////////
00115 INLINE bool EggGroup::
00116 has_billboard_center() const {
00117   return (_flags2 & F2_billboard_center) != 0;
00118 }
00119 
00120 ////////////////////////////////////////////////////////////////////
00121 //     Function: EggGroup::get_billboard_center
00122 //       Access: Published
00123 //  Description:
00124 ////////////////////////////////////////////////////////////////////
00125 INLINE const LPoint3d &EggGroup::
00126 get_billboard_center() const {
00127   nassertr(has_billboard_center(), _billboard_center);
00128   return _billboard_center;
00129 }
00130 
00131 ////////////////////////////////////////////////////////////////////
00132 //     Function: EggGroup::set_cs_type
00133 //       Access: Published
00134 //  Description:
00135 ////////////////////////////////////////////////////////////////////
00136 INLINE void EggGroup::
00137 set_cs_type(CollisionSolidType type) {
00138   // Make sure the user didn't give us any stray bits.
00139   nassertv((type & ~F_cs_type)==0);
00140   _flags = (_flags & ~F_cs_type) | type;
00141 }
00142 
00143 ////////////////////////////////////////////////////////////////////
00144 //     Function: EggGroup::get_cs_type
00145 //       Access: Published
00146 //  Description:
00147 ////////////////////////////////////////////////////////////////////
00148 INLINE EggGroup::CollisionSolidType EggGroup::
00149 get_cs_type() const {
00150   return (CollisionSolidType)(_flags & F_cs_type);
00151 }
00152 
00153 ////////////////////////////////////////////////////////////////////
00154 //     Function: EggGroup::set_collision_name
00155 //       Access: Published
00156 //  Description:
00157 ////////////////////////////////////////////////////////////////////
00158 INLINE void EggGroup::
00159 set_collision_name(const string &collision_name) {
00160   _collision_name = collision_name;
00161 }
00162 
00163 ////////////////////////////////////////////////////////////////////
00164 //     Function: EggGroup::clear_collision_name
00165 //       Access: Published
00166 //  Description:
00167 ////////////////////////////////////////////////////////////////////
00168 INLINE void EggGroup::
00169 clear_collision_name() {
00170   _collision_name = "";
00171 }
00172 
00173 ////////////////////////////////////////////////////////////////////
00174 //     Function: EggGroup::has_collision_name
00175 //       Access: Published
00176 //  Description:
00177 ////////////////////////////////////////////////////////////////////
00178 INLINE bool EggGroup::
00179 has_collision_name() const {
00180   return !_collision_name.empty();
00181 }
00182 
00183 ////////////////////////////////////////////////////////////////////
00184 //     Function: EggGroup::get_collision_name
00185 //       Access: Published
00186 //  Description:
00187 ////////////////////////////////////////////////////////////////////
00188 INLINE const string &EggGroup::
00189 get_collision_name() const {
00190   return _collision_name;
00191 }
00192 
00193 ////////////////////////////////////////////////////////////////////
00194 //     Function: EggGroup::set_collide_flags
00195 //       Access: Published
00196 //  Description:
00197 ////////////////////////////////////////////////////////////////////
00198 INLINE void EggGroup::
00199 set_collide_flags(int flags) {
00200   // Make sure the user didn't give us any stray bits.
00201   nassertv((flags & ~F_collide_flags)==0);
00202   _flags = (_flags & ~F_collide_flags) | flags;
00203 }
00204 
00205 ////////////////////////////////////////////////////////////////////
00206 //     Function: EggGroup::get_collide_flags
00207 //       Access: Published
00208 //  Description:
00209 ////////////////////////////////////////////////////////////////////
00210 INLINE EggGroup::CollideFlags EggGroup::
00211 get_collide_flags() const {
00212   return (EggGroup::CollideFlags)(_flags & F_collide_flags);
00213 }
00214 
00215 ////////////////////////////////////////////////////////////////////
00216 //     Function: EggGroup::set_dcs_type
00217 //       Access: Published
00218 //  Description:
00219 ////////////////////////////////////////////////////////////////////
00220 INLINE void EggGroup::
00221 set_dcs_type(EggGroup::DCSType type) {
00222   // Make sure the user didn't give us any stray bits.
00223   nassertv((type & ~F2_dcs_type)==0);
00224   _flags2 = (_flags2 & ~F2_dcs_type) | type;
00225 }
00226 
00227 ////////////////////////////////////////////////////////////////////
00228 //     Function: EggGroup::get_dcs_type
00229 //       Access: Published
00230 //  Description:
00231 ////////////////////////////////////////////////////////////////////
00232 INLINE EggGroup::DCSType EggGroup::
00233 get_dcs_type() const {
00234   return (DCSType)(_flags2 & F2_dcs_type);
00235 }
00236 
00237 ////////////////////////////////////////////////////////////////////
00238 //     Function: EggGroup::has_dcs_type
00239 //       Access: Published
00240 //  Description: Returns true if the specified DCS type is not
00241 //               DC_none and not DC_unspecified.
00242 ////////////////////////////////////////////////////////////////////
00243 INLINE bool EggGroup::
00244 has_dcs_type() const {
00245   DCSType type = get_dcs_type();
00246   return (type != DC_none && type != DC_unspecified);
00247 }
00248 
00249 ////////////////////////////////////////////////////////////////////
00250 //     Function: EggGroup::set_dart_type
00251 //       Access: Published
00252 //  Description:
00253 ////////////////////////////////////////////////////////////////////
00254 INLINE void EggGroup::
00255 set_dart_type(EggGroup::DartType type) {
00256   // Make sure the user didn't give us any stray bits.
00257   nassertv((type & ~F_dart_type)==0);
00258   _flags = (_flags & ~F_dart_type) | type;
00259 }
00260 
00261 ////////////////////////////////////////////////////////////////////
00262 //     Function: EggGroup::get_dart_type
00263 //       Access: Published
00264 //  Description:
00265 ////////////////////////////////////////////////////////////////////
00266 INLINE EggGroup::DartType EggGroup::
00267 get_dart_type() const {
00268   return (DartType)(_flags & F_dart_type);
00269 }
00270 
00271 ////////////////////////////////////////////////////////////////////
00272 //     Function: EggGroup::set_switch_flag
00273 //       Access: Published
00274 //  Description:
00275 ////////////////////////////////////////////////////////////////////
00276 INLINE void EggGroup::
00277 set_switch_flag(bool flag) {
00278   if (flag) {
00279     _flags |= F_switch_flag;
00280   } else {
00281     _flags &= ~F_switch_flag;
00282   }
00283 }
00284 
00285 ////////////////////////////////////////////////////////////////////
00286 //     Function: EggGroup::get_switch_flag
00287 //       Access: Published
00288 //  Description:
00289 ////////////////////////////////////////////////////////////////////
00290 INLINE bool EggGroup::
00291 get_switch_flag() const {
00292   return ((_flags & F_switch_flag) != 0);
00293 }
00294 
00295 ////////////////////////////////////////////////////////////////////
00296 //     Function: EggGroup::set_switch_fps
00297 //       Access: Published
00298 //  Description:
00299 ////////////////////////////////////////////////////////////////////
00300 INLINE void EggGroup::
00301 set_switch_fps(double fps) {
00302   _fps = fps;
00303 }
00304 
00305 ////////////////////////////////////////////////////////////////////
00306 //     Function: EggGroup::get_switch_fps
00307 //       Access: Published
00308 //  Description:
00309 ////////////////////////////////////////////////////////////////////
00310 INLINE double EggGroup::
00311 get_switch_fps() const {
00312   return _fps;
00313 }
00314 
00315 ////////////////////////////////////////////////////////////////////
00316 //     Function: EggGroup::add_object_type
00317 //       Access: Published
00318 //  Description:
00319 ////////////////////////////////////////////////////////////////////
00320 INLINE void EggGroup::
00321 add_object_type(const string &object_type) {
00322   _object_types.push_back(object_type);
00323 }
00324 
00325 ////////////////////////////////////////////////////////////////////
00326 //     Function: EggGroup::clear_object_types
00327 //       Access: Published
00328 //  Description:
00329 ////////////////////////////////////////////////////////////////////
00330 INLINE void EggGroup::
00331 clear_object_types() {
00332   _object_types.clear();
00333 }
00334 
00335 ////////////////////////////////////////////////////////////////////
00336 //     Function: EggGroup::get_num_object_types
00337 //       Access: Published
00338 //  Description:
00339 ////////////////////////////////////////////////////////////////////
00340 INLINE int EggGroup::
00341 get_num_object_types() const {
00342   return _object_types.size();
00343 }
00344 
00345 ////////////////////////////////////////////////////////////////////
00346 //     Function: EggGroup::get_object_type
00347 //       Access: Published
00348 //  Description:
00349 ////////////////////////////////////////////////////////////////////
00350 INLINE string EggGroup::
00351 get_object_type(int index) const {
00352   nassertr(index >= 0 && index < (int)_object_types.size(), string());
00353   return _object_types[index];
00354 }
00355 
00356 ////////////////////////////////////////////////////////////////////
00357 //     Function: EggGroup::set_model_flag
00358 //       Access: Published
00359 //  Description:
00360 ////////////////////////////////////////////////////////////////////
00361 INLINE void EggGroup::
00362 set_model_flag(bool flag) {
00363   if (flag) {
00364     _flags |= F_model_flag;
00365   } else {
00366     _flags &= ~F_model_flag;
00367   }
00368 }
00369 
00370 ////////////////////////////////////////////////////////////////////
00371 //     Function: EggGroup::get_model_flag
00372 //       Access: Published
00373 //  Description:
00374 ////////////////////////////////////////////////////////////////////
00375 INLINE bool EggGroup::
00376 get_model_flag() const {
00377   return ((_flags & F_model_flag) != 0);
00378 }
00379 
00380 ////////////////////////////////////////////////////////////////////
00381 //     Function: EggGroup::set_texlist_flag
00382 //       Access: Published
00383 //  Description:
00384 ////////////////////////////////////////////////////////////////////
00385 INLINE void EggGroup::
00386 set_texlist_flag(bool flag) {
00387   if (flag) {
00388     _flags |= F_texlist_flag;
00389   } else {
00390     _flags &= ~F_texlist_flag;
00391   }
00392 }
00393 
00394 ////////////////////////////////////////////////////////////////////
00395 //     Function: EggGroup::get_texlist_flag
00396 //       Access: Published
00397 //  Description:
00398 ////////////////////////////////////////////////////////////////////
00399 INLINE bool EggGroup::
00400 get_texlist_flag() const {
00401   return ((_flags & F_texlist_flag) != 0);
00402 }
00403 
00404 ////////////////////////////////////////////////////////////////////
00405 //     Function: EggGroup::set_nofog_flag
00406 //       Access: Published
00407 //  Description:
00408 ////////////////////////////////////////////////////////////////////
00409 INLINE void EggGroup::
00410 set_nofog_flag(bool flag) {
00411   if (flag) {
00412     _flags |= F_nofog_flag;
00413   } else {
00414     _flags &= ~F_nofog_flag;
00415   }
00416 }
00417 
00418 ////////////////////////////////////////////////////////////////////
00419 //     Function: EggGroup::get_nofog_flag
00420 //       Access: Published
00421 //  Description:
00422 ////////////////////////////////////////////////////////////////////
00423 INLINE bool EggGroup::
00424 get_nofog_flag() const {
00425   return ((_flags & F_nofog_flag) != 0);
00426 }
00427 
00428 ////////////////////////////////////////////////////////////////////
00429 //     Function: EggGroup::set_decal_flag
00430 //       Access: Published
00431 //  Description:
00432 ////////////////////////////////////////////////////////////////////
00433 INLINE void EggGroup::
00434 set_decal_flag(bool flag) {
00435   if (flag) {
00436     _flags |= F_decal_flag;
00437   } else {
00438     _flags &= ~F_decal_flag;
00439   }
00440 }
00441 
00442 ////////////////////////////////////////////////////////////////////
00443 //     Function: EggGroup::get_decal_flag
00444 //       Access: Published
00445 //  Description:
00446 ////////////////////////////////////////////////////////////////////
00447 INLINE bool EggGroup::
00448 get_decal_flag() const {
00449   return ((_flags & F_decal_flag) != 0);
00450 }
00451 
00452 ////////////////////////////////////////////////////////////////////
00453 //     Function: EggGroup::set_direct_flag
00454 //       Access: Published
00455 //  Description:
00456 ////////////////////////////////////////////////////////////////////
00457 INLINE void EggGroup::
00458 set_direct_flag(bool flag) {
00459   if (flag) {
00460     _flags |= F_direct_flag;
00461   } else {
00462     _flags &= ~F_direct_flag;
00463   }
00464 }
00465 
00466 ////////////////////////////////////////////////////////////////////
00467 //     Function: EggGroup::get_direct_flag
00468 //       Access: Published
00469 //  Description:
00470 ////////////////////////////////////////////////////////////////////
00471 INLINE bool EggGroup::
00472 get_direct_flag() const {
00473   return ((_flags & F_direct_flag) != 0);
00474 }
00475 
00476 
00477 ////////////////////////////////////////////////////////////////////
00478 //     Function: EggGroup::set_portal_flag
00479 //       Access: Published
00480 //  Description:
00481 ////////////////////////////////////////////////////////////////////
00482 INLINE void EggGroup::
00483 set_portal_flag(bool flag) {
00484   if (flag) {
00485     _flags2 |= F2_portal_flag;
00486   } else {
00487     _flags2 &= ~F2_portal_flag;
00488   }
00489 }
00490 
00491 ////////////////////////////////////////////////////////////////////
00492 //     Function: EggGroup::get_portal_flag
00493 //       Access: Published
00494 //  Description:
00495 ////////////////////////////////////////////////////////////////////
00496 INLINE bool EggGroup::
00497 get_portal_flag() const {
00498   return ((_flags2 & F2_portal_flag) != 0);
00499 }
00500 
00501 ////////////////////////////////////////////////////////////////////
00502 //     Function: EggGroup::set_occluder_flag
00503 //       Access: Published
00504 //  Description:
00505 ////////////////////////////////////////////////////////////////////
00506 INLINE void EggGroup::
00507 set_occluder_flag(bool flag) {
00508   if (flag) {
00509     _flags2 |= F2_occluder_flag;
00510   } else {
00511     _flags2 &= ~F2_occluder_flag;
00512   }
00513 }
00514 
00515 ////////////////////////////////////////////////////////////////////
00516 //     Function: EggGroup::get_occluder_flag
00517 //       Access: Published
00518 //  Description:
00519 ////////////////////////////////////////////////////////////////////
00520 INLINE bool EggGroup::
00521 get_occluder_flag() const {
00522   return ((_flags2 & F2_occluder_flag) != 0);
00523 }
00524 
00525 ////////////////////////////////////////////////////////////////////
00526 //     Function: EggGroup::set_polylight_flag
00527 //       Access: Published
00528 //  Description:
00529 ////////////////////////////////////////////////////////////////////
00530 INLINE void EggGroup::
00531 set_polylight_flag(bool flag) {
00532   if (flag) {
00533     _flags2 |= F2_polylight_flag;
00534   } else {
00535     _flags2 &= ~F2_polylight_flag;
00536   }
00537 }
00538 
00539 ////////////////////////////////////////////////////////////////////
00540 //     Function: EggGroup::get_polylight_flag
00541 //       Access: Published
00542 //  Description:
00543 ////////////////////////////////////////////////////////////////////
00544 INLINE bool EggGroup::
00545 get_polylight_flag() const {
00546   return ((_flags2 & F2_polylight_flag) != 0);
00547 }
00548 
00549 ////////////////////////////////////////////////////////////////////
00550 //     Function: EggGroup::set_indexed_flag
00551 //       Access: Published
00552 //  Description: If this flag is true, geometry at this node and below
00553 //               will be generated as indexed geometry.
00554 ////////////////////////////////////////////////////////////////////
00555 INLINE void EggGroup::
00556 set_indexed_flag(bool flag) {
00557   if (flag) {
00558     _flags2 |= F2_indexed_flag;
00559   } else {
00560     _flags2 &= ~F2_indexed_flag;
00561   }
00562   _flags2 |= F2_has_indexed_flag;
00563 }
00564 
00565 ////////////////////////////////////////////////////////////////////
00566 //     Function: EggGroup::clear_indexed_flag
00567 //       Access: Published
00568 //  Description:
00569 ////////////////////////////////////////////////////////////////////
00570 INLINE void EggGroup::
00571 clear_indexed_flag() {
00572   _flags2 &= ~(F2_indexed_flag | F2_has_indexed_flag);
00573 }
00574 
00575 ////////////////////////////////////////////////////////////////////
00576 //     Function: EggGroup::has_indexed_flag
00577 //       Access: Published
00578 //  Description:
00579 ////////////////////////////////////////////////////////////////////
00580 INLINE bool EggGroup::
00581 has_indexed_flag() const {
00582   return (_flags2 & F2_has_indexed_flag) != 0;
00583 }
00584 
00585 ////////////////////////////////////////////////////////////////////
00586 //     Function: EggGroup::get_indexed_flag
00587 //       Access: Published
00588 //  Description:
00589 ////////////////////////////////////////////////////////////////////
00590 INLINE bool EggGroup::
00591 get_indexed_flag() const {
00592   nassertr(has_indexed_flag(), false);
00593   return ((_flags2 & F2_indexed_flag) != 0);
00594 }
00595 
00596 ////////////////////////////////////////////////////////////////////
00597 //     Function: EggGroup::set_collide_mask
00598 //       Access: Published
00599 //  Description:
00600 ////////////////////////////////////////////////////////////////////
00601 INLINE void EggGroup::
00602 set_collide_mask(CollideMask mask) {
00603   _collide_mask = mask;
00604   _flags2 |= F2_collide_mask;
00605 }
00606 
00607 ////////////////////////////////////////////////////////////////////
00608 //     Function: EggGroup::clear_collide_mask
00609 //       Access: Published
00610 //  Description:
00611 ////////////////////////////////////////////////////////////////////
00612 INLINE void EggGroup::
00613 clear_collide_mask() {
00614   _flags2 &= ~F2_collide_mask;
00615   _collide_mask = CollideMask::all_off();
00616 }
00617 
00618 ////////////////////////////////////////////////////////////////////
00619 //     Function: EggGroup::has_collide_mask
00620 //       Access: Published
00621 //  Description:
00622 ////////////////////////////////////////////////////////////////////
00623 INLINE bool EggGroup::
00624 has_collide_mask() const {
00625   return (_flags2 & F2_collide_mask) != 0;
00626 }
00627 
00628 ////////////////////////////////////////////////////////////////////
00629 //     Function: EggGroup::get_collide_mask
00630 //       Access: Published
00631 //  Description:
00632 ////////////////////////////////////////////////////////////////////
00633 INLINE CollideMask EggGroup::
00634 get_collide_mask() const {
00635   return _collide_mask;
00636 }
00637 
00638 ////////////////////////////////////////////////////////////////////
00639 //     Function: EggGroup::set_from_collide_mask
00640 //       Access: Published
00641 //  Description:
00642 ////////////////////////////////////////////////////////////////////
00643 INLINE void EggGroup::
00644 set_from_collide_mask(CollideMask mask) {
00645   _from_collide_mask = mask;
00646   _flags2 |= F2_from_collide_mask;
00647 }
00648 
00649 ////////////////////////////////////////////////////////////////////
00650 //     Function: EggGroup::clear_from_collide_mask
00651 //       Access: Published
00652 //  Description:
00653 ////////////////////////////////////////////////////////////////////
00654 INLINE void EggGroup::
00655 clear_from_collide_mask() {
00656   _flags2 &= ~F2_from_collide_mask;
00657   _from_collide_mask = CollideMask::all_off();
00658 }
00659 
00660 ////////////////////////////////////////////////////////////////////
00661 //     Function: EggGroup::has_from_collide_mask
00662 //       Access: Published
00663 //  Description:
00664 ////////////////////////////////////////////////////////////////////
00665 INLINE bool EggGroup::
00666 has_from_collide_mask() const {
00667   return (_flags2 & F2_from_collide_mask) != 0;
00668 }
00669 
00670 ////////////////////////////////////////////////////////////////////
00671 //     Function: EggGroup::get_from_collide_mask
00672 //       Access: Published
00673 //  Description:
00674 ////////////////////////////////////////////////////////////////////
00675 INLINE CollideMask EggGroup::
00676 get_from_collide_mask() const {
00677   return _from_collide_mask;
00678 }
00679 
00680 ////////////////////////////////////////////////////////////////////
00681 //     Function: EggGroup::set_into_collide_mask
00682 //       Access: Published
00683 //  Description:
00684 ////////////////////////////////////////////////////////////////////
00685 INLINE void EggGroup::
00686 set_into_collide_mask(CollideMask mask) {
00687   _into_collide_mask = mask;
00688   _flags2 |= F2_into_collide_mask;
00689 }
00690 
00691 ////////////////////////////////////////////////////////////////////
00692 //     Function: EggGroup::clear_into_collide_mask
00693 //       Access: Published
00694 //  Description:
00695 ////////////////////////////////////////////////////////////////////
00696 INLINE void EggGroup::
00697 clear_into_collide_mask() {
00698   _flags2 &= ~F2_into_collide_mask;
00699   _into_collide_mask = CollideMask::all_off();
00700 }
00701 
00702 ////////////////////////////////////////////////////////////////////
00703 //     Function: EggGroup::has_into_collide_mask
00704 //       Access: Published
00705 //  Description:
00706 ////////////////////////////////////////////////////////////////////
00707 INLINE bool EggGroup::
00708 has_into_collide_mask() const {
00709   return (_flags2 & F2_into_collide_mask) != 0;
00710 }
00711 
00712 ////////////////////////////////////////////////////////////////////
00713 //     Function: EggGroup::get_into_collide_mask
00714 //       Access: Published
00715 //  Description:
00716 ////////////////////////////////////////////////////////////////////
00717 INLINE CollideMask EggGroup::
00718 get_into_collide_mask() const {
00719   return _into_collide_mask;
00720 }
00721 
00722 ////////////////////////////////////////////////////////////////////
00723 //     Function: EggGroup::set_blend_mode
00724 //       Access: Published
00725 //  Description:
00726 ////////////////////////////////////////////////////////////////////
00727 INLINE void EggGroup::
00728 set_blend_mode(EggGroup::BlendMode blend_mode) {
00729   _blend_mode = blend_mode;
00730 }
00731 
00732 ////////////////////////////////////////////////////////////////////
00733 //     Function: EggGroup::get_blend_mode
00734 //       Access: Published
00735 //  Description:
00736 ////////////////////////////////////////////////////////////////////
00737 INLINE EggGroup::BlendMode EggGroup::
00738 get_blend_mode() const {
00739   return _blend_mode;
00740 }
00741 
00742 ////////////////////////////////////////////////////////////////////
00743 //     Function: EggGroup::set_blend_operand_a
00744 //       Access: Published
00745 //  Description:
00746 ////////////////////////////////////////////////////////////////////
00747 INLINE void EggGroup::
00748 set_blend_operand_a(EggGroup::BlendOperand blend_operand_a) {
00749   _blend_operand_a = blend_operand_a;
00750 }
00751 
00752 ////////////////////////////////////////////////////////////////////
00753 //     Function: EggGroup::get_blend_operand_a
00754 //       Access: Published
00755 //  Description:
00756 ////////////////////////////////////////////////////////////////////
00757 INLINE EggGroup::BlendOperand EggGroup::
00758 get_blend_operand_a() const {
00759   return _blend_operand_a;
00760 }
00761 
00762 ////////////////////////////////////////////////////////////////////
00763 //     Function: EggGroup::set_blend_operand_b
00764 //       Access: Published
00765 //  Description:
00766 ////////////////////////////////////////////////////////////////////
00767 INLINE void EggGroup::
00768 set_blend_operand_b(EggGroup::BlendOperand blend_operand_b) {
00769   _blend_operand_b = blend_operand_b;
00770 }
00771 
00772 ////////////////////////////////////////////////////////////////////
00773 //     Function: EggGroup::get_blend_operand_b
00774 //       Access: Published
00775 //  Description:
00776 ////////////////////////////////////////////////////////////////////
00777 INLINE EggGroup::BlendOperand EggGroup::
00778 get_blend_operand_b() const {
00779   return _blend_operand_b;
00780 }
00781 
00782 ////////////////////////////////////////////////////////////////////
00783 //     Function: EggGroup::set_blend_color
00784 //       Access: Published
00785 //  Description:
00786 ////////////////////////////////////////////////////////////////////
00787 INLINE void EggGroup::
00788 set_blend_color(const LColor &blend_color) {
00789   _blend_color = blend_color;
00790   _flags2 |= F2_has_blend_color;
00791 }
00792 
00793 ////////////////////////////////////////////////////////////////////
00794 //     Function: EggGroup::clear_blend_color
00795 //       Access: Published
00796 //  Description: Removes the blend color specification.
00797 ////////////////////////////////////////////////////////////////////
00798 INLINE void EggGroup::
00799 clear_blend_color() {
00800   _blend_color = LColor::zero();
00801   _flags2 &= ~F2_has_blend_color;
00802 }
00803  
00804 ////////////////////////////////////////////////////////////////////
00805 //     Function: EggGroup::has_blend_color
00806 //       Access: Published
00807 //  Description: Returns true if the blend color has been specified,
00808 //               false otherwise.
00809 ////////////////////////////////////////////////////////////////////
00810 INLINE bool EggGroup::
00811 has_blend_color() const {
00812   return (_flags2 & F2_has_blend_color) != 0;
00813 }
00814 
00815 ////////////////////////////////////////////////////////////////////
00816 //     Function: EggGroup::get_blend_color
00817 //       Access: Published
00818 //  Description: Returns the blend color if one has been specified, or
00819 //               (0, 0, 0, 0) if one has not.
00820 ////////////////////////////////////////////////////////////////////
00821 INLINE const LColor &EggGroup::
00822 get_blend_color() const {
00823   return _blend_color;
00824 }
00825 
00826 ////////////////////////////////////////////////////////////////////
00827 //     Function: EggGroup::set_lod
00828 //       Access: Published
00829 //  Description:
00830 ////////////////////////////////////////////////////////////////////
00831 INLINE void EggGroup::
00832 set_lod(const EggSwitchCondition &lod) {
00833   _lod = lod.make_copy();
00834 }
00835 
00836 ////////////////////////////////////////////////////////////////////
00837 //     Function: EggGroup::clear_lod
00838 //       Access: Published
00839 //  Description:
00840 ////////////////////////////////////////////////////////////////////
00841 INLINE void EggGroup::
00842 clear_lod() {
00843   _lod = NULL;
00844 }
00845 
00846 ////////////////////////////////////////////////////////////////////
00847 //     Function: EggGroup::has_lod
00848 //       Access: Published
00849 //  Description:
00850 ////////////////////////////////////////////////////////////////////
00851 INLINE bool EggGroup::
00852 has_lod() const {
00853   return (_lod != (EggSwitchCondition *)NULL);
00854 }
00855 
00856 ////////////////////////////////////////////////////////////////////
00857 //     Function: EggGroup::get_lod
00858 //       Access: Published
00859 //  Description:
00860 ////////////////////////////////////////////////////////////////////
00861 INLINE const EggSwitchCondition &EggGroup::
00862 get_lod() const {
00863   return *_lod;
00864 }
00865 
00866 ////////////////////////////////////////////////////////////////////
00867 //     Function: EggGroup::set_tag
00868 //       Access: Published
00869 //  Description: Associates a user-defined value with a user-defined
00870 //               key which is stored on the node.  This value has no
00871 //               meaning to Panda; but it is stored indefinitely on
00872 //               the node until it is requested again.  This value
00873 //               will be copied to the PandaNode that is created for
00874 //               this particular EggGroup if the egg file is loaded as
00875 //               a scene.
00876 //
00877 //               Each unique key stores a different string value.
00878 //               There is no effective limit on the number of
00879 //               different keys that may be stored or on the length of
00880 //               any one key's value.
00881 ////////////////////////////////////////////////////////////////////
00882 INLINE void EggGroup::
00883 set_tag(const string &key, const string &value) {
00884   _tag_data[key] = value;
00885 }
00886 
00887 ////////////////////////////////////////////////////////////////////
00888 //     Function: EggGroup::get_tag
00889 //       Access: Published
00890 //  Description: Retrieves the user-defined value that was previously
00891 //               set on this node for the particular key, if any.  If
00892 //               no value has been previously set, returns the empty
00893 //               string.
00894 ////////////////////////////////////////////////////////////////////
00895 INLINE string EggGroup::
00896 get_tag(const string &key) const {
00897   TagData::const_iterator ti;
00898   ti = _tag_data.find(key);
00899   if (ti != _tag_data.end()) {
00900     return (*ti).second;
00901   }
00902   return string();
00903 }
00904 
00905 ////////////////////////////////////////////////////////////////////
00906 //     Function: EggGroup::has_tag
00907 //       Access: Published
00908 //  Description: Returns true if a value has been defined on this node
00909 //               for the particular key (even if that value is the
00910 //               empty string), or false if no value has been set.
00911 ////////////////////////////////////////////////////////////////////
00912 INLINE bool EggGroup::
00913 has_tag(const string &key) const {
00914   TagData::const_iterator ti;
00915   ti = _tag_data.find(key);
00916   return (ti != _tag_data.end());
00917 }
00918 
00919 ////////////////////////////////////////////////////////////////////
00920 //     Function: EggGroup::clear_tag
00921 //       Access: Published
00922 //  Description: Removes the value defined for this key on this
00923 //               particular node.  After a call to clear_tag(),
00924 //               has_tag() will return false for the indicated key.
00925 ////////////////////////////////////////////////////////////////////
00926 INLINE void EggGroup::
00927 clear_tag(const string &key) {
00928   _tag_data.erase(key);
00929 }
00930 
00931 ////////////////////////////////////////////////////////////////////
00932 //     Function: EggGroup::get_default_pose
00933 //       Access: Published
00934 //  Description: Returns a read-only accessor to the initial pose
00935 //               transform.  This is the <DefaultPose> entry for a
00936 //               Joint, and defines only the initial transform pose
00937 //               for the unanimated joint; it has nothing to do with
00938 //               the group's <Transform> entry, which defines the
00939 //               (eventual) space of the group's vertices.
00940 ////////////////////////////////////////////////////////////////////
00941 INLINE const EggTransform &EggGroup::
00942 get_default_pose() const {
00943   return _default_pose;
00944 }
00945 
00946 ////////////////////////////////////////////////////////////////////
00947 //     Function: EggGroup::modify_default_pose
00948 //       Access: Published
00949 //  Description: Returns a writable accessor to the initial pose
00950 //               transform.  This is the <DefaultPose> entry for a
00951 //               Joint, and defines only the initial transform pose
00952 //               for the unanimated joint; it has nothing to do with
00953 //               the group's <Transform> entry, which defines the
00954 //               (eventual) space of the group's vertices.
00955 ////////////////////////////////////////////////////////////////////
00956 INLINE EggTransform &EggGroup::
00957 modify_default_pose() {
00958   return _default_pose;
00959 }
00960 
00961 ////////////////////////////////////////////////////////////////////
00962 //     Function: EggGroup::set_default_pose
00963 //       Access: Published
00964 //  Description: Replaces the initial pose transform.  This is the
00965 //               <DefaultPose> entry for a Joint, and defines only the
00966 //               initial transform pose for the unanimated joint; it
00967 //               has nothing to do with the group's <Transform> entry,
00968 //               which defines the (eventual) space of the group's
00969 //               vertices.
00970 ////////////////////////////////////////////////////////////////////
00971 INLINE void EggGroup::
00972 set_default_pose(const EggTransform &transform) {
00973   _default_pose = transform;
00974 }
00975 
00976 ////////////////////////////////////////////////////////////////////
00977 //     Function: EggGroup::clear_default_pose
00978 //       Access: Published
00979 //  Description: Removes the initial pose transform.  See
00980 //               set_default_pose().
00981 ////////////////////////////////////////////////////////////////////
00982 INLINE void EggGroup::
00983 clear_default_pose() {
00984   _default_pose.clear_transform();
00985 }
00986 
00987 ////////////////////////////////////////////////////////////////////
00988 //     Function: EggGroup::tag_begin
00989 //       Access: Public
00990 //  Description: Returns an iterator that can, in conjunction with
00991 //               tag_end(), be used to traverse the entire set of
00992 //               tag keys.  Each iterator returns a pair<string,
00993 //               string>.
00994 //
00995 //               This interface is not safe to use outside of
00996 //               PANDAEGG.DLL.
00997 ////////////////////////////////////////////////////////////////////
00998 INLINE EggGroup::TagData::const_iterator EggGroup::
00999 tag_begin() const {
01000   return _tag_data.begin();
01001 }
01002 
01003 ////////////////////////////////////////////////////////////////////
01004 //     Function: EggGroup::tag_end
01005 //       Access: Public
01006 //  Description: Returns an iterator that can, in conjunction with
01007 //               tag_begin(), be used to traverse the entire set of
01008 //               tag keys.  Each iterator returns a pair<string,
01009 //               string>.
01010 //
01011 //               This interface is not safe to use outside of
01012 //               PANDAEGG.DLL.
01013 ////////////////////////////////////////////////////////////////////
01014 INLINE EggGroup::TagData::const_iterator EggGroup::
01015 tag_end() const {
01016   return _tag_data.end();
01017 }
01018 
01019 ////////////////////////////////////////////////////////////////////
01020 //     Function: EggGroup::tag_size
01021 //       Access: Published
01022 //  Description: Returns the number of elements between tag_begin()
01023 //               and tag_end().
01024 //
01025 //               This interface is not safe to use outside of
01026 //               PANDAEGG.DLL.
01027 ////////////////////////////////////////////////////////////////////
01028 INLINE EggGroup::TagData::size_type EggGroup::
01029 tag_size() const {
01030   return _tag_data.size();
01031 }
01032 
01033 ////////////////////////////////////////////////////////////////////
01034 //     Function: EggGroup::vref_begin
01035 //       Access: Public
01036 //  Description: Returns an iterator that can, in conjunction with
01037 //               vref_end(), be used to traverse the entire set of
01038 //               referenced vertices.  Each iterator returns a
01039 //               pair<PT(EggVertex), double>.
01040 //
01041 //               This interface is not safe to use outside of
01042 //               PANDAEGG.DLL.
01043 ////////////////////////////////////////////////////////////////////
01044 INLINE EggGroup::VertexRef::const_iterator EggGroup::
01045 vref_begin() const {
01046   return _vref.begin();
01047 }
01048 
01049 ////////////////////////////////////////////////////////////////////
01050 //     Function: EggGroup::vref_end
01051 //       Access: Public
01052 //  Description: Returns an iterator that can, in conjunction with
01053 //               vref_begin(), be used to traverse the entire set of
01054 //               referenced vertices.  Each iterator returns a
01055 //               pair<PT(EggVertex), double>.
01056 //
01057 //               This interface is not safe to use outside of
01058 //               PANDAEGG.DLL.
01059 ////////////////////////////////////////////////////////////////////
01060 INLINE EggGroup::VertexRef::const_iterator EggGroup::
01061 vref_end() const {
01062   return _vref.end();
01063 }
01064 
01065 ////////////////////////////////////////////////////////////////////
01066 //     Function: EggGroup::vref_size
01067 //       Access: Published
01068 //  Description: Returns the number of elements between vref_begin()
01069 //               and vref_end().
01070 //
01071 //               This interface is not safe to use outside of
01072 //               PANDAEGG.DLL.
01073 ////////////////////////////////////////////////////////////////////
01074 INLINE EggGroup::VertexRef::size_type EggGroup::
01075 vref_size() const {
01076   return _vref.size();
01077 }
01078 
01079 INLINE void EggGroup::
01080 set_scroll_u(const double u_speed) {
01081   _u_speed = u_speed;
01082 }
01083 
01084 INLINE void EggGroup::
01085 set_scroll_v(const double v_speed) {
01086   _v_speed = v_speed;
01087 }
01088 
01089 INLINE void EggGroup::
01090 set_scroll_r(const double r_speed) {
01091   _r_speed = r_speed;
01092 }
01093 
01094 INLINE double EggGroup::
01095 get_scroll_u() const {
01096   return _u_speed;
01097 }
01098 
01099 INLINE double EggGroup::
01100 get_scroll_v() const {
01101   return _v_speed;
01102 }
01103 
01104 INLINE double EggGroup::
01105 get_scroll_r() const {
01106   return _r_speed;
01107 }
01108 
01109 
01110 INLINE bool EggGroup::
01111 has_scrolling_uvs() {
01112   return (_u_speed != 0) || (_v_speed != 0) || (_r_speed != 0);
01113 }
 All Classes Functions Variables Enumerations