Panda3D
|
00001 // Filename: fltTransformPut.h 00002 // Created by: drose (29Aug00) 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 FLTTRANSFORMPUT_H 00016 #define FLTTRANSFORMPUT_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "fltTransformRecord.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : FltTransformPut 00024 // Description : A "put", which is a MultiGen concept of defining a 00025 // transformation by mapping three arbitrary points to 00026 // three new arbitrary points. 00027 //////////////////////////////////////////////////////////////////// 00028 class FltTransformPut : public FltTransformRecord { 00029 public: 00030 FltTransformPut(FltHeader *header); 00031 00032 void set(const LPoint3d &from_origin, 00033 const LPoint3d &from_align, 00034 const LPoint3d &from_track, 00035 const LPoint3d &to_origin, 00036 const LPoint3d &to_align, 00037 const LPoint3d &to_track); 00038 00039 const LPoint3d &get_from_origin() const; 00040 const LPoint3d &get_from_align() const; 00041 const LPoint3d &get_from_track() const; 00042 const LPoint3d &get_to_origin() const; 00043 const LPoint3d &get_to_align() const; 00044 const LPoint3d &get_to_track() const; 00045 00046 private: 00047 void recompute_matrix(); 00048 00049 LPoint3d _from_origin; 00050 LPoint3d _from_align; 00051 LPoint3d _from_track; 00052 LPoint3d _to_origin; 00053 LPoint3d _to_align; 00054 LPoint3d _to_track; 00055 00056 protected: 00057 virtual bool extract_record(FltRecordReader &reader); 00058 virtual bool build_record(FltRecordWriter &writer) const; 00059 00060 public: 00061 virtual TypeHandle get_type() const { 00062 return get_class_type(); 00063 } 00064 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00065 static TypeHandle get_class_type() { 00066 return _type_handle; 00067 } 00068 static void init_type() { 00069 FltTransformRecord::init_type(); 00070 register_type(_type_handle, "FltTransformPut", 00071 FltTransformRecord::get_class_type()); 00072 } 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 #endif 00079 00080