diff --git a/assets/Data/items.json b/assets/Data/items.json index 34281269..d022a782 100644 --- a/assets/Data/items.json +++ b/assets/Data/items.json @@ -119,6 +119,73 @@ "meshMaskList" : [] } ] + }, + + { + "itemId" : "boots1", + "modelPath": "Models/itemEntityShorts.fbx", + "tokens" : [ + "GRAVITY", + "ARMOR", + "TARGETABLE" + ], + "collidable": { + "type" : "CUBE", + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.35, + "offsetX" : 0, + "offsetY" : 0.05, + "offsetZ" : 0 + }, + "equipWhitelist" : [ + { + "creatureId" : "human", + "model" : "Models/boots1.fbx", + "meshList" : [ + "BootLeft", + "BootRight" + ], + "meshMaskList" : [ + "FootLeft", + "FootRight", + "LowerLegLeft", + "LowerLegRight" + ] + } + ] + }, + + { + "itemId" : "shirt1", + "modelPath": "Models/itemEntityShorts.fbx", + "tokens" : [ + "GRAVITY", + "ARMOR", + "TARGETABLE" + ], + "collidable": { + "type" : "CUBE", + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.35, + "offsetX" : 0, + "offsetY" : 0.05, + "offsetZ" : 0 + }, + "equipWhitelist" : [ + { + "creatureId" : "human", + "model" : "Models/shirt1.fbx", + "meshList" : [ + "ClothingItem" + ], + "meshMaskList" : [ + "ShoulderLeft", + "ShoulderRight" + ] + } + ] } diff --git a/assets/Models/baseman.fbx b/assets/Models/baseman.fbx index a8f1f75f..c104f012 100644 Binary files a/assets/Models/baseman.fbx and b/assets/Models/baseman.fbx differ diff --git a/assets/Models/boots1.fbx b/assets/Models/boots1.fbx new file mode 100644 index 00000000..71f0e6f1 Binary files /dev/null and b/assets/Models/boots1.fbx differ diff --git a/assets/Models/shirt1.fbx b/assets/Models/shirt1.fbx new file mode 100644 index 00000000..8ca2bc27 Binary files /dev/null and b/assets/Models/shirt1.fbx differ diff --git a/assets/Models/shorts1.fbx b/assets/Models/shorts1.fbx index f73a858d..5abd05ac 100644 Binary files a/assets/Models/shorts1.fbx and b/assets/Models/shorts1.fbx differ diff --git a/assets/Textures/boots1.png b/assets/Textures/boots1.png new file mode 100644 index 00000000..08a01071 Binary files /dev/null and b/assets/Textures/boots1.png differ diff --git a/assets/Textures/default_texture_map.json b/assets/Textures/default_texture_map.json index 8ceb5246..759dbf17 100644 --- a/assets/Textures/default_texture_map.json +++ b/assets/Textures/default_texture_map.json @@ -210,8 +210,8 @@ }, "Models/shorts1.fbx" : { "ClothingItem" : [ - "/Textures/b1.png", - "/Textures/b1.png" + "/Textures/shorts1.png", + "/Textures/shorts1.png" ] }, "Models/hairshort1.fbx" : { @@ -219,6 +219,22 @@ "/Textures/b1.png", "/Textures/b1.png" ] + }, + "Models/boots1.fbx" : { + "BootLeft" : [ + "/Textures/boots1.png", + "/Textures/boots1.png" + ], + "BootRight" : [ + "/Textures/boots1.png", + "/Textures/boots1.png" + ] + }, + "Models/shirt1.fbx" : { + "ClothingItem" : [ + "/Textures/shirt1.png", + "/Textures/shirt1.png" + ] } } } \ No newline at end of file diff --git a/assets/Textures/shirt1.png b/assets/Textures/shirt1.png new file mode 100644 index 00000000..c0e3d180 Binary files /dev/null and b/assets/Textures/shirt1.png differ diff --git a/assets/Textures/shorts1.png b/assets/Textures/shorts1.png new file mode 100644 index 00000000..1a101abc Binary files /dev/null and b/assets/Textures/shorts1.png differ diff --git a/src/main/java/electrosphere/engine/LoadingThread.java b/src/main/java/electrosphere/engine/LoadingThread.java index 1dbd768c..e1821b9f 100644 --- a/src/main/java/electrosphere/engine/LoadingThread.java +++ b/src/main/java/electrosphere/engine/LoadingThread.java @@ -625,9 +625,9 @@ public class LoadingThread extends Thread { // MindlessAttacker.attachToCreature(goblin); OpportunisticAttacker.attachToCreature(goblin); - Entity shorts = ItemUtils.spawnBasicItem("shorts1"); + Entity shorts = ItemUtils.spawnBasicItem("boots1"); EntityUtils.getPosition(shorts).set(new Vector3f(2,1,1)); - Entity hair = ItemUtils.spawnBasicItem("hairshort1"); + Entity hair = ItemUtils.spawnBasicItem("shirt1"); EntityUtils.getPosition(hair).set(new Vector3f(1,1,1)); // goblin = CreatureUtils.spawnBasicCreature("Goblin"); diff --git a/src/main/java/electrosphere/renderer/Mesh.java b/src/main/java/electrosphere/renderer/Mesh.java index 401618bc..cf50ac4c 100644 --- a/src/main/java/electrosphere/renderer/Mesh.java +++ b/src/main/java/electrosphere/renderer/Mesh.java @@ -1,6 +1,7 @@ package electrosphere.renderer; import electrosphere.entity.CameraEntityUtils; +import electrosphere.logger.LoggerInterface; import electrosphere.main.Globals; import electrosphere.main.Main; import electrosphere.renderer.light.LightBuffer; @@ -825,11 +826,18 @@ public class Mesh { float bufferarray[] = new float[16]; int incrementer = 0; while (boneIterator.hasNext()){ - Bone currentBone = parent.boneMap.get(boneIterator.next()); - Matrix4f currentMat = new Matrix4f(currentBone.final_transform); - currentMat.get(bufferarray); + String boneName = boneIterator.next(); + Bone currentBone = parent.boneMap.get(boneName); String currentUniform = "bones[" + incrementer + "]"; - GL20.glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, currentUniform), false, bufferarray); + if(currentBone != null){ + Matrix4f currentMat = new Matrix4f(currentBone.final_transform); + currentMat.get(bufferarray); + GL20.glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, currentUniform), false, bufferarray); + } else { + System.out.println("Bonename: " + boneName); + System.exit(1); + GL20.glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, currentUniform), false, new float[16]); + } incrementer++; } } else {