[DEBUG] for basic test, i need to initialize vector

This commit is contained in:
Edouard DUPIN 2013-01-28 08:09:16 +01:00
parent 0c035b17f9
commit 73efdadd16
2 changed files with 17 additions and 6 deletions

View File

@ -24,11 +24,19 @@ namespace etk
/***************************************************** /*****************************************************
* Constructor * Constructor
*****************************************************/ *****************************************************/
Vector2D(void) { }; // do nothing ==> better for optimisation Vector2D(void)
Vector2D(T _x, T _y) { m_floats[0] = _x; m_floats[1] = _y; }; {
Vector2D(const Vector2D<double>& obj) { m_floats[0] = (T)obj.x(); m_floats[1] = (T)obj.y(); }; m_floats[0]=0;
Vector2D(const Vector2D<float>& obj) { m_floats[0] = (T)obj.x(); m_floats[1] = (T)obj.y(); }; m_floats[1]=0;
Vector2D(const Vector2D<int32_t>& obj) { m_floats[0] = (T)obj.x(); m_floats[1] = (T)obj.y(); }; }; // do nothing ==> better for optimisation
Vector2D(T _x, T _y)
{
m_floats[0] = _x;
m_floats[1] = _y;
};
Vector2D(const Vector2D<double>& obj) { m_floats[0] = (T)obj.x(); m_floats[1] = (T)obj.y(); };
Vector2D(const Vector2D<float>& obj) { m_floats[0] = (T)obj.x(); m_floats[1] = (T)obj.y(); };
Vector2D(const Vector2D<int32_t>& obj) { m_floats[0] = (T)obj.x(); m_floats[1] = (T)obj.y(); };
~Vector2D(void) { }; ~Vector2D(void) { };
/***************************************************** /*****************************************************
* = assigment * = assigment

View File

@ -29,7 +29,10 @@ namespace etk
*/ */
Vector3D(void) Vector3D(void)
{ {
m_floats[0]=0;
m_floats[1]=0;
m_floats[2]=0;
m_floats[3]=0;
} }
/** /**
* @brief Constructor from scalars * @brief Constructor from scalars