コード例 #1
0
ファイル: OgreMath.cpp プロジェクト: Gerviba/MuOnline
 //-----------------------------------------------------------------------
 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);
 }
コード例 #2
0
 //-----------------------------------------------------------------------
 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)));
 }