git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@247 92aac97c-a6ce-11dd-a772-7fcde58d38e6

This commit is contained in:
chappuis.daniel 2010-01-05 20:50:26 +00:00
parent fb416001ad
commit 3fc211f954

View File

@ -509,6 +509,7 @@ void NarrowPhaseSATAlgorithm::computeContact(const OBB* const obb1, const OBB* c
Vector3D d2 = obb2ExtremePoints[1] - obb2ExtremePoints[0]; Vector3D d2 = obb2ExtremePoints[1] - obb2ExtremePoints[0];
double alpha, beta; double alpha, beta;
std::vector<Vector3D> contactSet;
// If the two edges are parallel // If the two edges are parallel
if (d1.isParallelWith(d2)) { if (d1.isParallelWith(d2)) {
@ -519,8 +520,9 @@ void NarrowPhaseSATAlgorithm::computeContact(const OBB* const obb1, const OBB* c
computeParallelSegmentsIntersection(obb1ExtremePoints[0], obb1ExtremePoints[1], obb2ExtremePoints[0], obb2ExtremePoints[1], computeParallelSegmentsIntersection(obb1ExtremePoints[0], obb1ExtremePoints[1], obb2ExtremePoints[0], obb2ExtremePoints[1],
contactPointA, contactPointB); contactPointA, contactPointB);
// Add the two contact points in the contact set
contactSet.push_back(contactPointA);
contactSet.push_back(contactPointB);
} }
else { // If the two edges are not parallel else { // If the two edges are not parallel
// Compute the closest two points between the two line segments // Compute the closest two points between the two line segments
@ -530,7 +532,8 @@ void NarrowPhaseSATAlgorithm::computeContact(const OBB* const obb1, const OBB* c
// Compute the contact point as halfway between the 2 closest points // Compute the contact point as halfway between the 2 closest points
Vector3D contactPoint = 0.5 * (pointA + pointB); Vector3D contactPoint = 0.5 * (pointA + pointB);
std::vector<Vector3D> contactSet;
// Add the contact point into the contact set
contactSet.push_back(contactPoint); contactSet.push_back(contactPoint);
} }