Hello guys,
I’m making a system to select many objects with the mouse.
For that I’m using GeometryUtility.TestPlanesAABB with custom frustum planes, generated by me from the mouse square drew with the mouse.
It’s working perfectly for my project, but sometimes I get about 8 !isNormalized error.
That happens when I try to make a small square.
btw, I’m testing in the editor, I’m not sure this will bug out in a compiled version too.
Anyways, I don’t want my project to bug in editor.
This is the square I’m drawing in the screen: (left:566.50, top:65.00, width:16.00, height:-1.00)
Very true. I was suspecting the an error would come from a plane like that, but the point is I’m creating these planes using Plane.Set3Points and using these points:
in this case, multiSelectionRect is (left:566.50, top:65.00, width:16.00, height:-1.00)
How can Unity generate a plane thats not an valid Unity plane?
And how come this happens only with small values of multiSelectionRect.width, multiSelectionRect.height?
if the other planes are alright, I would just hardcode the first plane (if I understand correctly, it is determined by the camera position and its forward vector) and is not affected by the rectangle you draw.
Yep, I’m using this approach. But the planes are not generated by the camera, as I want the area select via mouse.
So in this case, I had to create my own frustum planes.