Panda3D
fltTransformRotateAboutEdge.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file fltTransformRotateAboutEdge.h
10  * @author drose
11  * @date 2000-08-30
12  */
13 
14 #ifndef FLTTRANSFORMROTATEABOUTEDGE_H
15 #define FLTTRANSFORMROTATEABOUTEDGE_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "fltTransformRecord.h"
20 
21 /**
22  * A transformation that rotates about a particular axis in space, defined by
23  * two endpoints.
24  */
26 public:
28 
29  void set(const LPoint3d &point_a, const LPoint3d &point_b, PN_stdfloat angle);
30 
31  const LPoint3d &get_point_a() const;
32  const LPoint3d &get_point_b() const;
33  PN_stdfloat get_angle() const;
34 
35 private:
36  void recompute_matrix();
37 
38  LPoint3d _point_a;
39  LPoint3d _point_b;
40  PN_stdfloat _angle;
41 
42 protected:
43  virtual bool extract_record(FltRecordReader &reader);
44  virtual bool build_record(FltRecordWriter &writer) const;
45 
46 public:
47  virtual TypeHandle get_type() const {
48  return get_class_type();
49  }
50  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  FltTransformRecord::init_type();
56  register_type(_type_handle, "FltTransformRotateAboutEdge",
57  FltTransformRecord::get_class_type());
58  }
59 
60 private:
61  static TypeHandle _type_handle;
62 };
63 
64 #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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set(const LPoint3d &point_a, const LPoint3d &point_b, PN_stdfloat angle)
Defines the rotation.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PN_stdfloat get_angle() const
Returns the angle of rotation, in degrees counterclockwise about the axis as seen from point a.
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:44
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:81