Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Consistency: Adding optional destination/output arguments to all applicable Vector functions #3413

@Autsider666

Description

@Autsider666

Context

I ran into a great presentation about increasing Vector math performance that advises to add output arguments to functions to prevent the creation of unneeded objects.

Proposal

EX.Vector already has some functions (scale, add, sub, rotate and clone) that have an optional dest argument, so I'm suggesting to consistently add an optional destargument to the following functions:

  • min
  • max
  • normalize
  • cross
  • perpendicular

Optional

  • Add an extra argument for the fallback anchor used in rotate
  • Use destination or output instead of the abbreviated dest currently used.
  • Update the documentation to inform developers of the potential performance gains from using this argument when using Vector. (Even more optional: Add code examples to show the differences)

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThis issue or PR has not had any activity recently

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions