







Wow, never assume!
Turns out the command is more an object in camera view command than it is object in screen; the name of the function is misleading.
They made the object in screen command subject to the current camera; therefore it is actually a function that checks if a camera can see an object; even if the camera rendering is off.
I just had a quite check to see if this code works, and it does. At least DBP has a simple solution for this.
`%Project Title%
`%Source File Name%
`======================
Make Object Cube 1, 1
Make Camera 1
Set Camera View 0, 0, Screen Width() / 2, Screen Height()
Set Camera Aspect 0, (Screen Width() / 2.0) / Screen Height()
Set Camera View 1, Screen Width() / 2, 0, Screen Width(), Screen Height()
` Set Camera To Image 1, 1, 256, 256 ` Works even when not drawing to viewport
` Sync Mask 2^0 ` And when the camera is not rendered
Set Camera Aspect 1, (Screen Width() / 2.0) / Screen Height()
Turn Camera Right 1, 180
Sync Rate 60
Do
Set Cursor 0, 0
t# = Timer() * 0.1
Position Object 1, Cos( WrapValue(t#)) * 50, 7, Sin( WrapValue(t#)) * 50
` Force current camera
If Object Position Z(1) < 0
Set Current Camera 1
Else
Set Current Camera 0
Endif
If Object In Screen(1)
Print "In Screen"
Else
Print "Outside"
Endif
Loop
Quote: "How many objects and/or vertices in total do you plan on checking?"
When making frustum event triggers ; I'll settle for object positions; no verts.
When creating portals; thousands of vertices will be checked during design time.
During the runtime I'd only be checking occlusion boxes in visible portals which will include or exclude models and entities when not seen.
Now that the object in screen command has an additional use, I can use a fake camera along with raycasts to check if dynamic things can see other things.