Panda3D
config_linmath.cxx
1 // Filename: config_linmath.cxx
2 // Created by: drose (23Feb00)
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_linmath.h"
16 #include "luse.h"
17 #include "coordinateSystem.h"
18 
19 #include "dconfig.h"
20 
21 Configure(config_linmath);
22 NotifyCategoryDef(linmath, "");
23 
24 ConfigureFn(config_linmath) {
25  init_liblinmath();
26 }
27 
28 ConfigVariableBool paranoid_hpr_quat
29 ("paranoid-hpr-quat", false,
30  PRC_DESC("Set this true to doublecheck the quaternion-hpr compose and "
31  "decompose operations against the quaternion-matrix and matrix-hpr "
32  "operations. This only has effect if NDEBUG is not defined."));
33 
34 ConfigVariableBool temp_hpr_fix
35 ("temp-hpr-fix", true,
36  PRC_DESC("Set this true to compute hpr's correctly. Historically, Panda has "
37  "applied these in the wrong order, and roll was backwards relative "
38  "to the other two. Set this false if you need compatibility with "
39  "Panda's old hpr calculations."));
40 
41 ConfigVariableBool no_singular_invert
42 ("no-singular-invert", false,
43  PRC_DESC("Set this true to make singular-invert warning messages generate an "
44  "assertion failure instead of just a warning (which can then be "
45  "trapped with assert-abort)."));
46 
47 ////////////////////////////////////////////////////////////////////
48 // Function: init_liblinmath
49 // Description: Initializes the library. This must be called at
50 // least once before any of the functions or classes in
51 // this library can be used. Normally it will be
52 // called by the static initializers and need not be
53 // called explicitly, but special cases exist.
54 ////////////////////////////////////////////////////////////////////
55 void
56 init_liblinmath() {
57  static bool initialized = false;
58  if (initialized) {
59  return;
60  }
61  initialized = true;
62 
63  LVecBase2f::init_type();
64  LVecBase3f::init_type();
65  LVecBase4f::init_type();
66  LVector2f::init_type();
67  LVector3f::init_type();
68  LVector4f::init_type();
69  LPoint2f::init_type();
70  LPoint3f::init_type();
71  LPoint4f::init_type();
72  LMatrix3f::init_type();
73  LMatrix4f::init_type();
74  UnalignedLVecBase4f::init_type();
75  UnalignedLMatrix4f::init_type();
76 
77  LVecBase2d::init_type();
78  LVecBase3d::init_type();
79  LVecBase4d::init_type();
80  LVector2d::init_type();
81  LVector3d::init_type();
82  LVector4d::init_type();
83  LPoint2d::init_type();
84  LPoint3d::init_type();
85  LPoint4d::init_type();
86  LMatrix3d::init_type();
87  LMatrix4d::init_type();
88  UnalignedLVecBase4d::init_type();
89  UnalignedLMatrix4d::init_type();
90 
91  LVecBase2i::init_type();
92  LVecBase3i::init_type();
93  LVecBase4i::init_type();
94  LVector2i::init_type();
95  LVector3i::init_type();
96  LVector4i::init_type();
97  LPoint2i::init_type();
98  LPoint3i::init_type();
99  LPoint4i::init_type();
100  UnalignedLVecBase4i::init_type();
101 
102  LQuaternionf::init_type();
103  LRotationf::init_type();
104  LOrientationf::init_type();
105 
106  LQuaterniond::init_type();
107  LRotationd::init_type();
108  LOrientationd::init_type();
109 }
This is a convenience class to specialize ConfigVariable as a boolean type.