Panda3D
 All Classes Functions Variables Enumerations
fltTransformTranslate.h
00001 // Filename: fltTransformTranslate.h
00002 // Created by:  drose (30Aug00)
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 FLTTRANSFORMTRANSLATE_H
00016 #define FLTTRANSFORMTRANSLATE_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "fltTransformRecord.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : FltTransformTranslate
00024 // Description : A transformation that applies a translation.
00025 ////////////////////////////////////////////////////////////////////
00026 class FltTransformTranslate : public FltTransformRecord {
00027 public:
00028   FltTransformTranslate(FltHeader *header);
00029 
00030   void set(const LPoint3d &from, const LVector3d &delta);
00031 
00032   const LPoint3d &get_from() const;
00033   const LVector3d &get_delta() const;
00034 
00035 private:
00036   void recompute_matrix();
00037 
00038   LPoint3d _from;
00039   LVector3d _delta;
00040 
00041 protected:
00042   virtual bool extract_record(FltRecordReader &reader);
00043   virtual bool build_record(FltRecordWriter &writer) const;
00044 
00045 public:
00046   virtual TypeHandle get_type() const {
00047     return get_class_type();
00048   }
00049   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00050   static TypeHandle get_class_type() {
00051     return _type_handle;
00052   }
00053   static void init_type() {
00054     FltTransformRecord::init_type();
00055     register_type(_type_handle, "FltTransformTranslate",
00056                   FltTransformRecord::get_class_type());
00057   }
00058 
00059 private:
00060   static TypeHandle _type_handle;
00061 };
00062 
00063 #endif
 All Classes Functions Variables Enumerations