Panda3D
 All Classes Functions Variables Enumerations
fltTransformRotateScale.h
00001 // Filename: fltTransformRotateScale.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 FLTTRANSFORMROTATESCALE_H
00016 #define FLTTRANSFORMROTATESCALE_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "fltTransformRecord.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : FltTransformRotateScale
00024 // Description : A combination rotation and scale.  This is sometimes
00025 //               called "Rotate To Point" within MultiGen.
00026 ////////////////////////////////////////////////////////////////////
00027 class FltTransformRotateScale : public FltTransformRecord {
00028 public:
00029   FltTransformRotateScale(FltHeader *header);
00030 
00031   void set(const LPoint3d &center, const LPoint3d &reference_point,
00032            const LPoint3d &to_point, bool axis_scale);
00033 
00034   const LPoint3d &get_center() const;
00035   const LPoint3d &get_reference_point() const;
00036   const LPoint3d &get_to_point() const;
00037   PN_stdfloat get_overall_scale() const;
00038   PN_stdfloat get_axis_scale() const;
00039   PN_stdfloat get_angle() const;
00040 
00041 private:
00042   void recompute_matrix();
00043 
00044   LPoint3d _center;
00045   LPoint3d _reference_point;
00046   LPoint3d _to_point;
00047   PN_stdfloat _overall_scale;
00048   PN_stdfloat _axis_scale;
00049   PN_stdfloat _angle;
00050 
00051 protected:
00052   virtual bool extract_record(FltRecordReader &reader);
00053   virtual bool build_record(FltRecordWriter &writer) const;
00054 
00055 public:
00056   virtual TypeHandle get_type() const {
00057     return get_class_type();
00058   }
00059   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00060   static TypeHandle get_class_type() {
00061     return _type_handle;
00062   }
00063   static void init_type() {
00064     FltTransformRecord::init_type();
00065     register_type(_type_handle, "FltTransformRotateScale",
00066                   FltTransformRecord::get_class_type());
00067   }
00068 
00069 private:
00070   static TypeHandle _type_handle;
00071 };
00072 
00073 #endif
00074 
00075 
 All Classes Functions Variables Enumerations