Move collider shape raycasting utilities to the PhysicsColliderActor class
This commit is contained in:
@@ -2630,6 +2630,7 @@ bool PhysicsBackend::RayCastShape(void* shape, const Vector3& position, const Qu
|
||||
PxRaycastHit hit;
|
||||
if (PxGeometryQuery::raycast(C2P(origin - sceneOrigin), C2P(direction), shapePhysX->getGeometry(), trans, maxDistance, SCENE_QUERY_FLAGS, 1, &hit) == 0)
|
||||
return false;
|
||||
hit.shape = shapePhysX;
|
||||
P2C(hit, hitInfo);
|
||||
hitInfo.Point += sceneOrigin;
|
||||
return true;
|
||||
|
||||
@@ -163,14 +163,11 @@ void SimulationEventCallback::onContact(const PxContactPairHeader& pairHeader, c
|
||||
c.ThisVelocity = c.OtherVelocity = Vector3::Zero;
|
||||
if (hasPostVelocities && j.nextItemSet())
|
||||
{
|
||||
ASSERT(j.contactPairIndex == pairIndex);
|
||||
ASSERT_LOW_LAYER(j.contactPairIndex == pairIndex);
|
||||
if (j.postSolverVelocity)
|
||||
{
|
||||
const PxVec3 linearVelocityActor0 = j.postSolverVelocity->linearVelocity[0];
|
||||
const PxVec3 linearVelocityActor1 = j.postSolverVelocity->linearVelocity[1];
|
||||
|
||||
c.ThisVelocity = P2C(linearVelocityActor0);
|
||||
c.OtherVelocity = P2C(linearVelocityActor1);
|
||||
c.ThisVelocity = P2C(j.postSolverVelocity->linearVelocity[0]);
|
||||
c.OtherVelocity = P2C(j.postSolverVelocity->linearVelocity[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user