Panda3D
|
00001 // Filename: eggAnimData.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 #include "eggAnimData.h" 00016 00017 TypeHandle EggAnimData::_type_handle; 00018 00019 //////////////////////////////////////////////////////////////////// 00020 // Function: EggAnimData::quantize 00021 // Access: Public 00022 // Description: Rounds each element of the table to the nearest 00023 // multiple of quantum. 00024 //////////////////////////////////////////////////////////////////// 00025 void EggAnimData:: 00026 quantize(double quantum) { 00027 for (size_t i = 0; i < _data.size(); i++) { 00028 _data[i] = floor(_data[i] / quantum + 0.5) * quantum; 00029 } 00030 }