Commit 4efd21d3 authored by Michele Bosi's avatar Michele Bosi

Scalar initializers for Vector2/3/4

parent acfc8b2d
......@@ -109,6 +109,17 @@ namespace vl
y() = (T_Scalar)other.y();
}
explicit Vector2(T_Scalar val)
{
mScalar[0] = mScalar[1] = val;
}
//explicit Vector2(const T_Scalar* pval)
//{
// mScalar[0] = pval[0];
// mScalar[1] = pval[1];
//}
explicit Vector2(T_Scalar x, T_Scalar y)
{
mScalar[0] = x;
......
......@@ -57,6 +57,18 @@ namespace vl
z() = (T_Scalar)other.z();
}
explicit Vector3(T_Scalar val)
{
mScalar[0] = mScalar[1] = mScalar[2] = val;
}
//explicit Vector3(const T_Scalar* pval)
//{
// mScalar[0] = pval[0];
// mScalar[1] = pval[1];
// mScalar[2] = pval[2];
//}
explicit Vector3(T_Scalar x, T_Scalar y, T_Scalar z)
{
mScalar[0] = x;
......
......@@ -58,6 +58,19 @@ namespace vl
w() = (T_Scalar)other.w();
}
explicit Vector4(T_Scalar val)
{
mScalar[0] = mScalar[1] = mScalar[2] = mScalar[3] = val;
}
//explicit Vector4(const T_Scalar* pval)
//{
// mScalar[0] = pval[0];
// mScalar[1] = pval[1];
// mScalar[2] = pval[2];
// mScalar[3] = pval[3];
//}
explicit Vector4(T_Scalar x, T_Scalar y, T_Scalar z, T_Scalar w)
{
mScalar[0] = x;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment