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