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