Regions have to be circles or rectangles, or a combination of regions. Your normal field of view is not a rectangle.
If you don't care if the region isn't exactly what the players sees, then you can use the rectangle that closest resembles the player's view.
You can convert the middle of where the player is looking into a circle, and use that instead.
Your idea would be pretty intensive CPU-wise though, as you'd have to be constantly updating the region.
There are some other complex ways that involve math, combining regions, or using camera object properties such as depth of field, pitch, yaw, etc.
I don't think there's an easier way to do it. When the game comes out with the standard tutorials, you can probably see how Blizzard determines when you've scrolled to a certain area (For the part in the tutorial that tells you to pan the camera, or look at an area).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi,
how can I determine if a unit is seen by the camera? Is there a way to get the region which is "covered" by the camera?
thank you
Regions have to be circles or rectangles, or a combination of regions. Your normal field of view is not a rectangle.
If you don't care if the region isn't exactly what the players sees, then you can use the rectangle that closest resembles the player's view.
You can convert the middle of where the player is looking into a circle, and use that instead.
Your idea would be pretty intensive CPU-wise though, as you'd have to be constantly updating the region.
There are some other complex ways that involve math, combining regions, or using camera object properties such as depth of field, pitch, yaw, etc.
I don't think there's an easier way to do it. When the game comes out with the standard tutorials, you can probably see how Blizzard determines when you've scrolled to a certain area (For the part in the tutorial that tells you to pan the camera, or look at an area).