Panda3D
 All Classes Functions Variables Enumerations
fltTransformRotateAboutEdge.h
1 // Filename: fltTransformRotateAboutEdge.h
2 // Created by: drose (30Aug00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef FLTTRANSFORMROTATEABOUTEDGE_H
16 #define FLTTRANSFORMROTATEABOUTEDGE_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltTransformRecord.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : FltTransformRotateAboutEdge
24 // Description : A transformation that rotates about a particular axis
25 // in space, defined by two endpoints.
26 ////////////////////////////////////////////////////////////////////
28 public:
30 
31  void set(const LPoint3d &point_a, const LPoint3d &point_b, PN_stdfloat angle);
32 
33  const LPoint3d &get_point_a() const;
34  const LPoint3d &get_point_b() const;
35  PN_stdfloat get_angle() const;
36 
37 private:
38  void recompute_matrix();
39 
40  LPoint3d _point_a;
41  LPoint3d _point_b;
42  PN_stdfloat _angle;
43 
44 protected:
45  virtual bool extract_record(FltRecordReader &reader);
46  virtual bool build_record(FltRecordWriter &writer) const;
47 
48 public:
49  virtual TypeHandle get_type() const {
50  return get_class_type();
51  }
52  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  FltTransformRecord::init_type();
58  register_type(_type_handle, "FltTransformRotateAboutEdge",
59  FltTransformRecord::get_class_type());
60  }
61 
62 private:
63  static TypeHandle _type_handle;
64 };
65 
66 #endif
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
PN_stdfloat get_angle() const
Returns the angle of rotation, in degrees counterclockwise about the axis as seen from point a...
void set(const LPoint3d &point_a, const LPoint3d &point_b, PN_stdfloat angle)
Defines the rotation.
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:48
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:531
A base class for a number of types of ancillary records that follow beads and indicate some kind of a...
A transformation that rotates about a particular axis in space, defined by two endpoints.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85