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-28 17:36:07 +0000
committerStijn Buys <ingar@osirion.org>2010-11-28 17:36:07 +0000
commit4d1b23606ed58737db9ea4423f1ad0f3d1db2782 (patch)
treefb7aed7ce86df8d934908c1ab7210c11a2a986e2 /src/math
parentd22085f13895ab5f3cc479c3249ebeea32f53ed7 (diff)
Improved patch mesh surface normals.
Diffstat (limited to 'src/math')
-rw-r--r--src/math/functions.h9
-rw-r--r--src/math/vector3f.h4
2 files changed, 2 insertions, 11 deletions
diff --git a/src/math/functions.h b/src/math/functions.h
index 27a068e..8135392 100644
--- a/src/math/functions.h
+++ b/src/math/functions.h
@@ -107,15 +107,6 @@ inline void swap(float &x, float &y)
y = tmp;
}
-/// float to the n-th power
-inline float pow(const float x, const size_t pow) {
- float r = 1;
- for (size_t i = 1; i <= pow; i++) {
- r *= x;
- }
- return r;
-}
-
} // namespace math
#endif // __INCLUDED_MATH_FUNCTIONS_H__
diff --git a/src/math/vector3f.h b/src/math/vector3f.h
index 7cd533d..6ab77be 100644
--- a/src/math/vector3f.h
+++ b/src/math/vector3f.h
@@ -226,8 +226,8 @@ inline btVector3 to_btVector3(const math::Vector3f & v)
}
/// 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);
+inline const Vector3f normal(const Vector3f & center, const Vector3f & u, const Vector3f & v) {
+ Vector3f r = crossproduct(u - center, v - center);
r.normalize();
return r;
}