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"
19 #include "physxBoxForceFieldShape.h"
20 #include "physxBoxShape.h"
21 #include "physxCapsuleController.h"
22 #include "physxCapsuleForceFieldShape.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"
32 #include "physxControllerShapeHit.h"
33 #include "physxControllersHit.h"
34 #include "physxConvexMesh.h"
35 #include "physxConvexForceFieldShape.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"
44 #include "physxForceFieldShapeGroup.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"
61 #include "physxSphereForceFieldShape.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
99 ConfigVariableEnum<PhysxEnums::PhysxUpAxis> physx_up_axis
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
117 init_libphysx() {
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
176 PandaSystem *ps = PandaSystem::get_global_ptr();
177 ps->add_system("PhysX");
178 }
ConfigVariableBool
This is a convenience class to specialize ConfigVariable as a boolean type.
Definition: configVariableBool.h:23
ConfigVariableEnum
This class specializes ConfigVariable as an enumerated type.
Definition: configVariableEnum.h:31
ConfigVariableInt
This is a convenience class to specialize ConfigVariable as an integer type.
Definition: configVariableInt.h:24
ConfigVariableString
This is a convenience class to specialize ConfigVariable as a string type.
Definition: configVariableString.h:23
PandaSystem
This class is used as a namespace to group several global properties of Panda.
Definition: pandaSystem.h:26
PandaSystem::get_global_ptr
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
Definition: pandaSystem.cxx:446
PandaSystem::add_system
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
Definition: pandaSystem.cxx:369
init_libphysx
void init_libphysx()
Initializes the library.
Definition: config_physx.cxx:117
config_physx.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandaSystem.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxActor.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxBoxController.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxBoxForceFieldShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxBoxShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxCapsuleController.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxCapsuleForceFieldShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxCapsuleShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxCcdSkeleton.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxClothMesh.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxClothNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxCloth.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxContactPair.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxContactPoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxControllerReport.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxControllerShapeHit.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxController.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxControllersHit.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxConvexForceFieldShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxConvexMesh.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxConvexShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxCylindricalJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxD6Joint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxDebugGeomNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxDistanceJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxFixedJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxForceFieldShapeGroup.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxForceFieldShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxForceField.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxHeightFieldShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxHeightField.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxMaterial.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxObject.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxPlaneShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxPointInPlaneJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxPointOnLineJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxPrismaticJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxPulleyJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxRevoluteJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxScene.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxSoftBodyMesh.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxSoftBodyNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxSoftBody.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxSphereForceFieldShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxSphereShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxSphericalJoint.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxTriangleMeshShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxTriangleMesh.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxVehicle.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxWheelShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxWheel.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.