BLI: fix math operation
That fixes a stupid mistake of mine that was copied a couple of times.
This commit is contained in:
parent
7b6e55b933
commit
c083398921
|
@ -120,7 +120,8 @@ struct double2 {
|
|||
|
||||
static double distance_squared(const double2 &a, const double2 &b)
|
||||
{
|
||||
return double2::dot(a, b);
|
||||
double2 diff = a - b;
|
||||
return double2::dot(diff, diff);
|
||||
}
|
||||
|
||||
struct isect_result {
|
||||
|
|
|
@ -218,7 +218,8 @@ struct double3 {
|
|||
|
||||
static double distance_squared(const double3 &a, const double3 &b)
|
||||
{
|
||||
return double3::dot(a, b);
|
||||
double3 diff = a - b;
|
||||
return double3::dot(diff, diff);
|
||||
}
|
||||
|
||||
static double3 interpolate(const double3 &a, const double3 &b, double t)
|
||||
|
|
|
@ -141,7 +141,8 @@ struct float2 {
|
|||
|
||||
static float distance_squared(const float2 &a, const float2 &b)
|
||||
{
|
||||
return float2::dot(a, b);
|
||||
float2 diff = a - b;
|
||||
return float2::dot(diff, diff);
|
||||
}
|
||||
|
||||
struct isect_result {
|
||||
|
|
|
@ -236,7 +236,8 @@ struct float3 {
|
|||
|
||||
static float distance_squared(const float3 &a, const float3 &b)
|
||||
{
|
||||
return float3::dot(a, b);
|
||||
float3 diff = a - b;
|
||||
return float3::dot(diff, diff);
|
||||
}
|
||||
|
||||
static float3 interpolate(const float3 &a, const float3 &b, float t)
|
||||
|
|
|
@ -156,7 +156,8 @@ struct mpq2 {
|
|||
|
||||
static mpq_class distance_squared(const mpq2 &a, const mpq2 &b)
|
||||
{
|
||||
return dot(a, b);
|
||||
mpq2 diff = a - b;
|
||||
return dot(diff, diff);
|
||||
}
|
||||
|
||||
struct isect_result {
|
||||
|
|
Loading…
Reference in New Issue