Panda3D
 All Classes Functions Variables Enumerations
eggAnimData.cxx
1 // Filename: eggAnimData.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 #include "eggAnimData.h"
16 
17 TypeHandle EggAnimData::_type_handle;
18 
19 ////////////////////////////////////////////////////////////////////
20 // Function: EggAnimData::quantize
21 // Access: Public
22 // Description: Rounds each element of the table to the nearest
23 // multiple of quantum.
24 ////////////////////////////////////////////////////////////////////
25 void EggAnimData::
26 quantize(double quantum) {
27  for (size_t i = 0; i < _data.size(); i++) {
28  _data[i] = floor(_data[i] / quantum + 0.5) * quantum;
29  }
30 }
void quantize(double quantum)
Rounds each element of the table to the nearest multiple of quantum.
Definition: eggAnimData.cxx:26
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85