Browse Source

Fixing broken build, and undoing previous quickfix.

enn0x 15 years ago
parent
commit
05c8023f55

+ 2 - 8
panda/src/physx/config_physx.cxx

@@ -22,6 +22,7 @@
 #include "physxCapsuleController.h"
 #include "physxCapsuleController.h"
 #include "physxCapsuleForceFieldShape.h"
 #include "physxCapsuleForceFieldShape.h"
 #include "physxCapsuleShape.h"
 #include "physxCapsuleShape.h"
+#include "physxClothMesh.h"
 #include "physxContactPair.h"
 #include "physxContactPair.h"
 #include "physxContactPoint.h"
 #include "physxContactPoint.h"
 #include "physxController.h"
 #include "physxController.h"
@@ -58,10 +59,6 @@
 #include "physxWheel.h"
 #include "physxWheel.h"
 #include "physxWheelShape.h"
 #include "physxWheelShape.h"
 
 
-#if NX_USE_CLOTH_API
-#include "physxClothMesh.h"
-#endif
-
 ConfigureDef(config_physx);
 ConfigureDef(config_physx);
 NotifyCategoryDef(physx, "");
 NotifyCategoryDef(physx, "");
 
 
@@ -121,6 +118,7 @@ init_libphysx() {
   PhysxCapsuleController::init_type();
   PhysxCapsuleController::init_type();
   PhysxCapsuleForceFieldShape::init_type();
   PhysxCapsuleForceFieldShape::init_type();
   PhysxCapsuleShape::init_type();
   PhysxCapsuleShape::init_type();
+  PhysxClothMesh::init_type();
   PhysxContactPair::init_type();
   PhysxContactPair::init_type();
   PhysxContactPoint::init_type();
   PhysxContactPoint::init_type();
   PhysxController::init_type();
   PhysxController::init_type();
@@ -157,10 +155,6 @@ init_libphysx() {
   PhysxWheel::init_type();
   PhysxWheel::init_type();
   PhysxWheelShape::init_type();
   PhysxWheelShape::init_type();
 
 
-#if NX_USE_CLOTH_API
-  PhysxClothMesh::init_type();
-#endif
-
   PandaSystem *ps = PandaSystem::get_global_ptr();
   PandaSystem *ps = PandaSystem::get_global_ptr();
   ps->add_system("PhysX");
   ps->add_system("PhysX");
 }
 }

+ 0 - 4
panda/src/physx/physxClothMesh.cxx

@@ -15,8 +15,6 @@
 #include "physxClothMesh.h"
 #include "physxClothMesh.h"
 #include "physxMeshPool.h"
 #include "physxMeshPool.h"
 
 
-#if NX_USE_CLOTH_API
-
 TypeHandle PhysxClothMesh::_type_handle;
 TypeHandle PhysxClothMesh::_type_handle;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -76,5 +74,3 @@ get_reference_count() const {
   return _ptr->getReferenceCount();
   return _ptr->getReferenceCount();
 }
 }
 
 
-#endif
-

+ 0 - 2
panda/src/physx/physxClothMesh.h

@@ -20,7 +20,6 @@
 #include "physxObject.h"
 #include "physxObject.h"
 #include "physx_includes.h"
 #include "physx_includes.h"
 
 
-#if NX_USE_CLOTH_API
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PhysxClothMesh
 //       Class : PhysxClothMesh
 // Description : 
 // Description : 
@@ -72,6 +71,5 @@ private:
 };
 };
 
 
 #include "physxClothMesh.I"
 #include "physxClothMesh.I"
-#endif
 
 
 #endif // PHYSXCLOTHMESH_H
 #endif // PHYSXCLOTHMESH_H

+ 0 - 4
panda/src/physx/physxClothMeshDesc.cxx

@@ -19,8 +19,6 @@
 #include "geomNode.h"
 #include "geomNode.h"
 #include "geomVertexReader.h"
 #include "geomVertexReader.h"
 
 
-#if NX_USE_CLOTH_API
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxClothMeshDesc::set_num_vertices
 //     Function: PhysxClothMeshDesc::set_num_vertices
 //       Access: Published
 //       Access: Published
@@ -223,5 +221,3 @@ set_from_node_path(const NodePath &np) {
   _desc.triangles = _triangles;
   _desc.triangles = _triangles;
 }
 }
 
 
-#endif
-

+ 0 - 2
panda/src/physx/physxClothMeshDesc.h

@@ -22,7 +22,6 @@
 
 
 #include "physx_includes.h"
 #include "physx_includes.h"
 
 
-#if NX_USE_CLOTH_API
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PhysxClothMeshDesc
 //       Class : PhysxClothMeshDesc
 // Description :
 // Description :
@@ -54,6 +53,5 @@ private:
 };
 };
 
 
 #include "physxClothMeshDesc.I"
 #include "physxClothMeshDesc.I"
-#endif
 
 
 #endif // PHYSXCLOTHMESHDESC_H
 #endif // PHYSXCLOTHMESHDESC_H

+ 4 - 10
panda/src/physx/physxKitchen.cxx

@@ -20,11 +20,8 @@
 #include "physxFileStream.h"
 #include "physxFileStream.h"
 #include "physxMemoryReadBuffer.h"
 #include "physxMemoryReadBuffer.h"
 #include "physxMemoryWriteBuffer.h"
 #include "physxMemoryWriteBuffer.h"
-
-#if NX_USE_CLOTH_API
 #include "physxClothMesh.h"
 #include "physxClothMesh.h"
 #include "physxClothMeshDesc.h"
 #include "physxClothMeshDesc.h"
-#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxKitchen::set_cooking_params
 //     Function: PhysxKitchen::set_cooking_params
@@ -88,7 +85,6 @@ cook_triangle_mesh(const PhysxTriangleMeshDesc &meshDesc, const Filename &filena
   return _cooking->NxCookTriangleMesh(meshDesc.get_desc(), stream);
   return _cooking->NxCookTriangleMesh(meshDesc.get_desc(), stream);
 }
 }
 
 
-#if NX_USE_CLOTH_API
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxKitchen::cook_cloth_mesh
 //     Function: PhysxKitchen::cook_cloth_mesh
 //       Access: Published
 //       Access: Published
@@ -105,7 +101,6 @@ cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc, const Filename &filename) {
   PhysxFileStream stream = PhysxFileStream(filename, false);
   PhysxFileStream stream = PhysxFileStream(filename, false);
   return _cooking->NxCookClothMesh(meshDesc.get_desc(), stream);
   return _cooking->NxCookClothMesh(meshDesc.get_desc(), stream);
 }
 }
-#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxKitchen::cook_convex_mesh
 //     Function: PhysxKitchen::cook_convex_mesh
@@ -163,7 +158,6 @@ cook_triangle_mesh(const PhysxTriangleMeshDesc &meshDesc) {
   return mesh;
   return mesh;
 }
 }
 
 
-#if NX_USE_CLOTH_API
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxKitchen::cook_cloth_mesh
 //     Function: PhysxKitchen::cook_cloth_mesh
 //       Access: Published
 //       Access: Published
@@ -174,8 +168,8 @@ cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc) {
 
 
   nassertr_always(meshDesc.is_valid(), false);
   nassertr_always(meshDesc.is_valid(), false);
 
 
-  PhysxMemoryWriteBuffer buffer;
-  bool status = _cooking->NxCookClothMesh(meshDesc.get_desc(), buffer);
+  PhysxMemoryWriteBuffer wbuffer;
+  bool status = _cooking->NxCookClothMesh(meshDesc.get_desc(), wbuffer);
   nassertr(status, NULL);
   nassertr(status, NULL);
 
 
   NxPhysicsSDK *sdk = NxGetPhysicsSDK();
   NxPhysicsSDK *sdk = NxGetPhysicsSDK();
@@ -184,12 +178,12 @@ cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc) {
   PhysxClothMesh *mesh = new PhysxClothMesh();
   PhysxClothMesh *mesh = new PhysxClothMesh();
   nassertr(mesh, NULL);
   nassertr(mesh, NULL);
 
 
-  NxClothMesh *meshPtr = sdk->createClothMesh(PhysxMemoryReadBuffer(buffer.data));
+  PhysxMemoryReadBuffer rbuffer(wbuffer.data);
+  NxClothMesh *meshPtr = sdk->createClothMesh(rbuffer);
   nassertr(meshPtr, NULL);
   nassertr(meshPtr, NULL);
 
 
   mesh->link(meshPtr);
   mesh->link(meshPtr);
 
 
   return mesh;
   return mesh;
 }
 }
-#endif
 
 

+ 3 - 9
panda/src/physx/physxKitchen.h

@@ -24,11 +24,8 @@ class PhysxConvexMesh;
 class PhysxConvexMeshDesc;
 class PhysxConvexMeshDesc;
 class PhysxTriangleMesh;
 class PhysxTriangleMesh;
 class PhysxTriangleMeshDesc;
 class PhysxTriangleMeshDesc;
-
-#if NX_USE_CLOTH_API
 class PhysxClothMesh;
 class PhysxClothMesh;
 class PhysxClothMeshDesc;
 class PhysxClothMeshDesc;
-#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PhysxKitchen
 //       Class : PhysxKitchen
@@ -43,15 +40,12 @@ PUBLISHED:
   void set_cooking_params(float skinWidth, bool hintCollisionSpeed);
   void set_cooking_params(float skinWidth, bool hintCollisionSpeed);
 
 
   bool cook_convex_mesh(const PhysxConvexMeshDesc &meshDesc, const Filename &filename);
   bool cook_convex_mesh(const PhysxConvexMeshDesc &meshDesc, const Filename &filename);
-  PhysxConvexMesh *cook_convex_mesh(const PhysxConvexMeshDesc &meshDesc);
-
   bool cook_triangle_mesh(const PhysxTriangleMeshDesc &meshDesc, const Filename &filename);
   bool cook_triangle_mesh(const PhysxTriangleMeshDesc &meshDesc, const Filename &filename);
-  PhysxTriangleMesh *cook_triangle_mesh(const PhysxTriangleMeshDesc &meshDesc);
-
-#if NX_USE_CLOTH_API
   bool cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc, const Filename &filename);
   bool cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc, const Filename &filename);
+
+  PhysxConvexMesh *cook_convex_mesh(const PhysxConvexMeshDesc &meshDesc);
+  PhysxTriangleMesh *cook_triangle_mesh(const PhysxTriangleMeshDesc &meshDesc);
   PhysxClothMesh *cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc);
   PhysxClothMesh *cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc);
-#endif
 
 
 private:
 private:
   NxCookingInterface *_cooking;
   NxCookingInterface *_cooking;

+ 0 - 2
panda/src/physx/physxManager.cxx

@@ -271,7 +271,6 @@ get_triangle_mesh(unsigned int idx) {
   return (PhysxTriangleMesh *)_triangle_meshes[idx];
   return (PhysxTriangleMesh *)_triangle_meshes[idx];
 }
 }
 
 
-#if NX_USE_CLOTH_API
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxManager::get_num_cloth_meshes
 //     Function: PhysxManager::get_num_cloth_meshes
 //       Access: Published
 //       Access: Published
@@ -295,7 +294,6 @@ get_cloth_mesh(unsigned int idx) {
 
 
   return (PhysxClothMesh *)_cloth_meshes[idx];
   return (PhysxClothMesh *)_cloth_meshes[idx];
 }
 }
-#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxManager::is_hardware_available
 //     Function: PhysxManager::is_hardware_available

+ 0 - 5
panda/src/physx/physxManager.h

@@ -71,11 +71,9 @@ PUBLISHED:
   PhysxTriangleMesh *get_triangle_mesh(unsigned int idx);
   PhysxTriangleMesh *get_triangle_mesh(unsigned int idx);
   MAKE_SEQ(get_triangle_meshes, get_num_triangle_meshes, get_triangle_mesh);
   MAKE_SEQ(get_triangle_meshes, get_num_triangle_meshes, get_triangle_mesh);
 
 
-#if NX_USE_CLOTH_API
   unsigned int get_num_cloth_meshes();
   unsigned int get_num_cloth_meshes();
   PhysxClothMesh *get_cloth_mesh(unsigned int idx);
   PhysxClothMesh *get_cloth_mesh(unsigned int idx);
   MAKE_SEQ(get_cloth_meshes, get_num_cloth_meshes, get_cloth_mesh);
   MAKE_SEQ(get_cloth_meshes, get_num_cloth_meshes, get_cloth_mesh);
-#endif
 
 
   INLINE void ls() const;
   INLINE void ls() const;
   INLINE void ls(ostream &out, int indent_level=0) const;
   INLINE void ls(ostream &out, int indent_level=0) const;
@@ -87,10 +85,7 @@ public:
   PhysxObjectCollection<PhysxHeightField> _heightfields;
   PhysxObjectCollection<PhysxHeightField> _heightfields;
   PhysxObjectCollection<PhysxConvexMesh> _convex_meshes;
   PhysxObjectCollection<PhysxConvexMesh> _convex_meshes;
   PhysxObjectCollection<PhysxTriangleMesh> _triangle_meshes;
   PhysxObjectCollection<PhysxTriangleMesh> _triangle_meshes;
-
-#if NX_USE_CLOTH_API
   PhysxObjectCollection<PhysxClothMesh> _cloth_meshes;
   PhysxObjectCollection<PhysxClothMesh> _cloth_meshes;
-#endif
 
 
   INLINE static NxVec3 vec3_to_nxVec3(const LVector3f &v);
   INLINE static NxVec3 vec3_to_nxVec3(const LVector3f &v);
   INLINE static LVector3f nxVec3_to_vec3(const NxVec3 &v);
   INLINE static LVector3f nxVec3_to_vec3(const NxVec3 &v);

+ 1 - 1
panda/src/physx/physxMemoryReadBuffer.h

@@ -23,7 +23,7 @@
 //       Class : PhysxMemoryReadBuffer
 //       Class : PhysxMemoryReadBuffer
 // Description : 
 // Description : 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class PhysxMemoryReadBuffer : public NxStream {
+class EXPCL_PANDAPHYSX PhysxMemoryReadBuffer : public NxStream {
 
 
 public:
 public:
   PhysxMemoryReadBuffer(const NxU8 *data);
   PhysxMemoryReadBuffer(const NxU8 *data);

+ 1 - 1
panda/src/physx/physxMemoryWriteBuffer.h

@@ -23,7 +23,7 @@
 //       Class : PhysxMemoryWriteBuffer
 //       Class : PhysxMemoryWriteBuffer
 // Description : 
 // Description : 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class PhysxMemoryWriteBuffer : public NxStream {
+class EXPCL_PANDAPHYSX PhysxMemoryWriteBuffer : public NxStream {
 
 
 public:
 public:
   PhysxMemoryWriteBuffer();
   PhysxMemoryWriteBuffer();

+ 0 - 15
panda/src/physx/physxMeshPool.cxx

@@ -15,21 +15,14 @@
 #include "physxMeshPool.h"
 #include "physxMeshPool.h"
 #include "physxConvexMesh.h"
 #include "physxConvexMesh.h"
 #include "physxTriangleMesh.h"
 #include "physxTriangleMesh.h"
-
-#if NX_USE_CLOTH_API
 #include "physxClothMesh.h"
 #include "physxClothMesh.h"
-#endif
 
 
 #include "physxFileStream.h"
 #include "physxFileStream.h"
 #include "virtualFileSystem.h"
 #include "virtualFileSystem.h"
 
 
 PhysxMeshPool::ConvexMeshes PhysxMeshPool::_convex_meshes;
 PhysxMeshPool::ConvexMeshes PhysxMeshPool::_convex_meshes;
 PhysxMeshPool::TriangleMeshes PhysxMeshPool::_triangle_meshes;
 PhysxMeshPool::TriangleMeshes PhysxMeshPool::_triangle_meshes;
-
-#if NX_USE_CLOTH_API
 PhysxMeshPool::ClothMeshes PhysxMeshPool::_cloth_meshes;
 PhysxMeshPool::ClothMeshes PhysxMeshPool::_cloth_meshes;
-#endif
-
 //PhysxMeshPool::SoftbodyMeshes PhysxMeshPool::_softbody_meshes;
 //PhysxMeshPool::SoftbodyMeshes PhysxMeshPool::_softbody_meshes;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -131,7 +124,6 @@ load_triangle_mesh(const Filename &fn) {
   return mesh;
   return mesh;
 }
 }
 
 
-#if NX_USE_CLOTH_API
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxMeshPool::load_cloth_mesh
 //     Function: PhysxMeshPool::load_cloth_mesh
 //       Access: Published
 //       Access: Published
@@ -170,7 +162,6 @@ load_cloth_mesh(const Filename &fn) {
 
 
   return mesh;
   return mesh;
 }
 }
-#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxMeshPool::release_convex_mesh
 //     Function: PhysxMeshPool::release_convex_mesh
@@ -210,7 +201,6 @@ release_triangle_mesh(PhysxTriangleMesh *mesh) {
   return false;
   return false;
 }
 }
 
 
-#if NX_USE_CLOTH_API
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxMeshPool::release_cloth_mesh
 //     Function: PhysxMeshPool::release_cloth_mesh
 //       Access: Published
 //       Access: Published
@@ -229,7 +219,6 @@ release_cloth_mesh(PhysxClothMesh *mesh) {
 
 
   return false;
   return false;
 }
 }
-#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxMeshPool::list_content
 //     Function: PhysxMeshPool::list_content
@@ -277,7 +266,6 @@ list_contents(ostream &out) {
     }
     }
   }
   }
 
 
-#if NX_USE_CLOTH_API
   // Cloth meshes
   // Cloth meshes
   {
   {
     ClothMeshes::const_iterator it;
     ClothMeshes::const_iterator it;
@@ -290,7 +278,6 @@ list_contents(ostream &out) {
           << " references)\n";
           << " references)\n";
     }
     }
   }
   }
-#endif
 
 
   // Summary
   // Summary
   NxPhysicsSDK *sdk = NxGetPhysicsSDK();
   NxPhysicsSDK *sdk = NxGetPhysicsSDK();
@@ -301,9 +288,7 @@ list_contents(ostream &out) {
   out << "  Total number of triangle meshes: " << sdk->getNbTriangleMeshes() 
   out << "  Total number of triangle meshes: " << sdk->getNbTriangleMeshes() 
       << " created, " << _triangle_meshes.size() << " registred\n";
       << " created, " << _triangle_meshes.size() << " registred\n";
 
 
-#if NX_USE_CLOTH_API
   out << "  Total number of cloth meshes: " << sdk->getNbClothMeshes() 
   out << "  Total number of cloth meshes: " << sdk->getNbClothMeshes() 
       << " created, " << _cloth_meshes.size() << " registred\n";
       << " created, " << _cloth_meshes.size() << " registred\n";
-#endif
 }
 }
 
 

+ 0 - 9
panda/src/physx/physxMeshPool.h

@@ -25,10 +25,7 @@
 
 
 class PhysxConvexMesh;
 class PhysxConvexMesh;
 class PhysxTriangleMesh;
 class PhysxTriangleMesh;
-
-#if NX_USE_CLOTH_API
 class PhysxClothMesh;
 class PhysxClothMesh;
-#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PhysxMeshPool
 //       Class : PhysxMeshPool
@@ -46,16 +43,12 @@ PUBLISHED:
 
 
   static PhysxConvexMesh *load_convex_mesh(const Filename &filename);
   static PhysxConvexMesh *load_convex_mesh(const Filename &filename);
   static PhysxTriangleMesh *load_triangle_mesh(const Filename &filename);
   static PhysxTriangleMesh *load_triangle_mesh(const Filename &filename);
-#if NX_USE_CLOTH_API
   static PhysxClothMesh *load_cloth_mesh(const Filename &filename);
   static PhysxClothMesh *load_cloth_mesh(const Filename &filename);
-#endif
   //static PhysxSoftBodyMesh *load_softbody_mesh(const Filename &filename);
   //static PhysxSoftBodyMesh *load_softbody_mesh(const Filename &filename);
 
 
   static bool release_convex_mesh(PhysxConvexMesh *mesh);
   static bool release_convex_mesh(PhysxConvexMesh *mesh);
   static bool release_triangle_mesh(PhysxTriangleMesh *mesh);
   static bool release_triangle_mesh(PhysxTriangleMesh *mesh);
-#if NX_USE_CLOTH_API
   static bool release_cloth_mesh(PhysxClothMesh *mesh);
   static bool release_cloth_mesh(PhysxClothMesh *mesh);
-#endif
   //static bool release_softbody_mesh(PhysxSoftBodyMesh *mesh);
   //static bool release_softbody_mesh(PhysxSoftBodyMesh *mesh);
 
 
   static void list_contents();
   static void list_contents();
@@ -70,10 +63,8 @@ private:
   typedef pmap<Filename, PT(PhysxTriangleMesh)> TriangleMeshes;
   typedef pmap<Filename, PT(PhysxTriangleMesh)> TriangleMeshes;
   static TriangleMeshes _triangle_meshes;
   static TriangleMeshes _triangle_meshes;
 
 
-#if NX_USE_CLOTH_API
   typedef pmap<Filename, PT(PhysxClothMesh)> ClothMeshes;
   typedef pmap<Filename, PT(PhysxClothMesh)> ClothMeshes;
   static ClothMeshes _cloth_meshes;
   static ClothMeshes _cloth_meshes;
-#endif
 
 
   //typedef pmap<Filename, PT(PhysxSoftBodyMesh)> SoftbodyMeshes;
   //typedef pmap<Filename, PT(PhysxSoftBodyMesh)> SoftbodyMeshes;
   //static SoftbodyMeshes _softbody_meshes;
   //static SoftbodyMeshes _softbody_meshes;