Panda3D
animChannelMatrixFixed.h
1 // Filename: animChannelMatrixFixed.h
2 // Created by: drose (19Jan06)
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 ANIMCHANNELMATRIXFIXED_H
16 #define ANIMCHANNELMATRIXFIXED_H
17 
18 #include "pandabase.h"
19 
20 #include "animChannel.h"
21 #include "luse.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : AnimChannelMatrixFixed
25 // Description : A specialization on AnimChannel to add all the
26 // special matrix component operations.
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_PANDA_CHAN AnimChannelMatrixFixed : public AnimChannel<ACMatrixSwitchType> {
29 protected:
31 
32 public:
33  AnimChannelMatrixFixed(const string &name, const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale);
34 
35  virtual bool has_changed(int last_frame, double last_frac,
36  int this_frame, double this_frac);
37  virtual void get_value(int frame, LMatrix4 &value);
38  virtual void get_value_no_scale_shear(int frame, LMatrix4 &value);
39  virtual void get_scale(int frame, LVecBase3 &scale);
40  virtual void get_hpr(int frame, LVecBase3 &hpr);
41  virtual void get_quat(int frame, LQuaternion &quat);
42  virtual void get_pos(int frame, LVecBase3 &pos);
43  virtual void get_shear(int frame, LVecBase3 &shear);
44 
45  virtual void output(ostream &out) const;
46 
47 private:
48  LVecBase3 _pos, _hpr, _scale;
49 
50 public:
51  static void register_with_read_factory();
52  virtual void write_datagram(BamWriter *manager, Datagram &dg);
53 
54 protected:
55  static TypedWritable *make_from_bam(const FactoryParams &params);
56  void fillin(DatagramIterator &scan, BamReader *manager);
57 
58 public:
59  virtual TypeHandle get_type() const {
60  return get_class_type();
61  }
62  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
63  static TypeHandle get_class_type() {
64  return _type_handle;
65  }
66  static void init_type() {
68  register_type(_type_handle, "AnimChannelMatrixFixed",
70  }
71 
72 private:
73  static TypeHandle _type_handle;
74 };
75 
76 #include "animChannelMatrixFixed.I"
77 
78 #endif
79 
80 
81 
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
virtual void output(ostream &out) const
Writes a one-line description of the group.
Definition: animGroup.cxx:214
virtual void get_pos(int frame, LVecBase3 &pos)
Returns the x, y, and z translation components associated with the current frame. ...
Definition: animChannel.I:158
virtual void get_quat(int frame, LQuaternion &quat)
Returns the rotation component associated with the current frame, expressed as a quaternion.
Definition: animChannel.I:145
virtual void get_scale(int frame, LVecBase3 &scale)
Returns the x, y, and z scale components associated with the current frame.
Definition: animChannel.I:119
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
static void register_with_read_factory()
Factory method to generate a AnimGroup object.
Definition: animGroup.cxx:362
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
virtual void get_hpr(int frame, LVecBase3 &hpr)
Returns the h, p, and r components associated with the current frame.
Definition: animChannel.I:132
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
This template class is the parent class for all kinds of AnimChannels that return different values...
Definition: animChannel.h:30
virtual bool has_changed(int last_frame, double last_frac, int this_frame, double this_frac)
Returns true if the value has changed since the last call to has_changed().
This is the base class for AnimChannel and AnimBundle.
Definition: animGroup.h:36
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
virtual void get_value_no_scale_shear(int frame, ValueType &value)
Returns the value associated with the current frame, with no scale or share components.
Definition: animChannel.I:106
A specialization on AnimChannel to add all the special matrix component operations.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
This is the base quaternion class.
Definition: lquaternion.h:96
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
virtual void get_shear(int frame, LVecBase3 &shear)
Returns the a, b, and c shear components associated with the current frame.
Definition: animChannel.I:171