00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "config_physx.h"
00016 #include "pandaSystem.h"
00017
00018 #include "physxActor.h"
00019 #include "physxBoxController.h"
00020 #include "physxBoxForceFieldShape.h"
00021 #include "physxBoxShape.h"
00022 #include "physxCapsuleController.h"
00023 #include "physxCapsuleForceFieldShape.h"
00024 #include "physxCapsuleShape.h"
00025 #include "physxCloth.h"
00026 #include "physxClothMesh.h"
00027 #include "physxClothNode.h"
00028 #include "physxContactPair.h"
00029 #include "physxContactPoint.h"
00030 #include "physxController.h"
00031 #include "physxConvexMesh.h"
00032 #include "physxConvexForceFieldShape.h"
00033 #include "physxConvexShape.h"
00034 #include "physxCylindricalJoint.h"
00035 #include "physxD6Joint.h"
00036 #include "physxDebugGeomNode.h"
00037 #include "physxDistanceJoint.h"
00038 #include "physxFixedJoint.h"
00039 #include "physxForceField.h"
00040 #include "physxForceFieldShape.h"
00041 #include "physxForceFieldShapeGroup.h"
00042 #include "physxHeightField.h"
00043 #include "physxHeightFieldShape.h"
00044 #include "physxJoint.h"
00045 #include "physxMaterial.h"
00046 #include "physxObject.h"
00047 #include "physxPlaneShape.h"
00048 #include "physxPointInPlaneJoint.h"
00049 #include "physxPointOnLineJoint.h"
00050 #include "physxPrismaticJoint.h"
00051 #include "physxPulleyJoint.h"
00052 #include "physxRevoluteJoint.h"
00053 #include "physxScene.h"
00054 #include "physxShape.h"
00055 #include "physxSoftBody.h"
00056 #include "physxSoftBodyMesh.h"
00057 #include "physxSoftBodyNode.h"
00058 #include "physxSphereForceFieldShape.h"
00059 #include "physxSphereShape.h"
00060 #include "physxSphericalJoint.h"
00061 #include "physxTriangleMesh.h"
00062 #include "physxTriangleMeshShape.h"
00063 #include "physxVehicle.h"
00064 #include "physxWheel.h"
00065 #include "physxWheelShape.h"
00066
00067 ConfigureDef(config_physx);
00068 NotifyCategoryDef(physx, "");
00069
00070 ConfigureFn(config_physx) {
00071 init_libphysx();
00072 }
00073
00074 ConfigVariableBool physx_want_vrd
00075 ("physx-want-vrd", false,
00076 PRC_DESC("Specified wether the manager should try to connect to the NVIDIA "
00077 "PhysX visual debugger or not. Connection is established when "
00078 "the first instance of PhysxManager is created."));
00079
00080 ConfigVariableString physx_vrd_host
00081 ("physx-vrd-host", "localhost",
00082 PRC_DESC("Specified the host where the NVIDIA PhysX visual debugger is running "
00083 "on. Only used if the config-varibale 'physx-want-visual-debugger' "
00084 "is set to 'true'."));
00085
00086 ConfigVariableInt physx_vrd_port
00087 ("physx-visual-debugger-port", 5425,
00088 PRC_DESC("Specified the port where the NVIDIA PhysX visual debugger is running "
00089 "on. Only used if the config-varibale 'physx-want-visual-debugger' "
00090 "is set to 'true'."));
00091
00092 ConfigVariableEnum<PhysxEnums::PhysxUpAxis> physx_up_axis
00093 ("physx-up-axis", PhysxEnums::Z_up,
00094 PRC_DESC("Set the up direction for controllers and heightfields."));
00095
00096 ConfigVariableInt physx_internal_threads
00097 ("physx-internal-threads", 0,
00098 PRC_DESC("Specified the number of internal threads to be created by the "
00099 "PhysX engine. The threads will be moved to different cores, if "
00100 "possible. Default value is '0'. PhysX then runs in an external "
00101 "thread, but no additional internal threads will be created."));
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 void
00112 init_libphysx() {
00113 static bool initialized = false;
00114 if (initialized) {
00115 return;
00116 }
00117 initialized = true;
00118
00119 PhysxActor::init_type();
00120 PhysxBoxController::init_type();
00121 PhysxBoxForceFieldShape::init_type();
00122 PhysxBoxShape::init_type();
00123 PhysxCapsuleController::init_type();
00124 PhysxCapsuleForceFieldShape::init_type();
00125 PhysxCapsuleShape::init_type();
00126 PhysxCloth::init_type();
00127 PhysxClothMesh::init_type();
00128 PhysxClothNode::init_type();
00129 PhysxContactPair::init_type();
00130 PhysxContactPoint::init_type();
00131 PhysxController::init_type();
00132 PhysxConvexMesh::init_type();
00133 PhysxConvexForceFieldShape::init_type();
00134 PhysxConvexShape::init_type();
00135 PhysxCylindricalJoint::init_type();
00136 PhysxD6Joint::init_type();
00137 PhysxDebugGeomNode::init_type();
00138 PhysxDistanceJoint::init_type();
00139 PhysxFixedJoint::init_type();
00140 PhysxForceField::init_type();
00141 PhysxForceFieldShape::init_type();
00142 PhysxForceFieldShapeGroup::init_type();
00143 PhysxHeightField::init_type();
00144 PhysxHeightFieldShape::init_type();
00145 PhysxJoint::init_type();
00146 PhysxMaterial::init_type();
00147 PhysxObject::init_type();
00148 PhysxPlaneShape::init_type();
00149 PhysxPointInPlaneJoint::init_type();
00150 PhysxPointOnLineJoint::init_type();
00151 PhysxPrismaticJoint::init_type();
00152 PhysxPulleyJoint::init_type();
00153 PhysxRevoluteJoint::init_type();
00154 PhysxScene::init_type();
00155 PhysxShape::init_type();
00156 PhysxSoftBody::init_type();
00157 PhysxSoftBodyMesh::init_type();
00158 PhysxSoftBodyNode::init_type();
00159 PhysxSphereForceFieldShape::init_type();
00160 PhysxSphereShape::init_type();
00161 PhysxSphericalJoint::init_type();
00162 PhysxTriangleMesh::init_type();
00163 PhysxTriangleMeshShape::init_type();
00164 PhysxVehicle::init_type();
00165 PhysxWheel::init_type();
00166 PhysxWheelShape::init_type();
00167
00168 PandaSystem *ps = PandaSystem::get_global_ptr();
00169 ps->add_system("PhysX");
00170 }
00171