Panda3D
config_physx.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file config_physx.cxx
10  * @author enn0x
11  * @date 2009-09-01
12  */
13 
14 #include "config_physx.h"
15 #include "pandaSystem.h"
16 
17 #include "physxActor.h"
18 #include "physxBoxController.h"
20 #include "physxBoxShape.h"
21 #include "physxCapsuleController.h"
23 #include "physxCapsuleShape.h"
24 #include "physxCcdSkeleton.h"
25 #include "physxCloth.h"
26 #include "physxClothMesh.h"
27 #include "physxClothNode.h"
28 #include "physxContactPair.h"
29 #include "physxContactPoint.h"
30 #include "physxController.h"
31 #include "physxControllerReport.h"
33 #include "physxControllersHit.h"
34 #include "physxConvexMesh.h"
36 #include "physxConvexShape.h"
37 #include "physxCylindricalJoint.h"
38 #include "physxD6Joint.h"
39 #include "physxDebugGeomNode.h"
40 #include "physxDistanceJoint.h"
41 #include "physxFixedJoint.h"
42 #include "physxForceField.h"
43 #include "physxForceFieldShape.h"
45 #include "physxHeightField.h"
46 #include "physxHeightFieldShape.h"
47 #include "physxJoint.h"
48 #include "physxMaterial.h"
49 #include "physxObject.h"
50 #include "physxPlaneShape.h"
51 #include "physxPointInPlaneJoint.h"
52 #include "physxPointOnLineJoint.h"
53 #include "physxPrismaticJoint.h"
54 #include "physxPulleyJoint.h"
55 #include "physxRevoluteJoint.h"
56 #include "physxScene.h"
57 #include "physxShape.h"
58 #include "physxSoftBody.h"
59 #include "physxSoftBodyMesh.h"
60 #include "physxSoftBodyNode.h"
62 #include "physxSphereShape.h"
63 #include "physxSphericalJoint.h"
64 #include "physxTriangleMesh.h"
65 #include "physxTriangleMeshShape.h"
66 #include "physxVehicle.h"
67 #include "physxWheel.h"
68 #include "physxWheelShape.h"
69 
70 #if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDAPHYSX)
71  #error Buildsystem error: BUILDING_PANDAPHYSX not defined
72 #endif
73 
74 ConfigureDef(config_physx);
75 NotifyCategoryDef(physx, "");
76 
77 ConfigureFn(config_physx) {
78  init_libphysx();
79 }
80 
81 ConfigVariableBool physx_want_vrd
82 ("physx-want-vrd", false,
83 PRC_DESC("Specified wether the manager should try to connect to the NVIDIA "
84  "PhysX visual debugger or not. Connection is established when "
85  "the first instance of PhysxManager is created."));
86 
87 ConfigVariableString physx_vrd_host
88 ("physx-vrd-host", "localhost",
89 PRC_DESC("Specified the host where the NVIDIA PhysX visual debugger is running "
90  "on. Only used if the config-varibale 'physx-want-visual-debugger' "
91  "is set to 'true'."));
92 
93 ConfigVariableInt physx_vrd_port
94 ("physx-visual-debugger-port", 5425,
95 PRC_DESC("Specified the port where the NVIDIA PhysX visual debugger is running "
96  "on. Only used if the config-varibale 'physx-want-visual-debugger' "
97  "is set to 'true'."));
98 
100 ("physx-up-axis", PhysxEnums::Z_up,
101 PRC_DESC("Set the up direction for controllers and heightfields."));
102 
103 ConfigVariableInt physx_internal_threads
104 ("physx-internal-threads", 0,
105 PRC_DESC("Specified the number of internal threads to be created by the "
106  "PhysX engine. The threads will be moved to different cores, if "
107  "possible. Default value is '0'. PhysX then runs in an external "
108  "thread, but no additional internal threads will be created."));
109 
110 /**
111  * Initializes the library. This must be called at least once before any of
112  * the functions or classes in this library can be used. Normally it will be
113  * called by the static initializers and need not be called explicitly, but
114  * special cases exist.
115  */
116 void
118  static bool initialized = false;
119  if (initialized) {
120  return;
121  }
122  initialized = true;
123 
124  PhysxActor::init_type();
125  PhysxBoxController::init_type();
126  PhysxBoxForceFieldShape::init_type();
127  PhysxBoxShape::init_type();
128  PhysxCapsuleController::init_type();
129  PhysxCapsuleForceFieldShape::init_type();
130  PhysxCapsuleShape::init_type();
131  PhysxCcdSkeleton::init_type();
132  PhysxCloth::init_type();
133  PhysxClothMesh::init_type();
134  PhysxClothNode::init_type();
135  PhysxContactPair::init_type();
136  PhysxContactPoint::init_type();
137  PhysxController::init_type();
138  PhysxControllerShapeHit::init_type();
139  PhysxControllersHit::init_type();
140  PhysxConvexMesh::init_type();
141  PhysxConvexForceFieldShape::init_type();
142  PhysxConvexShape::init_type();
143  PhysxCylindricalJoint::init_type();
144  PhysxD6Joint::init_type();
145  PhysxDebugGeomNode::init_type();
146  PhysxDistanceJoint::init_type();
147  PhysxFixedJoint::init_type();
148  PhysxForceField::init_type();
149  PhysxForceFieldShape::init_type();
150  PhysxForceFieldShapeGroup::init_type();
151  PhysxHeightField::init_type();
152  PhysxHeightFieldShape::init_type();
153  PhysxJoint::init_type();
154  PhysxMaterial::init_type();
155  PhysxObject::init_type();
156  PhysxPlaneShape::init_type();
157  PhysxPointInPlaneJoint::init_type();
158  PhysxPointOnLineJoint::init_type();
159  PhysxPrismaticJoint::init_type();
160  PhysxPulleyJoint::init_type();
161  PhysxRevoluteJoint::init_type();
162  PhysxScene::init_type();
163  PhysxShape::init_type();
164  PhysxSoftBody::init_type();
165  PhysxSoftBodyMesh::init_type();
166  PhysxSoftBodyNode::init_type();
167  PhysxSphereForceFieldShape::init_type();
168  PhysxSphereShape::init_type();
169  PhysxSphericalJoint::init_type();
170  PhysxTriangleMesh::init_type();
171  PhysxTriangleMeshShape::init_type();
172  PhysxVehicle::init_type();
173  PhysxWheel::init_type();
174  PhysxWheelShape::init_type();
175 
177  ps->add_system("PhysX");
178 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is used as a namespace to group several global properties of Panda.
Definition: pandaSystem.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as a boolean type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as a string type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class specializes ConfigVariable as an enumerated type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as an integer type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libphysx()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.