Performance improvements on the enemy model

We now want to work a bit on performance. Though there's quite a lot of performance work we can do for our game, there's one big improvement we can do with the enemy model, and another small improvement that can be useful for bigger games, frustum culling.

Fire up EntityFactory: public class EntityFactory { private static Model playerModel, enemyModel; private static Texture playerTexture; private static ModelBuilder modelBuilder; private static ModelData enemyModelData; private static ModelComponent enemyModelComponent; ... public static Entity createEnemy(BulletSystem bulletSystem, float x, float y, float z) { Entity entity = new Entity(); ModelLoader<?> modelLoader = new G3dModelLoader(new JsonReader()); ...

Get Building a 3D Game with LibGDX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.