Home Game Development java – What is transferring the digicam helpful for, if I’ve to do culling myself?

java – What is transferring the digicam helpful for, if I’ve to do culling myself?

0
java – What is transferring the digicam helpful for, if I’ve to do culling myself?

[ad_1]

Seems like to your use case , it is best to undoubtedly use a digicam. Not solely will it prevent the difficulty of writing it your self. The libgdx digicam projection matrix is handed to the sprite batch and this “strikes” your view.

Just render your map and participant: transfer the participant round and have the digicam comply with the participant. Then when you’re rendering easy name batch.setProjectionMatrix(yourcams_projection_matrix) earlier than you name batch.start().

Also dont overlook that while you use a viewport it is best to replace it at any time when your recreation is rezied through the resize perform supplied within the Application interface/Adapter.

A final notice: while you change your cameras place it’s essential to name cam.replace() to ensure that the modifications to take impact.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here