Panda3D
animChannelBase.cxx
1 // Filename: animChannelBase.cxx
2 // Created by: drose (19Feb99)
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 
16 #include "animChannelBase.h"
17 #include "datagram.h"
18 #include "datagramIterator.h"
19 #include "bamReader.h"
20 #include "bamWriter.h"
21 
22 TypeHandle AnimChannelBase::_type_handle;
23 
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: AnimChannelBase::has_changed
27 // Access: Public, Virtual
28 // Description: Returns true if the value has changed since the last
29 // call to has_changed(). last_frame is the frame
30 // number of the last call; this_frame is the current
31 // frame number. last_frac and this_frac are the
32 // fractional steps into those frames, which will be 0.0
33 // unless we are running in frame_blend mode.
34 ////////////////////////////////////////////////////////////////////
36 has_changed(int, double, int, double) {
37  return true;
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: AnimChannelBase::write_datagram
42 // Access: Public
43 // Description: Function to write the important information in
44 // the particular object to a Datagram
45 ////////////////////////////////////////////////////////////////////
48  AnimGroup::write_datagram(manager, me);
49  me.add_uint16(_last_frame);
50 }
51 
52 ////////////////////////////////////////////////////////////////////
53 // Function: AnimChannelBase::fillin
54 // Access: Protected
55 // Description: Function that reads out of the datagram (or asks
56 // manager to read) all of the data that is needed to
57 // re-create this object and stores it in the appropiate
58 // place
59 ////////////////////////////////////////////////////////////////////
60 void AnimChannelBase::
61 fillin(DatagramIterator &scan, BamReader *manager) {
62  AnimGroup::fillin(scan, manager);
63  _last_frame = scan.get_uint16();
64 }
65 
66 
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
virtual void write_datagram(BamWriter *manager, Datagram &me)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
PN_uint16 get_uint16()
Extracts an unsigned 16-bit integer.
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.
void add_uint16(PN_uint16 value)
Adds an unsigned 16-bit integer to the datagram.
Definition: datagram.I:181
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