aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils/src
diff options
context:
space:
mode:
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src')
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp24
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/convex/GuConvexMesh.h4
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h4
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp2
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.h3
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.h2
6 files changed, 26 insertions, 13 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp b/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp
index 3cc55dae..c29c04a4 100644
--- a/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp
@@ -120,24 +120,32 @@ bool physx::readFloatBuffer(PxF32* dest, PxU32 nbFloats, bool mismatch, PxInputS
void physx::writeFloatBuffer(const PxF32* src, PxU32 nb, bool mismatch, PxOutputStream& stream)
{
- while(nb--)
+ if(mismatch)
{
- PxF32 f = *src++;
- if(mismatch)
+ while(nb--)
+ {
+ PxF32 f = *src++;
flip(f);
- stream.write(&f, sizeof(PxF32));
+ stream.write(&f, sizeof(PxF32));
+ }
}
+ else
+ stream.write(src, sizeof(PxF32) * nb);
}
void physx::writeWordBuffer(const PxU16* src, PxU32 nb, bool mismatch, PxOutputStream& stream)
{
- while(nb--)
+ if(mismatch)
{
- PxU16 w = *src++;
- if(mismatch)
+ while(nb--)
+ {
+ PxU16 w = *src++;
flip(w);
- stream.write(&w, sizeof(PxU16));
+ stream.write(&w, sizeof(PxU16));
+ }
}
+ else
+ stream.write(src, sizeof(PxU16) * nb);
}
void physx::readWordBuffer(PxU16* dest, PxU32 nb, bool mismatch, PxInputStream& stream)
diff --git a/PhysX_3.4/Source/GeomUtils/src/convex/GuConvexMesh.h b/PhysX_3.4/Source/GeomUtils/src/convex/GuConvexMesh.h
index be60c88a..8de6ef9d 100644
--- a/PhysX_3.4/Source/GeomUtils/src/convex/GuConvexMesh.h
+++ b/PhysX_3.4/Source/GeomUtils/src/convex/GuConvexMesh.h
@@ -107,8 +107,8 @@ namespace Gu
PX_PHYSX_COMMON_API virtual void onRefCountZero();
PX_PHYSX_COMMON_API static ConvexMesh* createObject(PxU8*& address, PxDeserializationContext& context);
PX_PHYSX_COMMON_API static void getBinaryMetaData(PxOutputStream& stream);
- void resolveReferences(PxDeserializationContext&) {}
- virtual void requires(PxProcessPxBaseCallback&){}
+ void resolveReferences(PxDeserializationContext&){}
+ virtual void requiresObjects(PxProcessPxBaseCallback&){}
//~PX_SERIALIZATION
PX_PHYSX_COMMON_API ConvexMesh();
diff --git a/PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h b/PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h
index f31d3ec1..a994c073 100644
--- a/PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h
+++ b/PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h
@@ -70,8 +70,10 @@ public:
PX_PHYSX_COMMON_API static HeightField* createObject(PxU8*& address, PxDeserializationContext& context);
PX_PHYSX_COMMON_API static void getBinaryMetaData(PxOutputStream& stream);
void resolveReferences(PxDeserializationContext&) {}
- virtual void requires(PxProcessPxBaseCallback&){}
+
+ virtual void requiresObjects(PxProcessPxBaseCallback&){}
//~PX_SERIALIZATION
+
PX_PHYSX_COMMON_API HeightField(GuMeshFactory* meshFactory);
PX_PHYSX_COMMON_API HeightField(GuMeshFactory& factory, Gu::HeightFieldData& data);
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp b/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp
index 24c86294..8b318819 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp
@@ -181,7 +181,7 @@ bool BV4Tree::init(SourceMesh* meshInterface, const PxBounds3& localBounds)
}
// PX_SERIALIZATION
-BV4Tree::BV4Tree(const PxEMPTY)
+BV4Tree::BV4Tree(const PxEMPTY) : mLocalBounds(PxEmpty)
{
mUserAllocated = true;
}
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.h b/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.h
index 8bbcf737..48766a22 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.h
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.h
@@ -156,6 +156,9 @@ namespace Gu
struct LocalBounds
{
+ // PX_SERIALIZATION
+ LocalBounds(const PxEMPTY) {}
+ //~PX_SERIALIZATION
LocalBounds() : mCenter(PxVec3(0.0f)), mExtentsMagnitude(0.0f) {}
PxVec3 mCenter;
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.h b/PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.h
index 1d9871bb..7ff181d4 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.h
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.h
@@ -76,7 +76,7 @@ public:
virtual void release();
void resolveReferences(PxDeserializationContext& ) {}
- virtual void requires(PxProcessPxBaseCallback&){}
+ virtual void requiresObjects(PxProcessPxBaseCallback&){}
//~PX_SERIALIZATION
// Cm::RefCountable