diff --git a/src/main/java/io/github/hydos/ginger/Example.java b/src/main/java/io/github/hydos/ginger/Example.java index 826222e..250a0a3 100644 --- a/src/main/java/io/github/hydos/ginger/Example.java +++ b/src/main/java/io/github/hydos/ginger/Example.java @@ -56,7 +56,10 @@ public class Example { TexturedModel tModel = ModelLoader.loadModel("stall.obj", "stallTexture.png"); tModel.getTexture().setReflectivity(1f); tModel.getTexture().setShineDamper(7f); - Player entity = new Player(tModel, new Vector3f(0,0,-3),0,180f,0, new Vector3f(0.2f, 0.2f, 0.2f), 5000); + Player entity = new Player(tModel, new Vector3f(0,0,-3),0,180f,0, new Vector3f(0.2f, 0.2f, 0.2f)); + entity.setSpeeds(0.00001f, 0.0003f); + entity.setGravity(-0.0000000001f); + entity.setJumpPower(0.00005f); ThirdPersonCamera camera = new ThirdPersonCamera(new Vector3f(0,0.1f,0), entity); masterRenderer = new MasterRenderer(camera); @@ -128,7 +131,7 @@ public class Example { ParticleTexture particleTexture = new ParticleTexture(Loader.loadTexture("particles/smoke.png"), 8); - ParticleSystem system = new ParticleSystem(particleTexture, 100, 5f, 0.3f, 4, 4f); + ParticleSystem system = new ParticleSystem(particleTexture, 100, 10f, 0.3f, 4, 3f); system.randomizeRotation(); system.setDirection(new Vector3f(0,0.001f,0), 0.00001f); system.setLifeError(0); diff --git a/src/main/java/io/github/hydos/ginger/engine/elements/Player.java b/src/main/java/io/github/hydos/ginger/engine/elements/Player.java index 41c5fd8..07d7533 100644 --- a/src/main/java/io/github/hydos/ginger/engine/elements/Player.java +++ b/src/main/java/io/github/hydos/ginger/engine/elements/Player.java @@ -16,7 +16,6 @@ public class Player extends Entity{ private static float terrainHeight = 0; - private double timeModifier = 1; private float currentSpeed = 0; private float currentTurn = 0; @@ -24,9 +23,8 @@ public class Player extends Entity{ private boolean isInAir = false; - public Player(TexturedModel model, Vector3f position, float rotX, float rotY, float rotZ, Vector3f scale, double timeScale) { + public Player(TexturedModel model, Vector3f position, float rotX, float rotY, float rotZ, Vector3f scale) { super(model, position, rotX, rotY, rotZ, scale); - this.timeModifier = timeScale; } public void setSpeeds(float runSpeed, float turnSpeed) { @@ -37,17 +35,21 @@ public class Player extends Entity{ public void setJumpPower(float power) { JUMP_POWER = power; } + + public void setGravity(float gravity) { + GRAVITY = gravity; + } public void move(Terrain t) { checkInputs(); - super.increaseRotation(0, (float) ((currentTurn) * Window.getTime() / timeModifier), 0); - float distance = (float) ((currentSpeed) * (Window.getTime() / (timeModifier * 2.5))); + super.increaseRotation(0, (float) ((currentTurn) * Window.getTime() ), 0); + float distance = (float) ((currentSpeed) * (Window.getTime())); float dx = (float) (distance * Math.sin(Math.toRadians(super.getRotY()))); float dz = (float) (distance * Math.cos(Math.toRadians(super.getRotY()))); super.increasePosition(dx, 0, dz); - super.increasePosition(0, (float) (upwardsSpeed * (Window.getTime() / (timeModifier * 2))), 0); + super.increasePosition(0, (float) (upwardsSpeed * (Window.getTime())), 0); terrainHeight = t.getHeightOfTerrain(super.getPosition().x, super.getPosition().z); - upwardsSpeed += GRAVITY * Window.getTime() / (timeModifier * 2); + upwardsSpeed += GRAVITY * Window.getTime(); if(super.getPosition().y < terrainHeight) { isInAir = false; upwardsSpeed = 0; diff --git a/src/main/java/io/github/hydos/ginger/engine/particle/Particle.java b/src/main/java/io/github/hydos/ginger/engine/particle/Particle.java index b1cc26a..45e643e 100644 --- a/src/main/java/io/github/hydos/ginger/engine/particle/Particle.java +++ b/src/main/java/io/github/hydos/ginger/engine/particle/Particle.java @@ -71,7 +71,7 @@ public class Particle { } public boolean update(ThirdPersonCamera camera) { - float time = (float) Window.getTime() / 100000000; + float time = (float) Window.getTime() / 1000000; velocity.y += Player.GRAVITY * gravityEffect * time; Vector3f change = new Vector3f(velocity); change.scale((float) time); diff --git a/src/main/java/io/github/hydos/ginger/engine/particle/ParticleSystem.java b/src/main/java/io/github/hydos/ginger/engine/particle/ParticleSystem.java index 73ff908..3bf484d 100644 --- a/src/main/java/io/github/hydos/ginger/engine/particle/ParticleSystem.java +++ b/src/main/java/io/github/hydos/ginger/engine/particle/ParticleSystem.java @@ -21,7 +21,7 @@ public class ParticleSystem { private Random random = new Random(); public ParticleSystem(ParticleTexture texture, float pps, float speed, float gravityComplient, float lifeLength, float scale) { - this.pps = pps; + this.pps = pps / 100000; this.averageSpeed = speed; this.gravityComplient = gravityComplient; this.averageLifeLength = lifeLength; @@ -67,7 +67,7 @@ public class ParticleSystem { } public void generateParticles(Vector3f systemCenter) { - float delta = (float) Window.getTime() / 50000000; + float delta = (float) Window.getTime(); float particlesToCreate = pps * delta; int count = (int) Math.floor(particlesToCreate); float partialParticle = particlesToCreate % 1; diff --git a/target/classes/io/github/hydos/ginger/Example.class b/target/classes/io/github/hydos/ginger/Example.class index 70372f1..8855c2c 100644 Binary files a/target/classes/io/github/hydos/ginger/Example.class and b/target/classes/io/github/hydos/ginger/Example.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/Player.class b/target/classes/io/github/hydos/ginger/engine/elements/Player.class index 1cd9148..4708bf2 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/Player.class and b/target/classes/io/github/hydos/ginger/engine/elements/Player.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera$1.class b/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera$1.class index 0d703f6..73fd314 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera$1.class and b/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera$1.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera.class b/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera.class index 54536e7..ca79158 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera.class and b/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/particle/Particle.class b/target/classes/io/github/hydos/ginger/engine/particle/Particle.class index d303975..3ad9a62 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/particle/Particle.class and b/target/classes/io/github/hydos/ginger/engine/particle/Particle.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/particle/ParticleSystem.class b/target/classes/io/github/hydos/ginger/engine/particle/ParticleSystem.class index 71cf27c..8379d27 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/particle/ParticleSystem.class and b/target/classes/io/github/hydos/ginger/engine/particle/ParticleSystem.class differ diff --git a/target/ginger-NIGHTLY.jar b/target/ginger-NIGHTLY.jar deleted file mode 100644 index 0affcd2..0000000 Binary files a/target/ginger-NIGHTLY.jar and /dev/null differ