//----------------------------------------------------------------------- std::pair<bool, Real> Math::intersects(const Ray& ray, const Vector3& a, const Vector3& b, const Vector3& c, bool positiveSide, bool negativeSide) { Vector3 normal = calculateBasicFaceNormalWithoutNormalize(a, b, c); return intersects(ray, a, b, c, normal, positiveSide, negativeSide); }
//----------------------------------------------------------------------- Vector4 Math::calculateFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3) { Vector3 normal = calculateBasicFaceNormalWithoutNormalize(v1, v2, v3); // Now set up the w (distance of tri from origin) return Vector4(normal.x, normal.y, normal.z, -(normal.dotProduct(v1))); }