I’m working on a 2D sidescroller sort of project where you can add and remove meshes with the mouse. At the moment, I can locate a mesh to remove with the mouse via Babylon’s scene.pointerX/scene.pointerY functionality, but calculating where in a 2D array to create a mesh based on the x/y coordinates of the mouse click on the canvas, and taking into account camera offset and angle, is proving difficult for me.
I was thinking maybe of filling empty space in my grid with dummy meshes, maybe with visibility set to false? What sort of performance hit do you think I would get from this? Is there a recommended way of handling this or a better method?
Can I use something like TransformNodes for mouse clicks?
Does this make sense, or should I post one of those playground things? Thanks.