diff --git a/assets/Data/creatures.json b/assets/Data/creatures.json index 761e6894..57c57e18 100644 --- a/assets/Data/creatures.json +++ b/assets/Data/creatures.json @@ -94,9 +94,9 @@ ], "physicsObject" : { "type" : "CYLINDER", - "dimension1" : 0.2, + "dimension1" : 0.1, "dimension2" : 0.45, - "dimension3" : 0.2, + "dimension3" : 0.1, "offsetX" : 0, "offsetY" : 0.45, "offsetZ" : 0 @@ -212,11 +212,11 @@ ], "physicsObject" : { "type" : "CYLINDER", - "dimension1" : 0.2, - "dimension2" : 0.2, - "dimension3" : 0.2, + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.1, "offsetX" : 0, - "offsetY" : -0.2, + "offsetY" : 0.1, "offsetZ" : 0 }, "attackMoves" : [ diff --git a/src/main/java/electrosphere/engine/LoadingThread.java b/src/main/java/electrosphere/engine/LoadingThread.java index 7428b305..202d3112 100644 --- a/src/main/java/electrosphere/engine/LoadingThread.java +++ b/src/main/java/electrosphere/engine/LoadingThread.java @@ -499,15 +499,15 @@ public class LoadingThread extends Thread { // EntityUtils.getRotation(building).rotateLocalY((float)(Math.PI)); // ActorUtils.applyBlenderTransformer(building); -// //spawn evil goblin -// Entity goblin = CreatureUtils.spawnBasicCreature("Goblin"); -// CreatureUtils.positionCharacter(goblin, new Vector3f(30, 3, 30)); -// EntityUtils.getScale(goblin).set(0.005f); -// //give evil goblin sword -// Entity goblinSword = ItemUtils.spawnBasicItem("Katana"); -// AttachUtils.attachEntityToEntityAtBone(goblin, goblinSword, "Bone.031"); -// //attach ai to evil goblin -// MindlessAttacker.attachToCreature(goblin); + //spawn evil goblin + Entity goblin = CreatureUtils.spawnBasicCreature("Goblin"); + CreatureUtils.positionCharacter(goblin, new Vector3f(30, 0, 30)); + EntityUtils.getScale(goblin).set(0.005f); + //give evil goblin sword + Entity goblinSword = ItemUtils.spawnBasicItem("Katana"); + AttachUtils.attachEntityToEntityAtBone(goblin, goblinSword, "Bone.031"); + //attach ai to evil goblin + MindlessAttacker.attachToCreature(goblin); // // // Entity testHomie = CreatureUtils.spawnBasicCreature("Human"); diff --git a/src/main/java/electrosphere/entity/state/GravityTree.java b/src/main/java/electrosphere/entity/state/GravityTree.java index 0a619ade..2e55a6cb 100644 --- a/src/main/java/electrosphere/entity/state/GravityTree.java +++ b/src/main/java/electrosphere/entity/state/GravityTree.java @@ -66,8 +66,8 @@ public class GravityTree { state = GravityTreeState.NOT_ACTIVE; } - static final float gravityConstant = 0.3f; - static final float linearDamping = 0.002f; + static final float gravityConstant = 0.2f; + static final float linearDamping = 0.02f; public void simulate(float deltaTime){ float velocity = CreatureUtils.getVelocity(parent); @@ -108,7 +108,7 @@ public class GravityTree { if(hadGroundCollision()){ state = GravityTreeState.NOT_ACTIVE; } else { - float gravityDif = gravityConstant * (float)Math.pow(1.0f - linearDamping,deltaTime); + float gravityDif = gravityConstant * (float)Math.pow(1.0f - linearDamping,deltaTime * 2); Vector3f newGravityPos = new Vector3f(position.x,position.y - gravityDif,position.z); float hitFraction = Globals.collisionEngine.sweepTest(body, position, newGravityPos); if(hitFraction >= 0){ diff --git a/src/main/java/electrosphere/game/collision/CollisionEngine.java b/src/main/java/electrosphere/game/collision/CollisionEngine.java index 48b82f99..e9b4eff4 100644 --- a/src/main/java/electrosphere/game/collision/CollisionEngine.java +++ b/src/main/java/electrosphere/game/collision/CollisionEngine.java @@ -58,7 +58,7 @@ public class CollisionEngine { List collisionObject = new ArrayList(); List collidableList = new ArrayList(); - static final float linearDamping = 0.2f; + static final float linearDamping = 0.02f; public CollisionEngine(){ broadphase = new DbvtBroadphase(); @@ -95,7 +95,7 @@ public class CollisionEngine { if (contactPoint.getDistance() < 0.0f) { magnitude = contactPoint.getDistance(); //linear dampen - magnitude = magnitude * (float)Math.pow(1.0f - linearDamping,deltaTime) * deltaTime * 8; + magnitude = magnitude * (float)Math.pow(1.0f - linearDamping,deltaTime * 2) * deltaTime * 8; hit = true; normal = new Vector3f(contactPoint.normalWorldOnB.x,contactPoint.normalWorldOnB.y,contactPoint.normalWorldOnB.z); break; diff --git a/src/main/java/electrosphere/game/collision/PhysicsUtils.java b/src/main/java/electrosphere/game/collision/PhysicsUtils.java index 2b4460ab..5b53e179 100644 --- a/src/main/java/electrosphere/game/collision/PhysicsUtils.java +++ b/src/main/java/electrosphere/game/collision/PhysicsUtils.java @@ -71,7 +71,7 @@ public class PhysicsUtils { for(int y = 0; y < arrayWidth; y++){ vertices[vertexInserterPos] = x; vertexInserterPos++; - vertices[vertexInserterPos] = heightfield[x][y] - 0.4f; + vertices[vertexInserterPos] = heightfield[x][y]; vertexInserterPos++; vertices[vertexInserterPos] = y; vertexInserterPos++; diff --git a/src/main/java/electrosphere/net/server/ServerConnectionHandler.java b/src/main/java/electrosphere/net/server/ServerConnectionHandler.java index 3322a4c8..7ca5c5a8 100644 --- a/src/main/java/electrosphere/net/server/ServerConnectionHandler.java +++ b/src/main/java/electrosphere/net/server/ServerConnectionHandler.java @@ -94,7 +94,7 @@ public class ServerConnectionHandler implements Runnable { System.exit(1); } //spawn player in world - Entity newPlayerCharacter = CreatureUtils.spawnBasicCreature("Human"); + Entity newPlayerCharacter = CreatureUtils.spawnBasicCreature("Goblin"); playerCharacterID = newPlayerCharacter.getId(); CreatureUtils.positionCharacter(newPlayerCharacter, new Vector3f(Globals.spawnPoint.x,3,Globals.spawnPoint.z)); //spawn player sword diff --git a/src/main/java/electrosphere/renderer/RenderingEngine.java b/src/main/java/electrosphere/renderer/RenderingEngine.java index 4c9d7721..4bb40be2 100644 --- a/src/main/java/electrosphere/renderer/RenderingEngine.java +++ b/src/main/java/electrosphere/renderer/RenderingEngine.java @@ -82,7 +82,7 @@ public class RenderingEngine { static Framebuffer lightDepthBuffer; public static boolean renderHitboxes = false; - public static boolean renderPhysics = false; + public static boolean renderPhysics = true; ShaderProgram activeProgram;