Panda3D

config_mathutil.cxx

00001 // Filename: config_mathutil.cxx
00002 // Created by:  drose (01Oct99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "config_mathutil.h"
00016 #include "boundingVolume.h"
00017 #include "geometricBoundingVolume.h"
00018 #include "finiteBoundingVolume.h"
00019 #include "omniBoundingVolume.h"
00020 #include "boundingSphere.h"
00021 #include "boundingBox.h"
00022 #include "boundingHexahedron.h"
00023 #include "boundingLine.h"
00024 #include "boundingPlane.h"
00025 #include "unionBoundingVolume.h"
00026 #include "intersectionBoundingVolume.h"
00027 #include "linmath_events.h"
00028 #include "dconfig.h"
00029 #include "pandaSystem.h"
00030 
00031 Configure(config_mathutil);
00032 NotifyCategoryDef(mathutil, "");
00033 
00034 ConfigureFn(config_mathutil) {
00035   init_libmathutil();
00036 }
00037 
00038 ConfigVariableDouble fft_offset
00039 ("fft-offset", 0.001);
00040 
00041 ConfigVariableDouble fft_factor
00042 ("fft-factor", 0.1);
00043 
00044 ConfigVariableDouble fft_exponent
00045 ("fft-exponent", 4);
00046 
00047 ConfigVariableDouble fft_error_threshold
00048 ("fft-error-threshold", 0.2);
00049 
00050 ConfigVariableEnum<BoundingVolume::BoundsType> bounds_type
00051 ("bounds-type", BoundingVolume::BT_sphere,
00052  PRC_DESC("Specify the type of bounding volume that is created automatically "
00053           "by Panda to enclose geometry.  Use 'sphere' or 'box', or use "
00054           "'best' to let Panda decide which is most appropriate."));
00055 
00056 ////////////////////////////////////////////////////////////////////
00057 //     Function: init_libmathutil
00058 //  Description: Initializes the library.  This must be called at
00059 //               least once before any of the functions or classes in
00060 //               this library can be used.  Normally it will be
00061 //               called by the static initializers and need not be
00062 //               called explicitly, but special cases exist.
00063 ////////////////////////////////////////////////////////////////////
00064 void
00065 init_libmathutil() {
00066   static bool initialized = false;
00067   if (initialized) {
00068     return;
00069   }
00070   initialized = true;
00071 
00072   BoundingHexahedron::init_type();
00073   BoundingSphere::init_type();
00074   BoundingBox::init_type();
00075   BoundingVolume::init_type();
00076   FiniteBoundingVolume::init_type();
00077   GeometricBoundingVolume::init_type();
00078   OmniBoundingVolume::init_type();
00079   UnionBoundingVolume::init_type();
00080   IntersectionBoundingVolume::init_type();
00081   BoundingLine::init_type();
00082   BoundingPlane::init_type();
00083   EventStoreVec2::init_type("EventStoreVec2");
00084   EventStoreVec3::init_type("EventStoreVec3");
00085   EventStoreMat4::init_type("EventStoreMat4");
00086 
00087   EventStoreVec2::register_with_read_factory();
00088   EventStoreVec3::register_with_read_factory();
00089   EventStoreMat4::register_with_read_factory();
00090 
00091 #ifdef HAVE_FFTW
00092   PandaSystem *ps = PandaSystem::get_global_ptr();
00093   ps->add_system("fftw");
00094 #endif  // FFTW
00095 }
00096 
 All Classes Functions Variables Enumerations