chore(cleanup): Excessive line breaks removal. (#12126)
chore (cleanup): Excess line breaks removed
This commit is contained in:
parent
c6ff6005be
commit
95787beb57
55
deps/g3dlite/source/CollisionDetection.cpp
vendored
55
deps/g3dlite/source/CollisionDetection.cpp
vendored
@ -33,15 +33,12 @@
|
||||
#pragma float_control( precise, off )
|
||||
#endif
|
||||
|
||||
|
||||
namespace G3D {
|
||||
|
||||
bool CollisionDetection::ignoreBool;
|
||||
Vector3 CollisionDetection::ignore;
|
||||
Array<Vector3> CollisionDetection::ignoreArray;
|
||||
|
||||
|
||||
|
||||
Vector3 CollisionDetection::separatingAxisForSolidBoxSolidBox(
|
||||
const int separatingAxisIndex,
|
||||
const Box & box1,
|
||||
@ -179,7 +176,6 @@ float CollisionDetection::projectedDistanceForSolidBoxSolidBox(
|
||||
return (R - (R0 + R1));
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDetection::parallelAxisForSolidBoxSolidBox(
|
||||
const double* ca,
|
||||
const double epsilon,
|
||||
@ -196,9 +192,6 @@ bool CollisionDetection::parallelAxisForSolidBoxSolidBox(
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void CollisionDetection::fillSolidBoxSolidBoxInfo(
|
||||
const Box & box1,
|
||||
const Box & box2,
|
||||
@ -234,8 +227,6 @@ void CollisionDetection::fillSolidBoxSolidBoxInfo(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool CollisionDetection::conservativeBoxBoxTest(
|
||||
const Vector3 & a, const Vector3 & b, const Vector3 & D) {
|
||||
// do a quick bounding sphere test because it is relatively
|
||||
@ -245,9 +236,6 @@ bool CollisionDetection::conservativeBoxBoxTest(
|
||||
return (D.squaredMagnitude() < square(boxRadius1 + boxRadius2));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(
|
||||
const Box& box1,
|
||||
const Box& box2,
|
||||
@ -304,8 +292,6 @@ bool CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CollisionDetection::closestPointsBetweenLineAndLine(
|
||||
const Line & line1,
|
||||
const Line & line2,
|
||||
@ -342,8 +328,6 @@ void CollisionDetection::closestPointsBetweenLineAndLine(
|
||||
closest2 = Q0 + (tc * v);
|
||||
}
|
||||
|
||||
|
||||
|
||||
float CollisionDetection::penetrationDepthForFixedBoxFixedBox(
|
||||
const Box& box1,
|
||||
const Box& box2,
|
||||
@ -548,9 +532,6 @@ float CollisionDetection::penetrationDepthForFixedBoxFixedBox(
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
float CollisionDetection::penetrationDepthForFixedSphereFixedBox(
|
||||
const Sphere& sphere,
|
||||
const Box& box,
|
||||
@ -573,7 +554,6 @@ float CollisionDetection::penetrationDepthForFixedSphereFixedBox(
|
||||
|
||||
// Find the square of the distance from the sphere to the box
|
||||
|
||||
|
||||
// Distance along each axis from the closest side of the box
|
||||
// to the sphere center. Negative values are *inside* the box.
|
||||
Vector3 distOutsideBox;
|
||||
@ -760,7 +740,6 @@ ZAXIS:
|
||||
return depth;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::penetrationDepthForFixedSphereFixedSphere(
|
||||
const Sphere& sphereA,
|
||||
const Sphere& sphereB,
|
||||
@ -784,7 +763,6 @@ float CollisionDetection::penetrationDepthForFixedSphereFixedSphere(
|
||||
return depth;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::penetrationDepthForFixedSphereFixedPlane(
|
||||
const Sphere& sphereA,
|
||||
const Plane& planeB,
|
||||
@ -809,7 +787,6 @@ float CollisionDetection::penetrationDepthForFixedSphereFixedPlane(
|
||||
return depth;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::penetrationDepthForFixedBoxFixedPlane(
|
||||
const Box& box,
|
||||
const Plane& plane,
|
||||
@ -843,7 +820,6 @@ float CollisionDetection::penetrationDepthForFixedBoxFixedPlane(
|
||||
return -lowest;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingPointFixedPlane(
|
||||
const Vector3& point,
|
||||
const Vector3& velocity,
|
||||
@ -1028,7 +1004,6 @@ float CollisionDetection::collisionTimeForMovingPointFixedSphere(
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingSphereFixedSphere(
|
||||
const Sphere& movingSphere,
|
||||
const Vector3& velocity,
|
||||
@ -1060,7 +1035,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedSphere(
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
float CollisionDetection::collisionTimeForMovingPointFixedTriangle(
|
||||
const Vector3& point,
|
||||
@ -1206,7 +1180,6 @@ float CollisionDetection::collisionTimeForMovingPointFixedBox(
|
||||
return bestTime;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingPointFixedAABox(
|
||||
const Vector3& origin,
|
||||
const Vector3& dir,
|
||||
@ -1222,7 +1195,6 @@ float CollisionDetection::collisionTimeForMovingPointFixedAABox(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDetection::collisionLocationForMovingPointFixedAABox(
|
||||
const Vector3& origin,
|
||||
const Vector3& dir,
|
||||
@ -1303,8 +1275,6 @@ bool CollisionDetection::collisionLocationForMovingPointFixedAABox(
|
||||
#undef IR
|
||||
}
|
||||
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingPointFixedRectangle(
|
||||
const Vector3& point,
|
||||
const Vector3& velocity,
|
||||
@ -1506,7 +1476,6 @@ static int findRayCapsuleIntersectionAux(
|
||||
return iQuantity;
|
||||
}
|
||||
|
||||
|
||||
/** Used by collisionTimeForMovingPointFixedCapsule.
|
||||
@cite From magic software http://www.magic-software.com/Source/Intersection3D/MgcIntr3DLinCap.cpp
|
||||
|
||||
@ -1585,7 +1554,6 @@ float CollisionDetection::collisionTimeForMovingPointFixedCapsule(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingSphereFixedPlane(
|
||||
const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -1631,7 +1599,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedPlane(
|
||||
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingSphereFixedTriangle
|
||||
(const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -1746,7 +1713,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedTriangle
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingSphereFixedRectangle(
|
||||
const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -1786,7 +1752,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedRectangle(
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingSphereFixedBox(
|
||||
const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -1822,7 +1787,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedBox(
|
||||
return bestTime;
|
||||
}
|
||||
|
||||
|
||||
float CollisionDetection::collisionTimeForMovingSphereFixedCapsule(
|
||||
const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -1846,7 +1810,6 @@ float CollisionDetection::collisionTimeForMovingSphereFixedCapsule(
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
Vector3 CollisionDetection::bounceDirection(
|
||||
const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -1870,7 +1833,6 @@ Vector3 CollisionDetection::bounceDirection(
|
||||
return direction - 2.0 * normal * normal.dot(direction);
|
||||
}
|
||||
|
||||
|
||||
Vector3 CollisionDetection::slideDirection(
|
||||
const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -1885,7 +1847,6 @@ Vector3 CollisionDetection::slideDirection(
|
||||
return direction - normal * normal.dot(direction);
|
||||
}
|
||||
|
||||
|
||||
Vector3 CollisionDetection::closestPointOnLineSegment(
|
||||
const Vector3& v0,
|
||||
const Vector3& v1,
|
||||
@ -1931,7 +1892,6 @@ Vector3 CollisionDetection::closestPointOnLineSegment(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vector3 CollisionDetection::closestPointOnTrianglePerimeter(
|
||||
const Vector3& v0,
|
||||
const Vector3& v1,
|
||||
@ -1951,7 +1911,6 @@ Vector3 CollisionDetection::closestPointOnTrianglePerimeter(
|
||||
return closestPointOnTrianglePerimeter(v, edgeDirection, edgeLength, point, edgeIndex);
|
||||
}
|
||||
|
||||
|
||||
Vector3 CollisionDetection::closestPointOnTrianglePerimeter(
|
||||
const Vector3 v[3],
|
||||
const Vector3 edgeDirection[3],
|
||||
@ -2005,7 +1964,6 @@ Vector3 CollisionDetection::closestPointOnTrianglePerimeter(
|
||||
return r[edgeIndex];
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDetection::isPointInsideTriangle(
|
||||
const Vector3& v0,
|
||||
const Vector3& v1,
|
||||
@ -2082,7 +2040,6 @@ bool CollisionDetection::isPointInsideTriangle(
|
||||
return (b[2] >= 0.0f) && (b[2] <= 1.0f);
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDetection::isPointInsideRectangle(
|
||||
const Vector3& v0,
|
||||
const Vector3& v1,
|
||||
@ -2095,7 +2052,6 @@ bool CollisionDetection::isPointInsideRectangle(
|
||||
isPointInsideTriangle(v2, v3, v0, normal, point);
|
||||
}
|
||||
|
||||
|
||||
Vector3 CollisionDetection::closestPointToRectanglePerimeter(
|
||||
const Vector3& v0,
|
||||
const Vector3& v1,
|
||||
@ -2144,7 +2100,6 @@ Vector3 CollisionDetection::closestPointToRectanglePerimeter(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vector3 CollisionDetection::closestPointToRectangle(
|
||||
const Vector3& v0,
|
||||
const Vector3& v1,
|
||||
@ -2168,7 +2123,6 @@ Vector3 CollisionDetection::closestPointToRectangle(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidSphere(
|
||||
const Sphere& sphere1,
|
||||
const Sphere& sphere2) {
|
||||
@ -2176,7 +2130,6 @@ bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidSphere(
|
||||
return (sphere1.center - sphere2.center).squaredMagnitude() < square(sphere1.radius + sphere2.radius);
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidBox(
|
||||
const Sphere& sphere,
|
||||
const Box& box) {
|
||||
@ -2203,7 +2156,6 @@ bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidBox(
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDetection::movingSpherePassesThroughFixedBox(
|
||||
const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -2221,7 +2173,6 @@ bool CollisionDetection::movingSpherePassesThroughFixedBox(
|
||||
return (collisionTimeForMovingSphereFixedBox(sphere, velocity, box, dummy1, dummy2) < timeLimit);
|
||||
}
|
||||
|
||||
|
||||
bool CollisionDetection::movingSpherePassesThroughFixedSphere(
|
||||
const Sphere& sphere,
|
||||
const Vector3& velocity,
|
||||
@ -2240,8 +2191,6 @@ bool CollisionDetection::movingSpherePassesThroughFixedSphere(
|
||||
return (collisionTimeForMovingPointFixedSphere(sphere.center, velocity, bigFixed, dummy1, dummy2) < timeLimit);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool CollisionDetection::fixedSolidSphereIntersectsFixedTriangle(
|
||||
const Sphere& sphere,
|
||||
const Triangle& triangle) {
|
||||
@ -2272,9 +2221,8 @@ bool CollisionDetection::fixedSolidSphereIntersectsFixedTriangle(
|
||||
return ((v - sphere.center).squaredLength() <= square(sphere.radius));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// AABB-triangle overlap test code based on Tomas Akenine-M<EFBFBD>öller's
|
||||
// AABB-triangle overlap test code based on Tomas Akenine-Möller's
|
||||
// http://www.cs.lth.se/home/Tomas_Akenine_Moller/code/tribox3.txt
|
||||
// Ported 2008-12-28
|
||||
|
||||
@ -2452,7 +2400,6 @@ bool CollisionDetection::fixedSolidBoxIntersectsFixedTriangle(
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user