Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-11-26 14:12:53 +0000
committerStijn Buys <ingar@osirion.org>2010-11-26 14:12:53 +0000
commita92dc36d721806f8613a7aa531eca89162de504a (patch)
tree89d853c7f1e8ae432dbea4140ce956c8f39316af /src/math
parent5a31dc0d38408a9c9e3a7e82ad3f8cb4a3d02680 (diff)
Read .map patch definitions into model quads (without triangulation)
Diffstat (limited to 'src/math')
-rw-r--r--src/math/vector3f.h7
1 files changed, 7 insertions, 0 deletions
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__