From a92dc36d721806f8613a7aa531eca89162de504a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 26 Nov 2010 14:12:53 +0000 Subject: Read .map patch definitions into model quads (without triangulation) --- src/math/vector3f.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/math') diff --git a/src/math/vector3f.h b/src/math/vector3f.h index a7437aa..7cd533d 100644 --- a/src/math/vector3f.h +++ b/src/math/vector3f.h @@ -225,6 +225,13 @@ inline btVector3 to_btVector3(const math::Vector3f & v) return btVector3(v[0], v[1], v[2]); } +/// calculate the normal of a plane defined by three vertices +inline const Vector3f normal(const Vector3f & first, const Vector3f & second, const Vector3f & third) { + Vector3f r = crossproduct(second - first, third - first); + r.normalize(); + return r; +} + } // namespace math #endif // __INCLUDED_MATH_VECTOR3F_H__ -- cgit v1.2.3