Panda3D
 All Classes Functions Variables Enumerations
config_mathutil.cxx
1 // Filename: config_mathutil.cxx
2 // Created by: drose (01Oct99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_mathutil.h"
16 #include "boundingVolume.h"
17 #include "geometricBoundingVolume.h"
18 #include "finiteBoundingVolume.h"
19 #include "omniBoundingVolume.h"
20 #include "boundingSphere.h"
21 #include "boundingBox.h"
22 #include "boundingHexahedron.h"
23 #include "boundingLine.h"
24 #include "boundingPlane.h"
25 #include "unionBoundingVolume.h"
26 #include "intersectionBoundingVolume.h"
27 #include "dconfig.h"
28 #include "pandaSystem.h"
29 
30 Configure(config_mathutil);
31 NotifyCategoryDef(mathutil, "");
32 
33 ConfigureFn(config_mathutil) {
34  init_libmathutil();
35 }
36 
37 ConfigVariableDouble fft_offset
38 ("fft-offset", 0.001);
39 
40 ConfigVariableDouble fft_factor
41 ("fft-factor", 0.1);
42 
43 ConfigVariableDouble fft_exponent
44 ("fft-exponent", 4);
45 
46 ConfigVariableDouble fft_error_threshold
47 ("fft-error-threshold", 0.2);
48 
50 ("bounds-type", BoundingVolume::BT_sphere,
51  PRC_DESC("Specify the type of bounding volume that is created automatically "
52  "by Panda to enclose geometry. Use 'sphere' or 'box', or use "
53  "'best' to let Panda decide which is most appropriate. You can "
54  "also use 'fastest' if you don't want Panda to waste much time "
55  "computing the most optimal bounding volume."));
56 
57 ////////////////////////////////////////////////////////////////////
58 // Function: init_libmathutil
59 // Description: Initializes the library. This must be called at
60 // least once before any of the functions or classes in
61 // this library can be used. Normally it will be
62 // called by the static initializers and need not be
63 // called explicitly, but special cases exist.
64 ////////////////////////////////////////////////////////////////////
65 void
66 init_libmathutil() {
67  static bool initialized = false;
68  if (initialized) {
69  return;
70  }
71  initialized = true;
72 
73  BoundingHexahedron::init_type();
74  BoundingSphere::init_type();
75  BoundingBox::init_type();
76  BoundingVolume::init_type();
77  FiniteBoundingVolume::init_type();
78  GeometricBoundingVolume::init_type();
79  OmniBoundingVolume::init_type();
80  UnionBoundingVolume::init_type();
81  IntersectionBoundingVolume::init_type();
82  BoundingLine::init_type();
83  BoundingPlane::init_type();
84 
85 #ifdef HAVE_FFTW
87  ps->add_system("fftw");
88 #endif // FFTW
89 }
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
This class is used as a namespace to group several global properties of Panda.
Definition: pandaSystem.h:29
void add_system(const string &system)
Intended for use by each subsystem to register itself at startup.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This class specializes ConfigVariable as an enumerated type.