Panda3D
|
00001 // Filename: fltTransformRotateAboutEdge.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 FLTTRANSFORMROTATEABOUTEDGE_H 00016 #define FLTTRANSFORMROTATEABOUTEDGE_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "fltTransformRecord.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : FltTransformRotateAboutEdge 00024 // Description : A transformation that rotates about a particular axis 00025 // in space, defined by two endpoints. 00026 //////////////////////////////////////////////////////////////////// 00027 class FltTransformRotateAboutEdge : public FltTransformRecord { 00028 public: 00029 FltTransformRotateAboutEdge(FltHeader *header); 00030 00031 void set(const LPoint3d &point_a, const LPoint3d &point_b, PN_stdfloat angle); 00032 00033 const LPoint3d &get_point_a() const; 00034 const LPoint3d &get_point_b() const; 00035 PN_stdfloat get_angle() const; 00036 00037 private: 00038 void recompute_matrix(); 00039 00040 LPoint3d _point_a; 00041 LPoint3d _point_b; 00042 PN_stdfloat _angle; 00043 00044 protected: 00045 virtual bool extract_record(FltRecordReader &reader); 00046 virtual bool build_record(FltRecordWriter &writer) const; 00047 00048 public: 00049 virtual TypeHandle get_type() const { 00050 return get_class_type(); 00051 } 00052 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00053 static TypeHandle get_class_type() { 00054 return _type_handle; 00055 } 00056 static void init_type() { 00057 FltTransformRecord::init_type(); 00058 register_type(_type_handle, "FltTransformRotateAboutEdge", 00059 FltTransformRecord::get_class_type()); 00060 } 00061 00062 private: 00063 static TypeHandle _type_handle; 00064 }; 00065 00066 #endif