Fixing broken build, and undoing previous quickfix.

This commit is contained in:
enn0x 2010-03-28 21:25:51 +00:00
parent b7eb84762f
commit 05c8023f55
13 changed files with 11 additions and 72 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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