Skip to content

[Suggestions] Add immutable methods to ScriptVector3f class #44

@MaratMadiev

Description

@MaratMadiev

Suggestion Type

Others

Suggestion

  • Current vector implementation is kind of inconvenient.

For example you have vectors A, B
To calculate 4*A + 3*B.rotateY(90*) you have to write something like

A.mul(4);
B.rotateY(90*)
B.mul(3);
A.add(B);
let result = A.copy()

Current methods return void so it's impossible to make method chaining
And vectors A and B will change so you won't be able to reuse it below without making copies first

  • We can add dublicates of the methods which return a new object instead of changing the existing one
    This will allow vectors to be reused and the example above will be reduced to
let result = A.mul(4).add(B.rotateY(90*).mul(3))

Assets

No response

Implementation Details/References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionsAddition/Modification/Improvements for the mod

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions