diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-05 19:04:56 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-05 19:04:56 +0000 |
commit | a8c367416c28edb47c8f8c447b515cca4080adc2 (patch) | |
tree | e2ec21d060bff81361e39a784732813d1ad4585d /src/math/vector3f.cc | |
parent | da9beb729c58ca2d91f67ab85a6728b628c27cf2 (diff) |
adds vector2f to the math library
Diffstat (limited to 'src/math/vector3f.cc')
-rw-r--r-- | src/math/vector3f.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/math/vector3f.cc b/src/math/vector3f.cc index 3d816f6..bf2cb8d 100644 --- a/src/math/vector3f.cc +++ b/src/math/vector3f.cc @@ -4,11 +4,10 @@ the terms of the GNU General Public License version 2 */ -// project headers -#include "math/vector3f.h" - -// C++ headers #include <cmath> +#include <cstring> + +#include "math/vector3f.h" namespace math { @@ -37,8 +36,11 @@ Vector3f::~Vector3f() void Vector3f::clear() { + /* for (size_t i =0; i < 3; i++) coord[i] = 0; + */ + memset(coord, 0, sizeof(coord)); } void Vector3f::assign(const float vx, const float vy, const float vz) @@ -50,8 +52,11 @@ void Vector3f::assign(const float vx, const float vy, const float vz) void Vector3f::assign(Vector3f const & other) { + /* for (size_t i =0; i < 3; i++) coord[i] = other.coord[i]; + */ + memcpy(coord, other.coord, sizeof(coord)); } Vector3f & Vector3f::operator=(const Vector3f & other) |