Panda3D
animChannelMatrixFixed.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 animChannelMatrixFixed.h
10 * @author drose
11 * @date 2006-01-19
12 */
13
14#ifndef ANIMCHANNELMATRIXFIXED_H
15#define ANIMCHANNELMATRIXFIXED_H
16
17#include "pandabase.h"
18
19#include "animChannel.h"
20#include "luse.h"
21
22/**
23 * A specialization on AnimChannel to add all the special matrix component
24 * operations.
25 */
26class EXPCL_PANDA_CHAN AnimChannelMatrixFixed : public AnimChannel<ACMatrixSwitchType> {
27protected:
29
30public:
31 AnimChannelMatrixFixed(const std::string &name, const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale);
32
33 virtual bool has_changed(int last_frame, double last_frac,
34 int this_frame, double this_frac);
35 virtual void get_value(int frame, LMatrix4 &value);
36 virtual void get_value_no_scale_shear(int frame, LMatrix4 &value);
37 virtual void get_scale(int frame, LVecBase3 &scale);
38 virtual void get_hpr(int frame, LVecBase3 &hpr);
39 virtual void get_quat(int frame, LQuaternion &quat);
40 virtual void get_pos(int frame, LVecBase3 &pos);
41 virtual void get_shear(int frame, LVecBase3 &shear);
42
43 virtual void output(std::ostream &out) const;
44
45private:
46 LVecBase3 _pos, _hpr, _scale;
47
48public:
49 static void register_with_read_factory();
50 virtual void write_datagram(BamWriter *manager, Datagram &dg);
51
52protected:
53 static TypedWritable *make_from_bam(const FactoryParams &params);
54 void fillin(DatagramIterator &scan, BamReader *manager);
55
56public:
57 virtual TypeHandle get_type() const {
58 return get_class_type();
59 }
60 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
61 static TypeHandle get_class_type() {
62 return _type_handle;
63 }
64 static void init_type() {
66 register_type(_type_handle, "AnimChannelMatrixFixed",
68 }
69
70private:
71 static TypeHandle _type_handle;
72};
73
75
76#endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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().
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
A specialization on AnimChannel to add all the special matrix component operations.
This template class is the parent class for all kinds of AnimChannels that return different values.
Definition: animChannel.h:28
virtual void get_scale(int frame, LVecBase3 &scale)
Returns the x, y, and z scale components associated with the current frame.
Definition: animChannel.I:80
virtual void get_hpr(int frame, LVecBase3 &hpr)
Returns the h, p, and r components associated with the current frame.
Definition: animChannel.I:90
virtual void get_quat(int frame, LQuaternion &quat)
Returns the rotation component associated with the current frame, expressed as a quaternion.
Definition: animChannel.I:101
virtual void get_pos(int frame, LVecBase3 &pos)
Returns the x, y, and z translation components associated with the current frame.
Definition: animChannel.I:111
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:70
virtual void get_shear(int frame, LVecBase3 &shear)
Returns the a, b, and c shear components associated with the current frame.
Definition: animChannel.I:121
This is the base class for AnimChannel and AnimBundle.
Definition: animGroup.h:33
virtual void output(std::ostream &out) const
Writes a one-line description of the group.
Definition: animGroup.cxx:184
static void register_with_read_factory()
Factory method to generate a AnimGroup object.
Definition: animGroup.cxx:308
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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