Panda3D
|
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_polylight_flag 00503 // Access: Published 00504 // Description: 00505 //////////////////////////////////////////////////////////////////// 00506 INLINE void EggGroup:: 00507 set_polylight_flag(bool flag) { 00508 if (flag) { 00509 _flags2 |= F2_polylight_flag; 00510 } else { 00511 _flags2 &= ~F2_polylight_flag; 00512 } 00513 } 00514 00515 //////////////////////////////////////////////////////////////////// 00516 // Function: EggGroup::get_polylight_flag 00517 // Access: Published 00518 // Description: 00519 //////////////////////////////////////////////////////////////////// 00520 INLINE bool EggGroup:: 00521 get_polylight_flag() const { 00522 return ((_flags2 & F2_polylight_flag) != 0); 00523 } 00524 00525 //////////////////////////////////////////////////////////////////// 00526 // Function: EggGroup::set_indexed_flag 00527 // Access: Published 00528 // Description: If this flag is true, geometry at this node and below 00529 // will be generated as indexed geometry. 00530 //////////////////////////////////////////////////////////////////// 00531 INLINE void EggGroup:: 00532 set_indexed_flag(bool flag) { 00533 if (flag) { 00534 _flags2 |= F2_indexed_flag; 00535 } else { 00536 _flags2 &= ~F2_indexed_flag; 00537 } 00538 _flags2 |= F2_has_indexed_flag; 00539 } 00540 00541 //////////////////////////////////////////////////////////////////// 00542 // Function: EggGroup::clear_indexed_flag 00543 // Access: Published 00544 // Description: 00545 //////////////////////////////////////////////////////////////////// 00546 INLINE void EggGroup:: 00547 clear_indexed_flag() { 00548 _flags2 &= ~(F2_indexed_flag | F2_has_indexed_flag); 00549 } 00550 00551 //////////////////////////////////////////////////////////////////// 00552 // Function: EggGroup::has_indexed_flag 00553 // Access: Published 00554 // Description: 00555 //////////////////////////////////////////////////////////////////// 00556 INLINE bool EggGroup:: 00557 has_indexed_flag() const { 00558 return (_flags2 & F2_has_indexed_flag) != 0; 00559 } 00560 00561 //////////////////////////////////////////////////////////////////// 00562 // Function: EggGroup::get_indexed_flag 00563 // Access: Published 00564 // Description: 00565 //////////////////////////////////////////////////////////////////// 00566 INLINE bool EggGroup:: 00567 get_indexed_flag() const { 00568 nassertr(has_indexed_flag(), false); 00569 return ((_flags2 & F2_indexed_flag) != 0); 00570 } 00571 00572 //////////////////////////////////////////////////////////////////// 00573 // Function: EggGroup::set_collide_mask 00574 // Access: Published 00575 // Description: 00576 //////////////////////////////////////////////////////////////////// 00577 INLINE void EggGroup:: 00578 set_collide_mask(CollideMask mask) { 00579 _collide_mask = mask; 00580 _flags2 |= F2_collide_mask; 00581 } 00582 00583 //////////////////////////////////////////////////////////////////// 00584 // Function: EggGroup::clear_collide_mask 00585 // Access: Published 00586 // Description: 00587 //////////////////////////////////////////////////////////////////// 00588 INLINE void EggGroup:: 00589 clear_collide_mask() { 00590 _flags2 &= ~F2_collide_mask; 00591 _collide_mask = CollideMask::all_off(); 00592 } 00593 00594 //////////////////////////////////////////////////////////////////// 00595 // Function: EggGroup::has_collide_mask 00596 // Access: Published 00597 // Description: 00598 //////////////////////////////////////////////////////////////////// 00599 INLINE bool EggGroup:: 00600 has_collide_mask() const { 00601 return (_flags2 & F2_collide_mask) != 0; 00602 } 00603 00604 //////////////////////////////////////////////////////////////////// 00605 // Function: EggGroup::get_collide_mask 00606 // Access: Published 00607 // Description: 00608 //////////////////////////////////////////////////////////////////// 00609 INLINE CollideMask EggGroup:: 00610 get_collide_mask() const { 00611 return _collide_mask; 00612 } 00613 00614 //////////////////////////////////////////////////////////////////// 00615 // Function: EggGroup::set_from_collide_mask 00616 // Access: Published 00617 // Description: 00618 //////////////////////////////////////////////////////////////////// 00619 INLINE void EggGroup:: 00620 set_from_collide_mask(CollideMask mask) { 00621 _from_collide_mask = mask; 00622 _flags2 |= F2_from_collide_mask; 00623 } 00624 00625 //////////////////////////////////////////////////////////////////// 00626 // Function: EggGroup::clear_from_collide_mask 00627 // Access: Published 00628 // Description: 00629 //////////////////////////////////////////////////////////////////// 00630 INLINE void EggGroup:: 00631 clear_from_collide_mask() { 00632 _flags2 &= ~F2_from_collide_mask; 00633 _from_collide_mask = CollideMask::all_off(); 00634 } 00635 00636 //////////////////////////////////////////////////////////////////// 00637 // Function: EggGroup::has_from_collide_mask 00638 // Access: Published 00639 // Description: 00640 //////////////////////////////////////////////////////////////////// 00641 INLINE bool EggGroup:: 00642 has_from_collide_mask() const { 00643 return (_flags2 & F2_from_collide_mask) != 0; 00644 } 00645 00646 //////////////////////////////////////////////////////////////////// 00647 // Function: EggGroup::get_from_collide_mask 00648 // Access: Published 00649 // Description: 00650 //////////////////////////////////////////////////////////////////// 00651 INLINE CollideMask EggGroup:: 00652 get_from_collide_mask() const { 00653 return _from_collide_mask; 00654 } 00655 00656 //////////////////////////////////////////////////////////////////// 00657 // Function: EggGroup::set_into_collide_mask 00658 // Access: Published 00659 // Description: 00660 //////////////////////////////////////////////////////////////////// 00661 INLINE void EggGroup:: 00662 set_into_collide_mask(CollideMask mask) { 00663 _into_collide_mask = mask; 00664 _flags2 |= F2_into_collide_mask; 00665 } 00666 00667 //////////////////////////////////////////////////////////////////// 00668 // Function: EggGroup::clear_into_collide_mask 00669 // Access: Published 00670 // Description: 00671 //////////////////////////////////////////////////////////////////// 00672 INLINE void EggGroup:: 00673 clear_into_collide_mask() { 00674 _flags2 &= ~F2_into_collide_mask; 00675 _into_collide_mask = CollideMask::all_off(); 00676 } 00677 00678 //////////////////////////////////////////////////////////////////// 00679 // Function: EggGroup::has_into_collide_mask 00680 // Access: Published 00681 // Description: 00682 //////////////////////////////////////////////////////////////////// 00683 INLINE bool EggGroup:: 00684 has_into_collide_mask() const { 00685 return (_flags2 & F2_into_collide_mask) != 0; 00686 } 00687 00688 //////////////////////////////////////////////////////////////////// 00689 // Function: EggGroup::get_into_collide_mask 00690 // Access: Published 00691 // Description: 00692 //////////////////////////////////////////////////////////////////// 00693 INLINE CollideMask EggGroup:: 00694 get_into_collide_mask() const { 00695 return _into_collide_mask; 00696 } 00697 00698 //////////////////////////////////////////////////////////////////// 00699 // Function: EggGroup::set_blend_mode 00700 // Access: Published 00701 // Description: 00702 //////////////////////////////////////////////////////////////////// 00703 INLINE void EggGroup:: 00704 set_blend_mode(EggGroup::BlendMode blend_mode) { 00705 _blend_mode = blend_mode; 00706 } 00707 00708 //////////////////////////////////////////////////////////////////// 00709 // Function: EggGroup::get_blend_mode 00710 // Access: Published 00711 // Description: 00712 //////////////////////////////////////////////////////////////////// 00713 INLINE EggGroup::BlendMode EggGroup:: 00714 get_blend_mode() const { 00715 return _blend_mode; 00716 } 00717 00718 //////////////////////////////////////////////////////////////////// 00719 // Function: EggGroup::set_blend_operand_a 00720 // Access: Published 00721 // Description: 00722 //////////////////////////////////////////////////////////////////// 00723 INLINE void EggGroup:: 00724 set_blend_operand_a(EggGroup::BlendOperand blend_operand_a) { 00725 _blend_operand_a = blend_operand_a; 00726 } 00727 00728 //////////////////////////////////////////////////////////////////// 00729 // Function: EggGroup::get_blend_operand_a 00730 // Access: Published 00731 // Description: 00732 //////////////////////////////////////////////////////////////////// 00733 INLINE EggGroup::BlendOperand EggGroup:: 00734 get_blend_operand_a() const { 00735 return _blend_operand_a; 00736 } 00737 00738 //////////////////////////////////////////////////////////////////// 00739 // Function: EggGroup::set_blend_operand_b 00740 // Access: Published 00741 // Description: 00742 //////////////////////////////////////////////////////////////////// 00743 INLINE void EggGroup:: 00744 set_blend_operand_b(EggGroup::BlendOperand blend_operand_b) { 00745 _blend_operand_b = blend_operand_b; 00746 } 00747 00748 //////////////////////////////////////////////////////////////////// 00749 // Function: EggGroup::get_blend_operand_b 00750 // Access: Published 00751 // Description: 00752 //////////////////////////////////////////////////////////////////// 00753 INLINE EggGroup::BlendOperand EggGroup:: 00754 get_blend_operand_b() const { 00755 return _blend_operand_b; 00756 } 00757 00758 //////////////////////////////////////////////////////////////////// 00759 // Function: EggGroup::set_blend_color 00760 // Access: Published 00761 // Description: 00762 //////////////////////////////////////////////////////////////////// 00763 INLINE void EggGroup:: 00764 set_blend_color(const Colorf &blend_color) { 00765 _blend_color = blend_color; 00766 _flags2 |= F2_has_blend_color; 00767 } 00768 00769 //////////////////////////////////////////////////////////////////// 00770 // Function: EggGroup::clear_blend_color 00771 // Access: Published 00772 // Description: Removes the blend color specification. 00773 //////////////////////////////////////////////////////////////////// 00774 INLINE void EggGroup:: 00775 clear_blend_color() { 00776 _blend_color = Colorf::zero(); 00777 _flags2 &= ~F2_has_blend_color; 00778 } 00779 00780 //////////////////////////////////////////////////////////////////// 00781 // Function: EggGroup::has_blend_color 00782 // Access: Published 00783 // Description: Returns true if the blend color has been specified, 00784 // false otherwise. 00785 //////////////////////////////////////////////////////////////////// 00786 INLINE bool EggGroup:: 00787 has_blend_color() const { 00788 return (_flags2 & F2_has_blend_color) != 0; 00789 } 00790 00791 //////////////////////////////////////////////////////////////////// 00792 // Function: EggGroup::get_blend_color 00793 // Access: Published 00794 // Description: Returns the blend color if one has been specified, or 00795 // (0, 0, 0, 0) if one has not. 00796 //////////////////////////////////////////////////////////////////// 00797 INLINE const Colorf &EggGroup:: 00798 get_blend_color() const { 00799 return _blend_color; 00800 } 00801 00802 //////////////////////////////////////////////////////////////////// 00803 // Function: EggGroup::set_lod 00804 // Access: Published 00805 // Description: 00806 //////////////////////////////////////////////////////////////////// 00807 INLINE void EggGroup:: 00808 set_lod(const EggSwitchCondition &lod) { 00809 _lod = lod.make_copy(); 00810 } 00811 00812 //////////////////////////////////////////////////////////////////// 00813 // Function: EggGroup::clear_lod 00814 // Access: Published 00815 // Description: 00816 //////////////////////////////////////////////////////////////////// 00817 INLINE void EggGroup:: 00818 clear_lod() { 00819 _lod = NULL; 00820 } 00821 00822 //////////////////////////////////////////////////////////////////// 00823 // Function: EggGroup::has_lod 00824 // Access: Published 00825 // Description: 00826 //////////////////////////////////////////////////////////////////// 00827 INLINE bool EggGroup:: 00828 has_lod() const { 00829 return (_lod != (EggSwitchCondition *)NULL); 00830 } 00831 00832 //////////////////////////////////////////////////////////////////// 00833 // Function: EggGroup::get_lod 00834 // Access: Published 00835 // Description: 00836 //////////////////////////////////////////////////////////////////// 00837 INLINE const EggSwitchCondition &EggGroup:: 00838 get_lod() const { 00839 return *_lod; 00840 } 00841 00842 //////////////////////////////////////////////////////////////////// 00843 // Function: EggGroup::set_tag 00844 // Access: Published 00845 // Description: Associates a user-defined value with a user-defined 00846 // key which is stored on the node. This value has no 00847 // meaning to Panda; but it is stored indefinitely on 00848 // the node until it is requested again. This value 00849 // will be copied to the PandaNode that is created for 00850 // this particular EggGroup if the egg file is loaded as 00851 // a scene. 00852 // 00853 // Each unique key stores a different string value. 00854 // There is no effective limit on the number of 00855 // different keys that may be stored or on the length of 00856 // any one key's value. 00857 //////////////////////////////////////////////////////////////////// 00858 INLINE void EggGroup:: 00859 set_tag(const string &key, const string &value) { 00860 _tag_data[key] = value; 00861 } 00862 00863 //////////////////////////////////////////////////////////////////// 00864 // Function: EggGroup::get_tag 00865 // Access: Published 00866 // Description: Retrieves the user-defined value that was previously 00867 // set on this node for the particular key, if any. If 00868 // no value has been previously set, returns the empty 00869 // string. 00870 //////////////////////////////////////////////////////////////////// 00871 INLINE string EggGroup:: 00872 get_tag(const string &key) const { 00873 TagData::const_iterator ti; 00874 ti = _tag_data.find(key); 00875 if (ti != _tag_data.end()) { 00876 return (*ti).second; 00877 } 00878 return string(); 00879 } 00880 00881 //////////////////////////////////////////////////////////////////// 00882 // Function: EggGroup::has_tag 00883 // Access: Published 00884 // Description: Returns true if a value has been defined on this node 00885 // for the particular key (even if that value is the 00886 // empty string), or false if no value has been set. 00887 //////////////////////////////////////////////////////////////////// 00888 INLINE bool EggGroup:: 00889 has_tag(const string &key) const { 00890 TagData::const_iterator ti; 00891 ti = _tag_data.find(key); 00892 return (ti != _tag_data.end()); 00893 } 00894 00895 //////////////////////////////////////////////////////////////////// 00896 // Function: EggGroup::clear_tag 00897 // Access: Published 00898 // Description: Removes the value defined for this key on this 00899 // particular node. After a call to clear_tag(), 00900 // has_tag() will return false for the indicated key. 00901 //////////////////////////////////////////////////////////////////// 00902 INLINE void EggGroup:: 00903 clear_tag(const string &key) { 00904 _tag_data.erase(key); 00905 } 00906 00907 //////////////////////////////////////////////////////////////////// 00908 // Function: EggGroup::get_default_pose 00909 // Access: Published 00910 // Description: Returns a read-only accessor to the initial pose 00911 // transform. This is the <DefaultPose> entry for a 00912 // Joint, and defines only the initial transform pose 00913 // for the unanimated joint; it has nothing to do with 00914 // the group's <Transform> entry, which defines the 00915 // (eventual) space of the group's vertices. 00916 //////////////////////////////////////////////////////////////////// 00917 INLINE const EggTransform &EggGroup:: 00918 get_default_pose() const { 00919 return _default_pose; 00920 } 00921 00922 //////////////////////////////////////////////////////////////////// 00923 // Function: EggGroup::modify_default_pose 00924 // Access: Published 00925 // Description: Returns a writable accessor to the initial pose 00926 // transform. This is the <DefaultPose> entry for a 00927 // Joint, and defines only the initial transform pose 00928 // for the unanimated joint; it has nothing to do with 00929 // the group's <Transform> entry, which defines the 00930 // (eventual) space of the group's vertices. 00931 //////////////////////////////////////////////////////////////////// 00932 INLINE EggTransform &EggGroup:: 00933 modify_default_pose() { 00934 return _default_pose; 00935 } 00936 00937 //////////////////////////////////////////////////////////////////// 00938 // Function: EggGroup::set_default_pose 00939 // Access: Published 00940 // Description: Replaces the initial pose transform. This is the 00941 // <DefaultPose> entry for a Joint, and defines only the 00942 // initial transform pose for the unanimated joint; it 00943 // has nothing to do with the group's <Transform> entry, 00944 // which defines the (eventual) space of the group's 00945 // vertices. 00946 //////////////////////////////////////////////////////////////////// 00947 INLINE void EggGroup:: 00948 set_default_pose(const EggTransform &transform) { 00949 _default_pose = transform; 00950 } 00951 00952 //////////////////////////////////////////////////////////////////// 00953 // Function: EggGroup::clear_default_pose 00954 // Access: Published 00955 // Description: Removes the initial pose transform. See 00956 // set_default_pose(). 00957 //////////////////////////////////////////////////////////////////// 00958 INLINE void EggGroup:: 00959 clear_default_pose() { 00960 _default_pose.clear_transform(); 00961 } 00962 00963 //////////////////////////////////////////////////////////////////// 00964 // Function: EggGroup::tag_begin 00965 // Access: Public 00966 // Description: Returns an iterator that can, in conjunction with 00967 // tag_end(), be used to traverse the entire set of 00968 // tag keys. Each iterator returns a pair<string, 00969 // string>. 00970 // 00971 // This interface is not safe to use outside of 00972 // PANDAEGG.DLL. 00973 //////////////////////////////////////////////////////////////////// 00974 INLINE EggGroup::TagData::const_iterator EggGroup:: 00975 tag_begin() const { 00976 return _tag_data.begin(); 00977 } 00978 00979 //////////////////////////////////////////////////////////////////// 00980 // Function: EggGroup::tag_end 00981 // Access: Public 00982 // Description: Returns an iterator that can, in conjunction with 00983 // tag_begin(), be used to traverse the entire set of 00984 // tag keys. Each iterator returns a pair<string, 00985 // string>. 00986 // 00987 // This interface is not safe to use outside of 00988 // PANDAEGG.DLL. 00989 //////////////////////////////////////////////////////////////////// 00990 INLINE EggGroup::TagData::const_iterator EggGroup:: 00991 tag_end() const { 00992 return _tag_data.end(); 00993 } 00994 00995 //////////////////////////////////////////////////////////////////// 00996 // Function: EggGroup::tag_size 00997 // Access: Published 00998 // Description: Returns the number of elements between tag_begin() 00999 // and tag_end(). 01000 // 01001 // This interface is not safe to use outside of 01002 // PANDAEGG.DLL. 01003 //////////////////////////////////////////////////////////////////// 01004 INLINE EggGroup::TagData::size_type EggGroup:: 01005 tag_size() const { 01006 return _tag_data.size(); 01007 } 01008 01009 //////////////////////////////////////////////////////////////////// 01010 // Function: EggGroup::vref_begin 01011 // Access: Public 01012 // Description: Returns an iterator that can, in conjunction with 01013 // vref_end(), be used to traverse the entire set of 01014 // referenced vertices. Each iterator returns a 01015 // pair<PT(EggVertex), double>. 01016 // 01017 // This interface is not safe to use outside of 01018 // PANDAEGG.DLL. 01019 //////////////////////////////////////////////////////////////////// 01020 INLINE EggGroup::VertexRef::const_iterator EggGroup:: 01021 vref_begin() const { 01022 return _vref.begin(); 01023 } 01024 01025 //////////////////////////////////////////////////////////////////// 01026 // Function: EggGroup::vref_end 01027 // Access: Public 01028 // Description: Returns an iterator that can, in conjunction with 01029 // vref_begin(), be used to traverse the entire set of 01030 // referenced vertices. Each iterator returns a 01031 // pair<PT(EggVertex), double>. 01032 // 01033 // This interface is not safe to use outside of 01034 // PANDAEGG.DLL. 01035 //////////////////////////////////////////////////////////////////// 01036 INLINE EggGroup::VertexRef::const_iterator EggGroup:: 01037 vref_end() const { 01038 return _vref.end(); 01039 } 01040 01041 //////////////////////////////////////////////////////////////////// 01042 // Function: EggGroup::vref_size 01043 // Access: Published 01044 // Description: Returns the number of elements between vref_begin() 01045 // and vref_end(). 01046 // 01047 // This interface is not safe to use outside of 01048 // PANDAEGG.DLL. 01049 //////////////////////////////////////////////////////////////////// 01050 INLINE EggGroup::VertexRef::size_type EggGroup:: 01051 vref_size() const { 01052 return _vref.size(); 01053 } 01054 01055 INLINE void EggGroup:: 01056 set_scroll_u(const double u_speed) { 01057 _u_speed = u_speed; 01058 } 01059 01060 INLINE void EggGroup:: 01061 set_scroll_v(const double v_speed) { 01062 _v_speed = v_speed; 01063 } 01064 01065 INLINE void EggGroup:: 01066 set_scroll_r(const double r_speed) { 01067 _r_speed = r_speed; 01068 } 01069 01070 INLINE double EggGroup:: 01071 get_scroll_u() const { 01072 return _u_speed; 01073 } 01074 01075 INLINE double EggGroup:: 01076 get_scroll_v() const { 01077 return _v_speed; 01078 } 01079 01080 INLINE double EggGroup:: 01081 get_scroll_r() const { 01082 return _r_speed; 01083 } 01084 01085 01086 INLINE bool EggGroup:: 01087 has_scrolling_uvs() { 01088 return (_u_speed != 0) || (_v_speed != 0) || (_r_speed != 0); 01089 }