Vector3f playerF = Transform.getCamera().getForward();
Vector3f playerPos = Transform.getCamera().getPos();
Vector3f myObject = obj.getPos();
float angle = (float)Math.toDegrees(Math.acos(playerF.dot(myObject.sub(playerPos).normalized())));
if(Float.isNaN(angle))
{
return true;
}
return angle <= Transform.getCamera.fov / 2 + 10;
Yo,
I found this to be a very fast way of 2D frustum culling.
The question is: Is this actually a legit way of 2D frustum culling or am I just not seeing something?
Since it is way faster than normal frustum culling.
(2D in the sence of i dont use the Y it is always 0)