Panda3D
|
00001 // Filename: fltTransformScale.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 FLTTRANSFORMSCALE_H 00016 #define FLTTRANSFORMSCALE_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "fltTransformRecord.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : FltTransformScale 00024 // Description : A transformation that applies a (possibly nonuniform) 00025 // scale. 00026 //////////////////////////////////////////////////////////////////// 00027 class FltTransformScale : public FltTransformRecord { 00028 public: 00029 FltTransformScale(FltHeader *header); 00030 00031 void set(const LPoint3d ¢er, const LVecBase3 &scale); 00032 00033 bool has_center() const; 00034 const LPoint3d &get_center() const; 00035 const LVecBase3 &get_scale() const; 00036 00037 private: 00038 void recompute_matrix(); 00039 00040 LPoint3d _center; 00041 LVecBase3 _scale; 00042 00043 protected: 00044 virtual bool extract_record(FltRecordReader &reader); 00045 virtual bool build_record(FltRecordWriter &writer) const; 00046 00047 public: 00048 virtual TypeHandle get_type() const { 00049 return get_class_type(); 00050 } 00051 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00052 static TypeHandle get_class_type() { 00053 return _type_handle; 00054 } 00055 static void init_type() { 00056 FltTransformRecord::init_type(); 00057 register_type(_type_handle, "FltTransformScale", 00058 FltTransformRecord::get_class_type()); 00059 } 00060 00061 private: 00062 static TypeHandle _type_handle; 00063 }; 00064 00065 #endif