00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "animChannel.h"
00017
00018 #include "compose_matrix.h"
00019
00020
00021 #ifdef __GNUC__
00022 #pragma implementation
00023 #endif
00024
00025
00026
00027
00028
00029
00030 void ACMatrixSwitchType::
00031 output_value(ostream &out, const ACMatrixSwitchType::ValueType &value) {
00032 LVecBase3 scale, shear, hpr, translate;
00033 if (decompose_matrix(value, scale, shear, hpr, translate)) {
00034 if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
00035 if (IS_NEARLY_EQUAL(scale[0], scale[1]) &&
00036 IS_NEARLY_EQUAL(scale[1], scale[2])) {
00037 out << " scale " << scale[0];
00038 } else {
00039 out << " scale " << scale;
00040 }
00041 }
00042 if (!shear.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
00043 out << " shear " << shear;
00044 }
00045
00046 if (!hpr.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
00047 out << " hpr " << hpr;
00048 }
00049
00050 if (!translate.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
00051 out << " trans " << translate;
00052 }
00053
00054 } else {
00055 out << " mat " << value;
00056 }
00057 }
00058