Panda3D
 All Classes Functions Variables Enumerations
config_physx.cxx
1 // Filename: config_physx.cxx
2 // Created by: enn0x (01Sep09)
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_physx.h"
16 #include "pandaSystem.h"
17 
18 #include "physxActor.h"
19 #include "physxBoxController.h"
20 #include "physxBoxForceFieldShape.h"
21 #include "physxBoxShape.h"
22 #include "physxCapsuleController.h"
23 #include "physxCapsuleForceFieldShape.h"
24 #include "physxCapsuleShape.h"
25 #include "physxCcdSkeleton.h"
26 #include "physxCloth.h"
27 #include "physxClothMesh.h"
28 #include "physxClothNode.h"
29 #include "physxContactPair.h"
30 #include "physxContactPoint.h"
31 #include "physxController.h"
32 #include "physxControllerReport.h"
33 #include "physxControllerShapeHit.h"
34 #include "physxControllersHit.h"
35 #include "physxConvexMesh.h"
36 #include "physxConvexForceFieldShape.h"
37 #include "physxConvexShape.h"
38 #include "physxCylindricalJoint.h"
39 #include "physxD6Joint.h"
40 #include "physxDebugGeomNode.h"
41 #include "physxDistanceJoint.h"
42 #include "physxFixedJoint.h"
43 #include "physxForceField.h"
44 #include "physxForceFieldShape.h"
45 #include "physxForceFieldShapeGroup.h"
46 #include "physxHeightField.h"
47 #include "physxHeightFieldShape.h"
48 #include "physxJoint.h"
49 #include "physxMaterial.h"
50 #include "physxObject.h"
51 #include "physxPlaneShape.h"
52 #include "physxPointInPlaneJoint.h"
53 #include "physxPointOnLineJoint.h"
54 #include "physxPrismaticJoint.h"
55 #include "physxPulleyJoint.h"
56 #include "physxRevoluteJoint.h"
57 #include "physxScene.h"
58 #include "physxShape.h"
59 #include "physxSoftBody.h"
60 #include "physxSoftBodyMesh.h"
61 #include "physxSoftBodyNode.h"
62 #include "physxSphereForceFieldShape.h"
63 #include "physxSphereShape.h"
64 #include "physxSphericalJoint.h"
65 #include "physxTriangleMesh.h"
66 #include "physxTriangleMeshShape.h"
67 #include "physxVehicle.h"
68 #include "physxWheel.h"
69 #include "physxWheelShape.h"
70 
71 ConfigureDef(config_physx);
72 NotifyCategoryDef(physx, "");
73 
74 ConfigureFn(config_physx) {
75  init_libphysx();
76 }
77 
78 ConfigVariableBool physx_want_vrd
79 ("physx-want-vrd", false,
80 PRC_DESC("Specified wether the manager should try to connect to the NVIDIA "
81  "PhysX visual debugger or not. Connection is established when "
82  "the first instance of PhysxManager is created."));
83 
84 ConfigVariableString physx_vrd_host
85 ("physx-vrd-host", "localhost",
86 PRC_DESC("Specified the host where the NVIDIA PhysX visual debugger is running "
87  "on. Only used if the config-varibale 'physx-want-visual-debugger' "
88  "is set to 'true'."));
89 
90 ConfigVariableInt physx_vrd_port
91 ("physx-visual-debugger-port", 5425,
92 PRC_DESC("Specified the port where the NVIDIA PhysX visual debugger is running "
93  "on. Only used if the config-varibale 'physx-want-visual-debugger' "
94  "is set to 'true'."));
95 
97 ("physx-up-axis", PhysxEnums::Z_up,
98 PRC_DESC("Set the up direction for controllers and heightfields."));
99 
100 ConfigVariableInt physx_internal_threads
101 ("physx-internal-threads", 0,
102 PRC_DESC("Specified the number of internal threads to be created by the "
103  "PhysX engine. The threads will be moved to different cores, if "
104  "possible. Default value is '0'. PhysX then runs in an external "
105  "thread, but no additional internal threads will be created."));
106 
107 ////////////////////////////////////////////////////////////////////
108 // Function: init_libphysx
109 // Description: Initializes the library. This must be called at
110 // least once before any of the functions or classes in
111 // this library can be used. Normally it will be
112 // called by the static initializers and need not be
113 // called explicitly, but special cases exist.
114 ////////////////////////////////////////////////////////////////////
115 void
116 init_libphysx() {
117  static bool initialized = false;
118  if (initialized) {
119  return;
120  }
121  initialized = true;
122 
123  PhysxActor::init_type();
124  PhysxBoxController::init_type();
125  PhysxBoxForceFieldShape::init_type();
126  PhysxBoxShape::init_type();
127  PhysxCapsuleController::init_type();
128  PhysxCapsuleForceFieldShape::init_type();
129  PhysxCapsuleShape::init_type();
130  PhysxCcdSkeleton::init_type();
131  PhysxCloth::init_type();
132  PhysxClothMesh::init_type();
133  PhysxClothNode::init_type();
134  PhysxContactPair::init_type();
135  PhysxContactPoint::init_type();
136  PhysxController::init_type();
137  PhysxControllerShapeHit::init_type();
138  PhysxControllersHit::init_type();
139  PhysxConvexMesh::init_type();
140  PhysxConvexForceFieldShape::init_type();
141  PhysxConvexShape::init_type();
142  PhysxCylindricalJoint::init_type();
143  PhysxD6Joint::init_type();
144  PhysxDebugGeomNode::init_type();
145  PhysxDistanceJoint::init_type();
146  PhysxFixedJoint::init_type();
147  PhysxForceField::init_type();
148  PhysxForceFieldShape::init_type();
149  PhysxForceFieldShapeGroup::init_type();
150  PhysxHeightField::init_type();
151  PhysxHeightFieldShape::init_type();
152  PhysxJoint::init_type();
153  PhysxMaterial::init_type();
154  PhysxObject::init_type();
155  PhysxPlaneShape::init_type();
156  PhysxPointInPlaneJoint::init_type();
157  PhysxPointOnLineJoint::init_type();
158  PhysxPrismaticJoint::init_type();
159  PhysxPulleyJoint::init_type();
160  PhysxRevoluteJoint::init_type();
161  PhysxScene::init_type();
162  PhysxShape::init_type();
163  PhysxSoftBody::init_type();
164  PhysxSoftBodyMesh::init_type();
165  PhysxSoftBodyNode::init_type();
166  PhysxSphereForceFieldShape::init_type();
167  PhysxSphereShape::init_type();
168  PhysxSphericalJoint::init_type();
169  PhysxTriangleMesh::init_type();
170  PhysxTriangleMeshShape::init_type();
171  PhysxVehicle::init_type();
172  PhysxWheel::init_type();
173  PhysxWheelShape::init_type();
174 
176  ps->add_system("PhysX");
177 }
178 
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
This is a convenience class to specialize ConfigVariable as a boolean type.
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 string type.
This class specializes ConfigVariable as an enumerated type.
This is a convenience class to specialize ConfigVariable as an integer type.