Panda3D
 All Classes Functions Variables Enumerations
eggJointPointer.h
00001 // Filename: eggJointPointer.h
00002 // Created by:  drose (26Feb01)
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 #ifndef EGGJOINTPOINTER_H
00016 #define EGGJOINTPOINTER_H
00017 
00018 #include "pandatoolbase.h"
00019 #include "eggBackPointer.h"
00020 #include "eggGroup.h"
00021 #include "luse.h"
00022 
00023 class EggCharacterDb;
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : EggJointPointer
00027 // Description : This is a base class for EggJointNodePointer and
00028 //               EggMatrixTablePointer.  It stores a back pointer to
00029 //               either a <Joint> entry or an xform <Table> data, and
00030 //               thus presents an interface that returns 1-n matrices,
00031 //               one for each frame.  (<Joint> entries, for model
00032 //               files, appear the same as one-frame animations.)
00033 ////////////////////////////////////////////////////////////////////
00034 class EggJointPointer : public EggBackPointer {
00035 public:
00036   virtual int get_num_frames() const=0;
00037   virtual LMatrix4d get_frame(int n) const=0;
00038   virtual void set_frame(int n, const LMatrix4d &mat)=0;
00039   virtual bool add_frame(const LMatrix4d &mat);
00040 
00041   virtual void do_finish_reparent(EggJointPointer *new_parent)=0;
00042   virtual void move_vertices_to(EggJointPointer *new_joint);
00043 
00044   virtual bool do_rebuild(EggCharacterDb &db);
00045 
00046   virtual void optimize();
00047   virtual void expose(EggGroup::DCSType dcs_type);
00048   virtual void zero_channels(const string &components);
00049   virtual void quantize_channels(const string &components, double quantum);
00050   virtual void apply_default_pose(EggJointPointer *source_joint, int frame);
00051 
00052   virtual EggJointPointer *make_new_joint(const string &name)=0;
00053 
00054 public:
00055   static TypeHandle get_class_type() {
00056     return _type_handle;
00057   }
00058   static void init_type() {
00059     EggBackPointer::init_type();
00060     register_type(_type_handle, "EggJointPointer",
00061                   EggBackPointer::get_class_type());
00062   }
00063   virtual TypeHandle get_type() const {
00064     return get_class_type();
00065   }
00066   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00067 
00068 private:
00069   static TypeHandle _type_handle;
00070 };
00071 
00072 #include "eggJointPointer.I"
00073 
00074 #endif
00075 
00076 
 All Classes Functions Variables Enumerations