|
@@ -671,9 +671,9 @@ func (v *Vector3) RandomTangents() (*Vector3, *Vector3) {
|
|
|
// AlmostEquals returns whether the vector is almost equal to another vector within the specified tolerance.
|
|
// AlmostEquals returns whether the vector is almost equal to another vector within the specified tolerance.
|
|
|
func (v *Vector3) AlmostEquals(other *Vector3, tolerance float32) bool {
|
|
func (v *Vector3) AlmostEquals(other *Vector3, tolerance float32) bool {
|
|
|
|
|
|
|
|
- if (v.X - other.X < tolerance) &&
|
|
|
|
|
- (v.Y - other.Y < tolerance) &&
|
|
|
|
|
- (v.Z - other.Z < tolerance) {
|
|
|
|
|
|
|
+ if (Abs(v.X - other.X) < tolerance) &&
|
|
|
|
|
+ (Abs(v.Y - other.Y) < tolerance) &&
|
|
|
|
|
+ (Abs(v.Z - other.Z) < tolerance) {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
return false
|
|
return false
|