Page MenuHomeFeedback Tracker

[Feature Request] Making vector commands work with any number of elements for either vector
Feedback, NormalPublic

Description

This would add a lot of flexibility to the vector commands.
Namely vectorAdd, vectorDiff, vectorMultiply, vectorDotProduct, vectorCrossProduct, vectorCos, etc.

Of course, the minimum number of elements should be 2 (or should it?). If one vector has a greater dimension than the other, missing elements can be padded with 0.

For example:

[0,0] vectorAdd [1,2] //[1,2]
[0,0,0,0] vectorAdd [1,2,3,4] //[1,2,3,4]
[0,0] vectorAdd [1,2,3] //[1,2,3]
[1] vectorAdd [0,2,3] //[1,2,3]
[] vectorAdd [] //[0,0]

The same concept can be applied to other commands as well (but some of them may not make sense or be useful for mathematical vectors, but that is up to the programmer to decide)

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
Scripting

Event Timeline

Leopard20 updated the task description. (Show Details)Feb 24 2021, 4:11 PM
dedmen changed the task status from New to Feedback.Mar 20 2023, 6:55 PM
dedmen added a subscriber: dedmen.

150364 next dev branch (and probably perf to check for regressions)

dedmen set Ref Ticket to AIII-55598.Mar 21 2023, 9:14 AM

Also updated

BIS_fnc_vectorDivide (multiply by 1/x) /A3/Functions_F/Animation/Math/fn_vectorDivide.sqf
BIS_fnc_vectorDiff /A3/Functions_F/Vectors/fn_vectorDiff.sqf
BIS_fnc_vectorAdd /A3/Functions_F/Vectors/fn_vectorAdd.sqf
BIS_fnc_magnitude /A3/Functions_F/Vectors/fn_magnitude.sqf
BIS_fnc_magnitudeSqr /A3/Functions_F/Vectors/fn_magnitudeSqr.sqf
BIS_fnc_dotProduct /A3/Functions_F/Vectors/fn_dotProduct.sqf
BIS_fnc_unitVector /A3/Functions_F/Vectors/fn_unitVector.sqf
BIS_fnc_vectorFromXToY /A3/Functions_F/Vectors/fn_vectorFromXToY.sqf

With this 🦀