
Code: Select all
B
--------/
---/
TTT/
TG A
TTT\
TTT ---\
-------\
B
The T's are the turret (from the side), and G is the gun inside it. the lines dictate the field of view of the gun, it can see anything inside A but not what's in B.
What I want to do is to determine which entities the gun can see and target. Now, I can probably attach an Ogre Frustum to each turret, and just call Frustum::isVisible(someEntity) for each entity to find out which one would make a good target.
I could probably also write a method of my own for determining which entities are visible or not from the gun's point of view. It will be written in Python since we're using PyOgre (which by the way kicks ass

So what I'm asking is: which method would you recommend? Obviously, it will probably be easier to just use the Frustum, but is there any performance to be gained? Worst case scenario is something like 15-20 turrets, and 75-150 enemy entities.