1 arg constructors for VectorXf classes

I’d like to see 1 arg constructors for the vector classes.

[java]
Vector3f tmp = new Vector3f(4);
[/java]

All vector elements should be initialized to the same value.

On the one hand, I don’t have a strong objection to the idea other than clutter.

…but I have to wonder how often this really comes up. I, for one, have never had a use-case for it and I’m trying to imagine a case where I would.

1 Like
@pspeed said: On the one hand, I don't have a strong objection to the idea other than clutter.

…but I have to wonder how often this really comes up. I, for one, have never had a use-case for it and I’m trying to imagine a case where I would.

Personally, I’d like to see this in Vector2f, 3f & 4f… I’d use it all the time.

@t0neg0d said: Personally, I'd like to see this in Vector2f, 3f & 4f... I'd use it all the time.

As I said, I don’t have strong objections but I’m trying to understand how other people use it. Other than 0 or 1, I can’t think what I’d ever pass to this constructor… and 0 is already covered and 1 there is a constant for.

@pspeed said: As I said, I don't have strong objections but I'm trying to understand how other people use it. Other than 0 or 1, I can't think what I'd ever pass to this constructor... and 0 is already covered and 1 there is a constant for.

In the case of Vector2f, I’d make use of it with a particle emitter or ui element.
In the case of Vector4f, I’d make use of it with ui elements.

Either way, isn’t a really big deal… just “nice to have”.