aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils/src/contact
diff options
context:
space:
mode:
authorSheikh Dawood <[email protected]>2018-04-09 10:13:48 -0500
committerSheikh Dawood <[email protected]>2018-04-09 10:13:48 -0500
commit238605d8225a9135d6b60646e05d066e25424eee (patch)
tree2b013bd4946bb3c699d7a06ef1f21be85d367f63 /PhysX_3.4/Source/GeomUtils/src/contact
parentAdd ParamTool.exe (diff)
downloadphysx-3.4-238605d8225a9135d6b60646e05d066e25424eee.tar.xz
physx-3.4-238605d8225a9135d6b60646e05d066e25424eee.zip
PhysX 3.4, APEX 1.4 patch release @23879214
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src/contact')
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/contact/GuContactCapsuleMesh.cpp3
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/contact/GuContactConvexMesh.cpp4
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/contact/GuContactSphereMesh.cpp3
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactBoxHeightField.cpp4
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactCapsuleHeightField.cpp4
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactConvexHeightField.cpp4
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactSphereHeightField.cpp4
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyTraceLineCallback.h7
8 files changed, 14 insertions, 19 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/src/contact/GuContactCapsuleMesh.cpp b/PhysX_3.4/Source/GeomUtils/src/contact/GuContactCapsuleMesh.cpp
index 44494988..ba0f77c8 100644
--- a/PhysX_3.4/Source/GeomUtils/src/contact/GuContactCapsuleMesh.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/contact/GuContactCapsuleMesh.cpp
@@ -614,8 +614,7 @@ bool Gu::contactCapsuleHeightfield(GU_CONTACT_METHOD_ARGS)
// We must be in local space to use the cache
- const HeightField& hf = *static_cast<HeightField*>(shapeMesh.heightField);
- HeightFieldUtil hfUtil(shapeMesh, hf);
+ HeightFieldUtil hfUtil(shapeMesh);
CapsuleHeightfieldContactGenerationCallback callback(
contactBuffer, transform1, hfUtil, meshCapsule, inflatedRadius, params.mContactDistance, shapeCapsule.radius);
diff --git a/PhysX_3.4/Source/GeomUtils/src/contact/GuContactConvexMesh.cpp b/PhysX_3.4/Source/GeomUtils/src/contact/GuContactConvexMesh.cpp
index 091cc6f3..e8574ccc 100644
--- a/PhysX_3.4/Source/GeomUtils/src/contact/GuContactConvexMesh.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/contact/GuContactConvexMesh.cpp
@@ -1381,9 +1381,7 @@ static bool contactHullHeightfield2(const PolygonalData& polyData0, const PxBoun
{
//We need to create a callback that fills triangles from the HF
- const HeightField& hf = *static_cast<HeightField*>(shape1.heightField);
-
- HeightFieldUtil hfUtil(shape1, hf);
+ HeightFieldUtil hfUtil(shape1);
const Cm::Matrix34 world0(transform0);
const Cm::Matrix34 world1(transform1);
diff --git a/PhysX_3.4/Source/GeomUtils/src/contact/GuContactSphereMesh.cpp b/PhysX_3.4/Source/GeomUtils/src/contact/GuContactSphereMesh.cpp
index 352240ef..278dd38f 100644
--- a/PhysX_3.4/Source/GeomUtils/src/contact/GuContactSphereMesh.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/contact/GuContactSphereMesh.cpp
@@ -593,9 +593,8 @@ bool Gu::contactSphereHeightfield(GU_CONTACT_METHOD_ARGS)
const PxSphereGeometry& shapeSphere = shape0.get<const PxSphereGeometry>();
const PxHeightFieldGeometryLL& shapeMesh = shape1.get<const PxHeightFieldGeometryLL>();
- const HeightField& hf = *static_cast<HeightField*>(shapeMesh.heightField);
- HeightFieldUtil hfUtil(shapeMesh, hf);
+ HeightFieldUtil hfUtil(shapeMesh);
const PxVec3 sphereCenterInMeshSpace = transform1.transformInv(transform0.p);
const PxReal inflatedRadius = shapeSphere.radius + params.mContactDistance;
diff --git a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactBoxHeightField.cpp b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactBoxHeightField.cpp
index f5703111..f9bfa471 100644
--- a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactBoxHeightField.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactBoxHeightField.cpp
@@ -187,8 +187,8 @@ bool legacyContactBoxHeightfield(GU_CONTACT_METHOD_ARGS)
const PxBoxGeometry& shapeBox = shape0.get<const PxBoxGeometry>();
const PxHeightFieldGeometryLL& hfGeom = shape1.get<const PxHeightFieldGeometryLL>();
- const Gu::HeightField& hf = *static_cast<Gu::HeightField*>(hfGeom.heightField);
- const Gu::HeightFieldUtil hfUtil(hfGeom, hf);
+ const Gu::HeightFieldTraceUtil hfUtil(hfGeom);
+ const Gu::HeightField& hf = hfUtil.getHeightField();
PX_ASSERT(contactBuffer.count==0);
diff --git a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactCapsuleHeightField.cpp b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactCapsuleHeightField.cpp
index a40ef577..73252b83 100644
--- a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactCapsuleHeightField.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactCapsuleHeightField.cpp
@@ -62,8 +62,8 @@ bool legacyContactCapsuleHeightfield(GU_CONTACT_METHOD_ARGS)
const PxCapsuleGeometry& shapeCapsule = shape0.get<const PxCapsuleGeometry>();
const PxHeightFieldGeometryLL& hfGeom = shape1.get<const PxHeightFieldGeometryLL>();
- const HeightField& hf = *static_cast<HeightField*>(hfGeom.heightField);
- const HeightFieldUtil hfUtil(hfGeom, hf);
+ const HeightFieldUtil hfUtil(hfGeom);
+ const Gu::HeightField& hf = hfUtil.getHeightField();
const PxReal radius = shapeCapsule.radius;
const PxReal inflatedRadius = shapeCapsule.radius + params.mContactDistance;
diff --git a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactConvexHeightField.cpp b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactConvexHeightField.cpp
index 42ffdce3..012133ef 100644
--- a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactConvexHeightField.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactConvexHeightField.cpp
@@ -160,8 +160,8 @@ bool legacyContactConvexHeightfield(GU_CONTACT_METHOD_ARGS)
PX_ASSERT(contactBuffer.count==0);
- const Gu::HeightField& hf = *static_cast<Gu::HeightField*>(hfGeom.heightField);
- const Gu::HeightFieldUtil hfUtil(hfGeom, hf);
+ const Gu::HeightFieldTraceUtil hfUtil(hfGeom);
+ const Gu::HeightField& hf = hfUtil.getHeightField();
const bool isConvexScaleIdentity = shapeConvex.scale.isIdentity();
Cm::FastVertex2ShapeScaling convexScaling; // PT: TODO: remove default ctor
diff --git a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactSphereHeightField.cpp b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactSphereHeightField.cpp
index ccb37f12..36f9930e 100644
--- a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactSphereHeightField.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyContactSphereHeightField.cpp
@@ -55,8 +55,8 @@ bool GuContactSphereHeightFieldShared(GU_CONTACT_METHOD_ARGS, bool isCapsule)
const PxSphereGeometry& shapeSphere = shape0.get<const PxSphereGeometry>();
const PxHeightFieldGeometryLL& hfGeom = shape1.get<const PxHeightFieldGeometryLL>();
- const Gu::HeightField& hf = *static_cast<Gu::HeightField*>(hfGeom.heightField);
- const Gu::HeightFieldUtil hfUtil(hfGeom, hf);
+ const Gu::HeightFieldUtil hfUtil(hfGeom);
+ const Gu::HeightField& hf = hfUtil.getHeightField();
const PxReal radius = shapeSphere.radius;
const PxReal eps = PxReal(0.1) * radius;
diff --git a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyTraceLineCallback.h b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyTraceLineCallback.h
index 1253931f..ee5072be 100644
--- a/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyTraceLineCallback.h
+++ b/PhysX_3.4/Source/GeomUtils/src/contact/GuLegacyTraceLineCallback.h
@@ -138,8 +138,7 @@ class GuContactHeightfieldTraceSegmentHelper
{
PX_NOCOPY(GuContactHeightfieldTraceSegmentHelper)
public:
- GuContactHeightfieldTraceSegmentHelper(const HeightFieldUtil& hfUtil)
- : mHfUtil(hfUtil)
+ GuContactHeightfieldTraceSegmentHelper(const HeightFieldTraceUtil& hfUtil) : mHfUtil(hfUtil)
{
mHfUtil.computeLocalBounds(mLocalBounds);
}
@@ -150,8 +149,8 @@ public:
}
private:
- const HeightFieldUtil& mHfUtil;
- PxBounds3 mLocalBounds;
+ const HeightFieldTraceUtil& mHfUtil;
+ PxBounds3 mLocalBounds;
};
}//Gu