Minor fixes and changes
This commit is contained in:
@@ -1124,7 +1124,6 @@ bool CollisionsHelper::BoxIntersectsSphere(const BoundingBox& box, const Boundin
|
||||
Vector3 vector;
|
||||
Vector3::Clamp(sphere.Center, box.Minimum, box.Maximum, vector);
|
||||
const float distance = Vector3::DistanceSquared(sphere.Center, vector);
|
||||
|
||||
return distance <= sphere.Radius * sphere.Radius;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,23 +131,6 @@ Vector3 Vector3::Frac(const Vector3& v)
|
||||
);
|
||||
}
|
||||
|
||||
Vector3 Vector3::Clamp(const Vector3& value, const Vector3& min, const Vector3& max)
|
||||
{
|
||||
float x = value.X;
|
||||
x = x > max.X ? max.X : x;
|
||||
x = x < min.X ? min.X : x;
|
||||
|
||||
float y = value.Y;
|
||||
y = y > max.Y ? max.Y : y;
|
||||
y = y < min.Y ? min.Y : y;
|
||||
|
||||
float z = value.Z;
|
||||
z = z > max.Z ? max.Z : z;
|
||||
z = z < min.Z ? min.Z : z;
|
||||
|
||||
return Vector3(x, y, z);
|
||||
}
|
||||
|
||||
void Vector3::Hermite(const Vector3& value1, const Vector3& tangent1, const Vector3& value2, const Vector3& tangent2, float amount, Vector3& result)
|
||||
{
|
||||
const float squared = amount * amount;
|
||||
|
||||
@@ -593,7 +593,10 @@ public:
|
||||
// @param min The minimum value,
|
||||
// @param max The maximum value
|
||||
// @returns Clamped value
|
||||
static Vector3 Clamp(const Vector3& value, const Vector3& min, const Vector3& max);
|
||||
static Vector3 Clamp(const Vector3& value, const Vector3& min, const Vector3& max)
|
||||
{
|
||||
return Vector3(Math::Clamp(value.X, min.X, max.X), Math::Clamp(value.Y, min.Y, max.Y), Math::Clamp(value.Z, min.Z, max.Z));
|
||||
}
|
||||
|
||||
// Restricts a value to be within a specified range
|
||||
// @param value The value to clamp
|
||||
|
||||
Reference in New Issue
Block a user