Hello Babylon team,
to improve performance I am trying to avoid creating new Vectors as much as possible.
I have this use case where I want to draw on a plane and I call getTextureCoordinates
on every tick to check where to draw.
This method returns a new Vector2
every time I call the method. And as I looked closer into the method I noticed that it is actually creating 4 new Vector2
on every call.
Do you think it makes sense to improve the method by reusing the Vectors inside the method (e.g. by using a closure).
And do you think it would be a good approach to let users pass a target vector to the method, which gets altered by the method rather than returning a new Vector2
on every call.
Thank you!