diff --git a/assets/Data/creatures/human.json b/assets/Data/creatures/human.json index 694534d2..608d29c4 100644 --- a/assets/Data/creatures/human.json +++ b/assets/Data/creatures/human.json @@ -75,7 +75,7 @@ { "type" : "GROUND", "acceleration" : 16.0, - "maxVelocity" : 3.0, + "maxVelocity" : 1.0, "animationStartup" : { "name" : "Armature|WalkStart", "length" : 1, diff --git a/assets/Models/baseman.fbx b/assets/Models/baseman.fbx index c104f012..21a0f26d 100644 Binary files a/assets/Models/baseman.fbx and b/assets/Models/baseman.fbx differ diff --git a/src/main/java/electrosphere/entity/state/inventory/RelationalInventoryState.java b/src/main/java/electrosphere/entity/state/inventory/RelationalInventoryState.java new file mode 100644 index 00000000..e729f7b0 --- /dev/null +++ b/src/main/java/electrosphere/entity/state/inventory/RelationalInventoryState.java @@ -0,0 +1,45 @@ +package electrosphere.entity.state.inventory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import electrosphere.entity.Entity; + +public class RelationalInventoryState { + + int capacity; + + Map items = new HashMap(); + + public RelationalInventoryState(List slots){ + for(String slot : slots){ + items.put(slot,null); + } + } + + public void addItem(String slot, Entity item){ + items.put(slot,item); + } + + public Entity removeItemSlot(String slot){ + Entity rVal = items.remove(slot); + items.put(slot,null); + return rVal; + } + + public Entity getItemSlot(String slot){ + return items.get(slot); + } + + public boolean hasItemInSlot(String slot){ + //if the slot is a key return if the value at the key isn't null, otherwise return false + return items.containsKey(slot) ? items.get(slot) != null : false; + } + + public Set getSlots(){ + return items.keySet(); + } + +} diff --git a/src/main/java/electrosphere/entity/state/inventory/UnrelationalInventoryState.java b/src/main/java/electrosphere/entity/state/inventory/UnrelationalInventoryState.java new file mode 100644 index 00000000..1b6ae14c --- /dev/null +++ b/src/main/java/electrosphere/entity/state/inventory/UnrelationalInventoryState.java @@ -0,0 +1,29 @@ +package electrosphere.entity.state.inventory; + +import java.util.LinkedList; +import java.util.List; + +import electrosphere.entity.Entity; + +public class UnrelationalInventoryState { + + int capacity; + + List items = new LinkedList(); + + public void addItem(Entity item){ + items.add(item); + } + + public void removeItem(Entity item){ + items.remove(item); + } + + public List getItems(){ + return items; + } + + + + +} diff --git a/src/main/java/electrosphere/game/config/UserSettings.java b/src/main/java/electrosphere/game/config/UserSettings.java index b8173073..a2dafb65 100644 --- a/src/main/java/electrosphere/game/config/UserSettings.java +++ b/src/main/java/electrosphere/game/config/UserSettings.java @@ -140,7 +140,7 @@ public class UserSettings { } Globals.WINDOW_WIDTH = Globals.userSettings.displayWidth; Globals.WINDOW_HEIGHT = Globals.userSettings.displayHeight; - Globals.FOV = Globals.userSettings.graphicsFOV; + Globals.verticalFOV = Globals.userSettings.graphicsFOV; } diff --git a/src/main/java/electrosphere/main/Globals.java b/src/main/java/electrosphere/main/Globals.java index 43baa7e3..c46f0841 100644 --- a/src/main/java/electrosphere/main/Globals.java +++ b/src/main/java/electrosphere/main/Globals.java @@ -177,7 +177,7 @@ public class Globals { //title bar dimensions public static int WINDOW_TITLE_BAR_HEIGHT = 0; - public static float FOV = 90; + public static float verticalFOV = 90; //matrices for drawing models public static Matrix4f viewMatrix = new Matrix4f(); diff --git a/src/main/java/electrosphere/renderer/RenderingEngine.java b/src/main/java/electrosphere/renderer/RenderingEngine.java index 7385ea4d..80ffb630 100644 --- a/src/main/java/electrosphere/renderer/RenderingEngine.java +++ b/src/main/java/electrosphere/renderer/RenderingEngine.java @@ -232,8 +232,10 @@ public class RenderingEngine { // Globals.projectionMatrix = new Matrix4f(); Globals.viewMatrix = new Matrix4f(); - float FOV = (float)(Globals.FOV * Math.PI /180.0f); - Globals.projectionMatrix.setPerspective(FOV, 1.0f, 0.1f, view_Range); + float verticalFOV = (float)(Globals.verticalFOV * Math.PI /180.0f); + float aspectRatio = (float)((float)Globals.WINDOW_WIDTH / (float)Globals.WINDOW_HEIGHT); + float nearClip = 0.001f; + Globals.projectionMatrix.setPerspective(verticalFOV, aspectRatio, nearClip, view_Range); Globals.viewMatrix.translation(new Vector3f(0.0f,0.0f,-3.0f)); } @@ -258,7 +260,7 @@ public class RenderingEngine { } float rotationalDiff = phi; float dist = calculateDist(new Vector3f(cameraPos.x,0,cameraPos.z), new Vector3f(position.x,0,position.z)); - if(rotationalDiff > (Globals.FOV / 180 * Math.PI) && dist > 300){ + if(rotationalDiff > (Globals.verticalFOV / 180 * Math.PI) && dist > 300){ rVal = false; } return rVal;