00001 // Filename: animChannelBase.cxx 00002 // Created by: drose (19Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 #include "animChannelBase.h" 00017 #include "datagram.h" 00018 #include "datagramIterator.h" 00019 #include "bamReader.h" 00020 #include "bamWriter.h" 00021 00022 TypeHandle AnimChannelBase::_type_handle; 00023 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Function: AnimChannelBase::has_changed 00027 // Access: Public, Virtual 00028 // Description: Returns true if the value has changed since the last 00029 // call to has_changed(). last_frame is the frame 00030 // number of the last call; this_frame is the current 00031 // frame number. last_frac and this_frac are the 00032 // fractional steps into those frames, which will be 0.0 00033 // unless we are running in frame_blend mode. 00034 //////////////////////////////////////////////////////////////////// 00035 bool AnimChannelBase:: 00036 has_changed(int, double, int, double) { 00037 return true; 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function: AnimChannelBase::write_datagram 00042 // Access: Public 00043 // Description: Function to write the important information in 00044 // the particular object to a Datagram 00045 //////////////////////////////////////////////////////////////////// 00046 void AnimChannelBase:: 00047 write_datagram(BamWriter *manager, Datagram &me) { 00048 AnimGroup::write_datagram(manager, me); 00049 me.add_uint16(_last_frame); 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: AnimChannelBase::fillin 00054 // Access: Protected 00055 // Description: Function that reads out of the datagram (or asks 00056 // manager to read) all of the data that is needed to 00057 // re-create this object and stores it in the appropiate 00058 // place 00059 //////////////////////////////////////////////////////////////////// 00060 void AnimChannelBase:: 00061 fillin(DatagramIterator &scan, BamReader *manager) { 00062 AnimGroup::fillin(scan, manager); 00063 _last_frame = scan.get_uint16(); 00064 } 00065 00066