IO is an event based input manager which permit to select which composents are manged on your system
Dependencies: C12832 FXOS8700Q LM75B MMA7660
Diff: Vector.cpp
- Revision:
- 3:1ab88130bb9d
- Parent:
- 0:2ac59c564ab0
diff -r c871dc21467b -r 1ab88130bb9d Vector.cpp --- a/Vector.cpp Tue Feb 23 18:56:50 2016 +0000 +++ b/Vector.cpp Thu Feb 25 14:28:48 2016 +0000 @@ -1,9 +1,19 @@ -#include "Vector.hpp" +#include "Vector.h" #include <float.h> -template <> -bool Vector<float>::operator==(const Vector &other) const { return (other.x - x < FLT_MIN && other.y - y < FLT_MIN && other.z - z < FLT_MIN); } - -template <> -bool Vector<float>::eq(const Vector &other, float prec) const { return (other.x - x < prec && other.y - y < prec && other.z - z < prec); } \ No newline at end of file +Vector::Vector(void) : x(0), y(0), z(0) {} +Vector::Vector(float X, float Y, float Z) : x(X), y(Y), z(Z) {} +Vector::Vector(const Vector ©) { *this = copy; } + +Vector &Vector::operator=(const Vector ©) +{ + x = copy.x; + y = copy.y; + z = copy.z; + return (*this); +} + +bool Vector::operator!=(const Vector &other) const { return (!(*this == other)); } +bool Vector::operator==(const Vector &other) const { return (other.x - x < FLT_MIN && other.y - y < FLT_MIN && other.z - z < FLT_MIN); } +bool Vector::eq(const Vector &other, float prec) const { return (other.x - x < prec && other.y - y < prec && other.z - z < prec); } \ No newline at end of file