I think this would be very useful in many missions, having a objectInFOV command which returns boolean if object is in the field of view of the player or not.
Description
Details
- Legacy ID
- 2819016125
- Severity
- None
- Resolution
- Open
- Reproducibility
- N/A
- Category
- Scripting
This command would of course only work local.
Example use:
objectInFOV _obj;
Return:
Boolean
Event Timeline
You can already translate world coordinates to screen coordinates, object not in fov wont be on your screen.
I know it's possible, but it's not convenient at all to do it like that. A simple command likeobjectInFOV would be less code, and probably faster too.
Adding to this, I did some more testing with worldToScreen, and it seems quite inaccurate. It still gives back a position even though the object is not visible anymore on screen.
It seems like you need the screen to be at least [x] degrees away from the object before it gives back an empty position.
I'll create a new issue for this though.
- EDIT
Seems to be because of safezones. So this new command would still be useful to actually check if an object is in view or not.
If such command is created it should return value from 0 to 1 instead of boolean. 1 is when the object is in the centre of screen and 0 is when it is beyond FOV (i.e. the edge of bounding box is not on the screen)