Is there a method to know if a sprite has left the camera of the stage? or I have to do my operations? :P
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
The Camera class contains a Frustum object with the public method pointInFrustum (Vector3 point) which returns true if your sprite is within the frustum of the camera . You can also have a look at the user wiki for other culling techniques. http://code.google.com/p/libgdx-users/wiki/Culling |
||||
|
|
Just use bounding sphere check.(you can calculate radius using pythagoras ) It fast as hell and also work with rotation. It's not perfect but never cause false culling. For ad hoc optimized version Intersector have some rectangle contain rectanle methods these can work too. But you need to calculate rectangle for camera frustum your self. |
|||
|
|