summaryrefslogtreecommitdiffstats
path: root/src/math/geometry.h
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-06-13 22:48:35 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-06-13 22:48:35 +0200
commitb735913debff93c1a6444ec731cd4bf99ae2a5c2 (patch)
treeefa532d3b4231e5ffd6df8eddcb0ec8cf5d4b28b /src/math/geometry.h
parentb5d16ef340208bbe1a76f33f7498fb168f6405b6 (diff)
downloadcolobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.tar.gz
colobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.tar.bz2
colobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.zip
FPOINT -> Math::Point & other math functions
- changed FPOINT to Math::Point and some functions from math module to the new implementation - moved old function and FPOINT struct declarations to math3d.cpp - removed some unused functions in math module - fixed some #include dependencies - moved #define STRICT and #define D3D_OVERLOADS to compile options
Diffstat (limited to 'src/math/geometry.h')
-rw-r--r--src/math/geometry.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/math/geometry.h b/src/math/geometry.h
index 580b9da..72584b0 100644
--- a/src/math/geometry.h
+++ b/src/math/geometry.h
@@ -52,25 +52,6 @@ inline float MidPoint(const Point &a, const Point &b, float px)
return (b.y-a.y) * (px-a.x) / (b.x-a.x) + a.y;
}
-//! Calculates the parameters a and b of the linear function passing through \a p1 and \a p2
-/** Returns \c false if the line is vertical.
- \param p1,p2 points
- \param a,b linear function parameters */
-inline bool LinearFunction(const Point &p1, const Point &p2, float &a, float &b)
-{
- if ( IsZero(p1.x-p2.x) )
- {
- a = HUGE;
- b = p2.x;
- return false;
- }
-
- a = (p2.y-p1.y) / (p2.x-p1.x);
- b = p2.y - p2.x*a;
-
- return true;
-}
-
//! Tests whether the point \a p is inside the triangle (\a a,\a b,\a c)
inline bool IsInsideTriangle(Point a, Point b, Point c, Point p)
{
@@ -198,7 +179,7 @@ inline Vector RotatePoint2(const Vector center, float angleH, float angleV, Vect
}
//! Returns the angle between point (x,y) and (0,0)
-float RotateAngle(float x, float y)
+inline float RotateAngle(float x, float y)
{
if ( (x == 0.0f) && (y == 0.0f) )
return 0.0f;