View Issue Details

IDProjectCategoryView StatusLast Update
0009893New Feature Requests[All Projects] Generalpublic2018-07-21 21:56
ReporterPirulaxAssigned Toqaisjp 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionwon't fix 
Summary0009893: Add ability to sub/multiply/add/devide/compare different type of vectors.
Description

Every time I use vectors I just hit the problem, that I can't sub/multiply/add/devide/compare vectors of different type.
So, it would be useful to add the mentioned features, because creating a new Vector2 to sub it from another vector2 is dumb, isn't it?
It would be just easier to do like Vector2 - Vector3 and the result would be a Vector3.

TagsNo tags attached.

Activities

qaisjp

2018-07-04 13:33

administrator   ~~0026603

What would you expect (1,2) - (10, 11, 12) to return?

Bonus1702

2018-07-04 13:40

reporter   ~~0026604

I think always the last ones, which are too much, have to be ignored.
(1, 2) - (10, 11, 12) = (-9, -9)
(1, 2) - (10, 11, 12, 13) = (-9, -9)

Pirulax

2018-07-04 14:41

reporter   ~~0026605

@qaisjp
1-10 and 2-11, so Vector3(-9, -9, 12)

Pirulax

2018-07-04 14:42

reporter   ~~0026606

Or actually, its a good question.
If you sub a vector3 from a vector2 as you wrote, it should return a vector2, but if you sub a vector2 from a vector3 it should return vector3.
I think.

Bonus1702

2018-07-04 14:43

reporter   ~~0026607

Ye that would be good.

Pirulax

2018-07-04 14:44

reporter   ~~0026608

And maybe add a feature like .setXYZ, and .getXYZ, i tried to implement it once, but i reverted it(I added some other stuff too, and i was unable to get it working)

qaisjp

2018-07-04 17:34

administrator   ~~0026609

vec.x = 5; etc should work

Pirulax

2018-07-10 11:49

reporter   ~~0026680

It should be like this:
.toVector3() or toVector2(), or toVector4, whatever, you got it.

Jusonex

2018-07-21 21:25

administrator   ~~0026779

Last edited: 2018-07-21 21:25

View 2 revisions

Honestly, I think the behavior of such an operation is not well-defined and finally more confusing than helpful.

LosFaul

2018-07-21 21:45

viewer   ~~0026780

Last edited: 2018-07-21 21:54

View 2 revisions

"(1, 2) - (10, 11, 12) = (-9, -9)
(1, 2) - (10, 11, 12, 13) = (-9, -9)"

"1-10 and 2-11, so Vector3(-9, -9, 12)"

This is mathematical non-sense and would be against the definitions of vectors.

better use vec.x, vec.y, vec.z, vec.w
v3.x, v3.y = v3.x + v2.x, v3.y + v2.y

Issue History

Date Modified Username Field Change