use of gaiasky.util.gdx.IntModelBatch in project gaiasky by langurmonkey.
the class SpacecraftGui method initialize.
public void initialize(AssetManager assetManager, SpriteBatch sb) {
this.sb = sb;
// User interface
ScreenViewport vp = new ScreenViewport();
vp.setUnitsPerPixel(unitsPerPixel);
ui = new Stage(vp, sb);
indicatorw = 480f;
indicatorh = 480f;
indicatorx = -32f;
indicatory = -20f;
// init gui camera
aiCam = new PerspectiveCamera(30, indicatorw * Settings.settings.program.ui.scale, indicatorh * Settings.settings.program.ui.scale);
aiCam.near = (float) (1e5 * Constants.KM_TO_U);
aiCam.far = (float) (1e8 * Constants.KM_TO_U);
aiCam.up.set(0, 1, 0);
aiCam.direction.set(0, 0, 1);
aiCam.position.set(0, 0, 0);
// Init AI
dlight = new DirectionalLight();
dlight.color.set(1f, 1f, 1f, 1f);
dlight.setDirection(-1f, .05f, .5f);
env = new Environment();
env.set(new ColorAttribute(ColorAttribute.AmbientLight, 1f, 1f, 1f, 1f), new ColorAttribute(ColorAttribute.Specular, .5f, .5f, .5f, 1f));
env.add(dlight);
db = new DecalBatch(4, new CameraGroupStrategy(aiCam));
mb = new IntModelBatch();
assetManager.load(Settings.settings.data.dataFile("tex/base/attitudeindicator.png"), Texture.class);
assetManager.load("img/ai-pointer.png", Texture.class);
assetManager.load("img/ai-vel.png", Texture.class);
assetManager.load("img/ai-antivel.png", Texture.class);
EventManager.instance.subscribe(this, gaiasky.event.Event.SPACECRAFT_LOADED);
}
Aggregations