Panda3D
animChannel.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 animChannel.cxx
10  * @author drose
11  * @date 2000-05-11
12  */
13 
14 #include "animChannel.h"
15 
16 #include "compose_matrix.h"
17 
18 template class AnimChannel<ACMatrixSwitchType>;
19 template class AnimChannel<ACScalarSwitchType>;
20 
21 /**
22  * Outputs a very brief description of a matrix.
23  */
25 output_value(std::ostream &out, const ACMatrixSwitchType::ValueType &value) {
26  LVecBase3 scale, shear, hpr, translate;
27  if (decompose_matrix(value, scale, shear, hpr, translate)) {
28  if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
29  if (IS_NEARLY_EQUAL(scale[0], scale[1]) &&
30  IS_NEARLY_EQUAL(scale[1], scale[2])) {
31  out << " scale " << scale[0];
32  } else {
33  out << " scale " << scale;
34  }
35  }
36  if (!shear.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
37  out << " shear " << shear;
38  }
39 
40  if (!hpr.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
41  out << " hpr " << hpr;
42  }
43 
44  if (!translate.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
45  out << " trans " << translate;
46  }
47 
48  } else {
49  out << " mat " << value;
50  }
51 }
static void output_value(std::ostream &out, const ValueType &value)
Outputs a very brief description of a matrix.
Definition: animChannel.cxx:25
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.