The TouchEvent is created every time the mouse moves (on a system with a cursor). Maybe it would be good if the TouchEvent is reused to avoid the creation of objects. I tried that by adding a private property in the TouchProcessor and created a TouchEvent in the constructor. I had to set the shiftKey and ctrlKey every time (to do this I removed the getter of them in the TouchEvent and converted the property to a public variable which is much faster anyways). Also I had to reset the _visitedObjects every time.
In the end it all worked :)
Is there a reason to create a new TouchEvent? Am I missing something?
There's no specific reason they are not pooled, no — at least I can't think of any.
You're right, this would be a nice area for an optimization. I'll look into it!
The TouchEvent is created every time the mouse moves (on a system with a cursor). Maybe it would be good if the TouchEvent is reused to avoid the creation of objects. I tried that by adding a private property in the TouchProcessor and created a TouchEvent in the constructor. I had to set the shiftKey and ctrlKey every time (to do this I removed the getter of them in the TouchEvent and converted the property to a public variable which is much faster anyways). Also I had to reset the _visitedObjects every time. In the end it all worked :) Is there a reason to create a new TouchEvent? Am I missing something?