- What is the FOV (field of view) of the object? (which in my application MAY be 360 degrees spherical, or not: we're in space)
- What objects may be blocking line of sight?
At this point, I am not interested in drawing these objects: I'll handle that later, though it may well be that the solutions here will inform my choice of drawing engine (Mac OS, iOS, Objective-C being my targets). What I am interested in is just the game logic side of things. Pretend for a moment that there is no user interface: we're just letting a computer crunch through the 3D world.
It appears that (as one other poster put it) my problem is one of occlusion. I've researched Occlusion Querying in OpenGL and it seems very promising. All the examples, however, seem to point to "how to use this information to draw more efficiently." What I am asking is "how might it be used to inform game LOGIC?"
For example, take 5 spaceships in our solar system. All arrayed in random places. When it's each object's turn to decide "what do I do," I need to know who they can see. If there's a planet in the way, call that a "major occluder" and it will definitely hide things behind it. If it's another ship, that too could be a major occluder if it were big enough (so say we have a simple isMajorOccluder property). Smaller ships, asteriods, debris, etc. for the sake of argument would all "not count" as occluders.
What I'm trying to arrive at is, for each of the 5 ships, a simple list of what they can see.
Am I over-thinking this? Or is building the universe in OpenGL and using occlusion queries the right approach? Could someone pseudo-code how this might work?
Thanks for any advice,
-Doug