00001 // Filename: eggJointData.h 00002 // Created by: drose (23Feb01) 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 #ifndef EGGJOINTDATA_H 00020 #define EGGJOINTDATA_H 00021 00022 #include "pandatoolbase.h" 00023 00024 #include "eggComponentData.h" 00025 00026 #include "luse.h" 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Class : EggJointData 00030 // Description : This is one node of a hierarchy of EggJointData 00031 // nodes, each of which represents a single joint of the 00032 // character hierarchy across all loaded files: the 00033 // various models, the LOD's of each model, and the 00034 // various animation channel files. 00035 //////////////////////////////////////////////////////////////////// 00036 class EggJointData : public EggComponentData { 00037 public: 00038 EggJointData(EggCharacterCollection *collection, 00039 EggCharacterData *char_data); 00040 00041 INLINE int get_num_children() const; 00042 INLINE EggJointData *get_child(int n) const; 00043 EggJointData *find_joint(const string &name); 00044 00045 int get_num_frames(int model_index) const; 00046 LMatrix4d get_frame(int model_index, int n) const; 00047 LMatrix4d get_net_frame(int model_index, int n) const; 00048 00049 bool do_rebuild(); 00050 void optimize(); 00051 00052 virtual void add_back_pointer(int model_index, EggObject *egg_object); 00053 virtual void write(ostream &out, int indent_level = 0) const; 00054 00055 protected: 00056 typedef pvector<EggJointData *> Children; 00057 Children _children; 00058 EggJointData *_parent; 00059 00060 friend class EggCharacterCollection; 00061 }; 00062 00063 #include "eggJointData.I" 00064 00065 #endif