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

panda/src/linmath/config_linmath.cxx

Go to the documentation of this file.
00001 // Filename: config_linmath.cxx
00002 // Created by:  drose (23Feb00)
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 #include "config_linmath.h"
00020 #include "luse.h"
00021 #include "coordinateSystem.h"
00022 
00023 #include <dconfig.h>
00024 
00025 Configure(config_linmath);
00026 NotifyCategoryDef(linmath, "");
00027 
00028 ConfigureFn(config_linmath) {
00029   init_liblinmath();
00030 }
00031 
00032 // Set this true to doublecheck the quaternion-hpr compose and
00033 // decompose operations against the quaternion-matrix and matrix-hpr
00034 // operations.  This only has effect if NDEBUG is not defined.
00035 const bool paranoid_hpr_quat = config_linmath.GetBool("paranoid-hpr-quat", false);
00036 
00037 // Set this true to compute hpr's correctly.  Presently, we apply
00038 // these in the wrong order, and roll is backwards relative to the
00039 // other two.  But we can't globally fix this because some of our old
00040 // tools, most notably egg-optchar, depend on the old broken behavior.
00041 // Until we are able to rewrite these tools into the new system, we
00042 // must keep the old behavior; setting this switch lets you use the
00043 // new, correct behavior but you don't get animated characters.
00044 const bool temp_hpr_fix = config_linmath.GetBool("temp-hpr-fix", false);
00045 
00046 ////////////////////////////////////////////////////////////////////
00047 //     Function: init_liblinmath
00048 //  Description: Initializes the library.  This must be called at
00049 //               least once before any of the functions or classes in
00050 //               this library can be used.  Normally it will be
00051 //               called by the static initializers and need not be
00052 //               called explicitly, but special cases exist.
00053 ////////////////////////////////////////////////////////////////////
00054 void
00055 init_liblinmath() {
00056   static bool initialized = false;
00057   if (initialized) {
00058     return;
00059   }
00060   initialized = true;
00061 
00062   LVecBase2f::init_type();
00063   LVecBase3f::init_type();
00064   LVecBase4f::init_type();
00065   LVector2f::init_type();
00066   LVector3f::init_type();
00067   LVector4f::init_type();
00068   LPoint2f::init_type();
00069   LPoint3f::init_type();
00070   LPoint4f::init_type();
00071   LMatrix3f::init_type();
00072   LMatrix4f::init_type();
00073 
00074   LVecBase2d::init_type();
00075   LVecBase3d::init_type();
00076   LVecBase4d::init_type();
00077   LVector2d::init_type();
00078   LVector3d::init_type();
00079   LVector4d::init_type();
00080   LPoint2d::init_type();
00081   LPoint3d::init_type();
00082   LPoint4d::init_type();
00083   LMatrix3d::init_type();
00084   LMatrix4d::init_type();
00085 
00086   LQuaternionf::init_type();
00087   LRotationf::init_type();
00088   LOrientationf::init_type();
00089 
00090   LQuaterniond::init_type();
00091   LRotationd::init_type();
00092   LOrientationd::init_type();
00093 
00094   string csstr = config_linmath.GetString("coordinate-system", "default");
00095   CoordinateSystem cs = parse_coordinate_system_string(csstr);
00096 
00097   if (cs == CS_invalid) {
00098     linmath_cat.error()
00099       << "Unexpected coordinate-system string: " << csstr << "\n";
00100     cs = CS_default;
00101   }
00102   default_coordinate_system = (cs == CS_default) ? CS_zup_right : cs;
00103 }

Generated on Fri May 2 00:40:03 2003 for Panda by doxygen1.3