|
@@ -42,6 +42,9 @@ bool VehicleCollisionTesterRay::Collide(PhysicsSystem &inPhysicsSystem, uint inW
|
|
|
JPH_ASSERT(lock.Succeeded()); // When this runs all bodies are locked so this should not fail
|
|
JPH_ASSERT(lock.Succeeded()); // When this runs all bodies are locked so this should not fail
|
|
|
const Body *body = &lock.GetBody();
|
|
const Body *body = &lock.GetBody();
|
|
|
|
|
|
|
|
|
|
+ if (body->IsSensor())
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
// Test that we're not hitting a vertical wall
|
|
// Test that we're not hitting a vertical wall
|
|
|
Vec3 contact_pos = mRay.GetPointOnRay(inResult.mFraction);
|
|
Vec3 contact_pos = mRay.GetPointOnRay(inResult.mFraction);
|
|
|
Vec3 normal = body->GetWorldSpaceSurfaceNormal(inResult.mSubShapeID2, contact_pos);
|
|
Vec3 normal = body->GetWorldSpaceSurfaceNormal(inResult.mSubShapeID2, contact_pos);
|
|
@@ -125,6 +128,9 @@ bool VehicleCollisionTesterCastSphere::Collide(PhysicsSystem &inPhysicsSystem, u
|
|
|
JPH_ASSERT(lock.Succeeded()); // When this runs all bodies are locked so this should not fail
|
|
JPH_ASSERT(lock.Succeeded()); // When this runs all bodies are locked so this should not fail
|
|
|
const Body *body = &lock.GetBody();
|
|
const Body *body = &lock.GetBody();
|
|
|
|
|
|
|
|
|
|
+ if (body->IsSensor())
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
// Test that we're not hitting a vertical wall
|
|
// Test that we're not hitting a vertical wall
|
|
|
Vec3 normal = -inResult.mPenetrationAxis.Normalized();
|
|
Vec3 normal = -inResult.mPenetrationAxis.Normalized();
|
|
|
if (normal.Dot(mUpDirection) > mCosMaxSlopeAngle)
|
|
if (normal.Dot(mUpDirection) > mCosMaxSlopeAngle)
|