Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/chan/animChannel.cxx

Go to the documentation of this file.
00001 // Filename: animChannel.cxx
00002 // Created by:  drose (11May00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 
00020 #include "animChannel.h"
00021 
00022 #include <compose_matrix.h>
00023 
00024 // Tell GCC that we'll take care of the instantiation explicitly here.
00025 #ifdef __GNUC__
00026 #pragma implementation
00027 #endif
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //     Function: ACMatrixSwitchType::output_value
00031 //       Access: Public, Static
00032 //  Description: Outputs a very brief description of a matrix.
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 

Generated on Fri May 2 00:34:55 2003 for Panda by doxygen1.3