|
@@ -8,7 +8,6 @@ import com.badlogic.gdx.graphics.GL20;
|
|
import com.badlogic.gdx.graphics.PerspectiveCamera;
|
|
import com.badlogic.gdx.graphics.PerspectiveCamera;
|
|
import com.badlogic.gdx.graphics.g3d.*;
|
|
import com.badlogic.gdx.graphics.g3d.*;
|
|
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
|
|
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
|
|
-import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader;
|
|
|
|
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
|
|
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
|
|
import com.badlogic.gdx.math.Vector3;
|
|
import com.badlogic.gdx.math.Vector3;
|
|
import com.badlogic.gdx.physics.bullet.Bullet;
|
|
import com.badlogic.gdx.physics.bullet.Bullet;
|
|
@@ -20,7 +19,7 @@ import xyz.tbvns.Inputs.Shortcut;
|
|
import xyz.tbvns.Inputs.inputManager;
|
|
import xyz.tbvns.Inputs.inputManager;
|
|
import xyz.tbvns.LWJGL3.CustomViewport;
|
|
import xyz.tbvns.LWJGL3.CustomViewport;
|
|
import xyz.tbvns.Managers.TexturesManager;
|
|
import xyz.tbvns.Managers.TexturesManager;
|
|
-import xyz.tbvns.Models.GDModel;
|
|
|
|
|
|
+import xyz.tbvns.Models.GDInstance;
|
|
import xyz.tbvns.Models.Shaders;
|
|
import xyz.tbvns.Models.Shaders;
|
|
import xyz.tbvns.Physics.BulletManager;
|
|
import xyz.tbvns.Physics.BulletManager;
|
|
import xyz.tbvns.ui.UIManager;
|
|
import xyz.tbvns.ui.UIManager;
|
|
@@ -108,12 +107,26 @@ public class Main extends ApplicationAdapter {
|
|
}
|
|
}
|
|
batch.render(worldGridInstance);
|
|
batch.render(worldGridInstance);
|
|
batch.render(levelGridInstance);
|
|
batch.render(levelGridInstance);
|
|
|
|
+// for (ModelInstance model : ModelsManager.getLoadedModels()) {
|
|
|
|
+// GDInstance instance = (GDInstance) model.userData;
|
|
|
|
+// if (instance.isAnimation()) {
|
|
|
|
+// instance.updateFrame(Utils.getCameraPercent());
|
|
|
|
+// model = instance.getInstance();
|
|
|
|
+// }
|
|
|
|
+// if (ModelsManager.getSelectedModelInstance() == model) {
|
|
|
|
+// Shaders.renderOutline(instance.getInstance());
|
|
|
|
+// }
|
|
|
|
+// }
|
|
for (ModelInstance model : ModelsManager.getLoadedModels()) {
|
|
for (ModelInstance model : ModelsManager.getLoadedModels()) {
|
|
- if (ModelsManager.getSelectedModelInstance() == model) {
|
|
|
|
- Shaders.renderOutline(model);
|
|
|
|
|
|
+ GDInstance instance = (GDInstance) model.userData;
|
|
|
|
+ if (instance.isAnimation()) {
|
|
|
|
+ instance.updateFrame(Utils.getCameraPercent());
|
|
|
|
+ ModelsManager.getLoadedModels().set(ModelsManager.getLoadedModels().indexOf(model), instance.getInstance());
|
|
}
|
|
}
|
|
- }
|
|
|
|
- for (ModelInstance model : ModelsManager.getLoadedModels()) {
|
|
|
|
|
|
+ if (ModelsManager.getSelectedInstance() == model.userData) {
|
|
|
|
+ Shaders.renderOutline(instance.getInstance());
|
|
|
|
+ }
|
|
|
|
+ model = instance.getInstance();
|
|
batch.render(model);
|
|
batch.render(model);
|
|
}
|
|
}
|
|
batch.end();
|
|
batch.end();
|