Panda3D
 All Classes Functions Variables Enumerations
fltTransformTranslate.h
1 // Filename: fltTransformTranslate.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 FLTTRANSFORMTRANSLATE_H
16 #define FLTTRANSFORMTRANSLATE_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltTransformRecord.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : FltTransformTranslate
24 // Description : A transformation that applies a translation.
25 ////////////////////////////////////////////////////////////////////
27 public:
29 
30  void set(const LPoint3d &from, const LVector3d &delta);
31 
32  const LPoint3d &get_from() const;
33  const LVector3d &get_delta() const;
34 
35 private:
36  void recompute_matrix();
37 
38  LPoint3d _from;
39  LVector3d _delta;
40 
41 protected:
42  virtual bool extract_record(FltRecordReader &reader);
43  virtual bool build_record(FltRecordWriter &writer) const;
44 
45 public:
46  virtual TypeHandle get_type() const {
47  return get_class_type();
48  }
49  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
50  static TypeHandle get_class_type() {
51  return _type_handle;
52  }
53  static void init_type() {
54  FltTransformRecord::init_type();
55  register_type(_type_handle, "FltTransformTranslate",
56  FltTransformRecord::get_class_type());
57  }
58 
59 private:
60  static TypeHandle _type_handle;
61 };
62 
63 #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...
A transformation that applies a translation.
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:48
const LPoint3d & get_from() const
Returns the reference point of the translation.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:746
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...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
void set(const LPoint3d &from, const LVector3d &delta)
Defines the translation.