- Home /
How to identify list of Objects in Camera view
Hi,
I am using GeometryUtility.CalculateFrustumPlanes and GeometryUtility.TestPlanesAABB
to see if an object is seen by my camera or not. I also use Physics.Raycast to make sure that nothing is covering the object.
However, I want to know what are the game objects that can be 'seen' from the camera without telling the camera what object it could be seeing.
In other words, when I use TestPlanesAABB I do NOT want to test against a specific game object. I want it to be unknown and then when the camera 'sees' some object, I need to know what is this object.
Any help?!
Hi,
Have you found any solution of how will you have a list of objects that the camera can see? I would like to do the same.
Thanks!
Hi, I was able to implement visual perception by making a Ray-cast from the camera to the objects. I implemented a base class (super class like: "Thing") and inherited from it sub-classes (subclass like "Animal", and "Human"). In the ray-cast, I check if the HIT gameobject has a component of the class "Thing", I store it in the memory, and in the memory, I make a new list for each type of "Thing", using "is" operator, to have a list of Humans, Animals and so forth.
Answer by robertbu · Aug 26, 2013 at 03:08 PM
One way or another, you have to check a list of objects. You can distribute that check so that objects check themselves rather than a central check. If you only have one camera there are a number of things you can do to simplify your code. For example, you can use Renderer.OnBecameVisible() and Renderer.OnBecomeInvisible() in each game object.
Your answer
Follow this Question
Related Questions
Advanced Targetting 1 Answer
Camera look at problem 1 Answer
[Closed] How could I create a first-person controller from scratch? 2 Answers
Camera orbit and object following 1 Answer