diff engine/core/util/structures/utilstructures.i @ 645:291ba2946c73

* Added the ability to normalize a 2D and 3D point. * You can now rotate a 2D point around the origin or a specific point. * Modified the shooter demo to use the new point functionality. * Removed the fife_math extension.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 12 Oct 2010 18:58:47 +0000
parents c0c3f64bfc2d
children
line wrap: on
line diff
--- a/engine/core/util/structures/utilstructures.i	Mon Oct 11 22:20:00 2010 +0000
+++ b/engine/core/util/structures/utilstructures.i	Tue Oct 12 18:58:47 2010 +0000
@@ -1,6 +1,6 @@
 /***************************************************************************
- *   Copyright (C) 2005-2008 by the FIFE team                              *
- *   http://www.fifengine.de                                               *
+ *   Copyright (C) 2005-2010 by the FIFE team                              *
+ *   http://www.fifengine.net                                              *
  *   This file is part of FIFE.                                            *
  *                                                                         *
  *   FIFE is free software; you can redistribute it and/or                 *
@@ -31,6 +31,7 @@
 		T x;
 		T y;
 		explicit PointType2D(T _x = 0, T _y = 0);
+		PointType2D(const PointType2D<T>& rhs);
 		PointType2D<T> operator+(const PointType2D<T>& p) const;
 		PointType2D<T> operator-(const PointType2D<T>& p) const;
 		PointType2D<T>& operator+=(const PointType2D<T>& p);
@@ -40,6 +41,9 @@
 		bool operator==(const PointType2D<T>& p) const;
 		bool operator!=(const PointType2D<T>& p) const;
 		T length() const;
+		void normalize();
+		void rotate(T angle);
+		void rotate(const PointType2D<T>& origin, T angle);
 	};
 
 	template<typename T>
@@ -60,6 +64,7 @@
 		T y;
 		T z;
 		explicit PointType3D(T _x = 0, T _y = 0, T _z = 0);
+		PointType3D(const PointType3D<T>& rhs);
 		PointType3D<T> operator+(const PointType3D<T>& p) const;
 		PointType3D<T> operator-(const PointType3D<T>& p) const;
 		PointType3D<T>& operator+=(const PointType3D<T>& p);
@@ -69,6 +74,7 @@
 		bool operator==(const PointType3D<T>& p) const;
 		bool operator!=(const PointType3D<T>& p) const;
 		T length() const;
+		void normalize();
 	};
 
 	template<typename T>