Panda3D
animChannelBase.cxx
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 animChannelBase.cxx
10  * @author drose
11  * @date 1999-02-19
12  */
13 
14 #include "animChannelBase.h"
15 #include "datagram.h"
16 #include "datagramIterator.h"
17 #include "bamReader.h"
18 #include "bamWriter.h"
19 
20 TypeHandle AnimChannelBase::_type_handle;
21 
22 
23 /**
24  * Returns true if the value has changed since the last call to has_changed().
25  * last_frame is the frame number of the last call; this_frame is the current
26  * frame number. last_frac and this_frac are the fractional steps into those
27  * frames, which will be 0.0 unless we are running in frame_blend mode.
28  */
30 has_changed(int, double, int, double) {
31  return true;
32 }
33 
34 /**
35  * Function to write the important information in the particular object to a
36  * Datagram
37  */
40  AnimGroup::write_datagram(manager, me);
41  me.add_uint16(_last_frame);
42 }
43 
44 /**
45  * Function that reads out of the datagram (or asks manager to read) all of
46  * the data that is needed to re-create this object and stores it in the
47  * appropiate place
48  */
49 void AnimChannelBase::
50 fillin(DatagramIterator &scan, BamReader *manager) {
51  AnimGroup::fillin(scan, manager);
52  _last_frame = scan.get_uint16();
53 }
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:63
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().
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
Definition: datagram.I:85
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
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:81
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.