Hi guys,
I'm creating a simple selection-mechanism with a 'rubberband' which selects all the meshes within that rubberband.
What I have now is this:
http://www.babylonjs-playground.com/#4EPTA
For selection, I check the intersection of the generated rubberband mesh (line 122) with the existing box positions and if they intersect, the selected boxes get a green color. Like this:
function getMeshesSelectedByRubberBand() { var meshes = []; for (var index in boxes) { var box = boxes[index]; if (game.rubberBand.intersectsPoint(box.position)) { meshes.push(box); } } return meshes; }
but as you can see the wrong boxes are selected, and I don't understand why... Do anybody see anything wrong?