00001 // Filename: character.I 00002 // Created by: drose (06Mar02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "characterJointBundle.h" 00020 00021 //////////////////////////////////////////////////////////////////// 00022 // Function: Character::get_bundle 00023 // Access: Published 00024 // Description: 00025 //////////////////////////////////////////////////////////////////// 00026 INLINE CharacterJointBundle *Character:: 00027 get_bundle() const { 00028 return DCAST(CharacterJointBundle, PartBundleNode::get_bundle()); 00029 } 00030 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: Character::get_computed_vertices 00034 // Access: Published 00035 // Description: 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE ComputedVertices *Character:: 00038 get_computed_vertices() const { 00039 return _computed_vertices; 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: Character::get_num_parts 00044 // Access: Published 00045 // Description: Returns the total number of moving parts (e.g. joints 00046 // and sliders) associated with the Character. 00047 //////////////////////////////////////////////////////////////////// 00048 INLINE int Character:: 00049 get_num_parts() const { 00050 return _parts.size(); 00051 } 00052 00053 //////////////////////////////////////////////////////////////////// 00054 // Function: Character::get_part 00055 // Access: Published 00056 // Description: Returns the nth moving part associated with the 00057 // Character. 00058 //////////////////////////////////////////////////////////////////// 00059 INLINE PartGroup *Character:: 00060 get_part(int n) const { 00061 nassertr(n >= 0 && n < (int)_parts.size(), NULL); 00062 return _parts[n]; 00063 } 00064 00065 //////////////////////////////////////////////////////////////////// 00066 // Function: Character::write_parts 00067 // Access: Published 00068 // Description: Writes a list of the Character's joints and sliders, 00069 // in their hierchical structure, to the indicated 00070 // output stream. 00071 //////////////////////////////////////////////////////////////////// 00072 INLINE void Character:: 00073 write_parts(ostream &out) const { 00074 get_bundle()->write(out, 0); 00075 } 00076 00077 //////////////////////////////////////////////////////////////////// 00078 // Function: Character::write_part_values 00079 // Access: Published 00080 // Description: Writes a list of the Character's joints and sliders, 00081 // along with each current position, in their hierchical 00082 // structure, to the indicated output stream. 00083 //////////////////////////////////////////////////////////////////// 00084 INLINE void Character:: 00085 write_part_values(ostream &out) const { 00086 get_bundle()->write_with_value(out, 0); 00087 }