Unload a collection doesn't disable its camera component (SOLVED)


#1

Hi, I have a collection with a camera component inside.
When I unload this collection via collection proxy and send the
msg.post(“camera”, release_camera_focus)
I would expect that all the camera effects on the display of the now activated collection disappear.
Instead the new activated collection has the display not centered, as it was in the previous collection just unloaded.
How can I remove all the effects of the camera in other different collections?
Marco


#2

What do you mean with camera “effects”?


#3

I mean that the display of the new collection is not centered in the original screen coordinates (x from 0 to 640, y from 0 to 960) but it’s shifted (for example x from 400 to 1040, y from 1000 to 1960): it seems that the previous screen shift operated by the camera doesn’t cease when the camera is released nor when the collection in which the camera operated is unloaded.
Is it normal? If yes, how can I set the screen coordinates of the other collections in the original (untranslated) way?


#4

What the camera component does is to send projection and view updates to the render script. The default render script will discard the projection but use the view it receives from the camera. When you remove camera focus it will stop sending these updates and the render script will use the most recent view and projection. You can either manually send a set_view_projection message with a view equal to vmath.matrix4() or enable another camera (that is in a default state and position).


#5

Thanks, I’ve understood, now it works.