nightmare creature

This commit is contained in:
austin 2022-02-13 00:17:04 -05:00
parent 12e0ddb6a3
commit 894e6211a1
7 changed files with 38 additions and 18 deletions

Binary file not shown.

View File

@ -615,15 +615,15 @@ public class LoadingThread extends Thread {
// ActorUtils.applyBlenderTransformer(building);
//spawn evil goblin
Entity goblin = CreatureUtils.spawnBasicCreature("goblin");
CollisionObjUtils.positionCharacter(goblin, new Vector3f(4, 0, 4));
EntityUtils.getScale(goblin).set(0.005f);
// Entity goblin = CreatureUtils.spawnBasicCreature("goblin");
// CollisionObjUtils.positionCharacter(goblin, new Vector3f(4, 0, 4));
// 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);
OpportunisticAttacker.attachToCreature(goblin);
// OpportunisticAttacker.attachToCreature(goblin);
Entity shorts = ItemUtils.spawnBasicItem("boots1");
EntityUtils.getPosition(shorts).set(new Vector3f(2,1,1));

View File

@ -25,7 +25,7 @@ public class IdleTree {
Entity parent;
CopyOnWriteArrayList<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList();
CopyOnWriteArrayList<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList<EntityMessage>();
int frameCurrent;
@ -96,7 +96,7 @@ public class IdleTree {
case IDLE:
if(entityActor != null){
if(!entityActor.isPlayingAnimation() || !entityActor.isPlayingAnimation(Animation.ANIMATION_IDLE_1)){
entityActor.playAnimation(Animation.ANIMATION_IDLE_1,1);
entityActor.playAnimation(Animation.ANIMATION_IDLE_1,3);
entityActor.incrementAnimationTime(0.01);
}
}

View File

@ -20,6 +20,7 @@ import electrosphere.engine.LoadingThread;
import electrosphere.game.client.ClientFunctions;
import electrosphere.game.client.targeting.crosshair.Crosshair;
import electrosphere.game.config.UserSettings;
import electrosphere.game.data.creature.type.Animation;
import electrosphere.game.server.saves.SaveUtils;
import electrosphere.game.server.terrain.manager.ServerTerrainManager;
import electrosphere.game.server.world.MacroData;
@ -173,13 +174,25 @@ public class Main {
Globals.renderingEngine.createOpenglContext();
//uncomment to test loading a model into engine
// if(1==1){
// Globals.assetManager.addModelPathToQueue("/Models/goblin1.fbx");
// Globals.assetManager.loadAssetsInQueue();
// Model bowModel = Globals.assetManager.fetchModel("/Models/goblin1.fbx");
// bowModel.describeHighLevel();
// System.exit(0);
// }
// if(1==1){
// Globals.assetManager.addModelPathToQueue("/Models/baseman.fbx");
// Globals.assetManager.loadAssetsInQueue();
// Model model = Globals.assetManager.fetchModel("/Models/baseman.fbx");
// for(electrosphere.renderer.anim.Animation anim : model.animations){
// if(anim.name.equals("Armature|Idle1")){
// System.out.println(anim.duration);
// for(electrosphere.renderer.anim.AnimChannel channel : anim.channels){
// if(channel.getNodeID().equals("Torso")){
// channel.fullDescribeChannel();
// }
// // System.out.println("CHannel: " + channel.getNodeID());
// }
// break;
// }
// }
// // model.describeHighLevel();
// System.exit(0);
// }
//create the audio context
Globals.audioEngine = new AudioEngine();

View File

@ -104,6 +104,7 @@ public class Mesh {
Mesh rVal = new Mesh();
rVal.mesh = mesh;
rVal.nodeID = mesh.mName().dataString();
//
// VAO
@ -325,6 +326,9 @@ public class Mesh {
index[2] = index[1];
index[1] = index[0];
index[0] = boneCounter;
// if(rVal.nodeID.equals("Torso")){
// System.out.println(index[3] + " " + index[2] + " " + index[1] + " " + index[0]);
// }
} else if(boneVal > weight[1]){
weight[3] = weight[2];
weight[2] = weight[1];
@ -412,9 +416,6 @@ public class Mesh {
rVal.nodeID = mesh.mName().dataString();
return rVal;
}
@ -832,6 +833,12 @@ public class Mesh {
if(currentBone != null){
Matrix4f currentMat = new Matrix4f(currentBone.final_transform);
currentMat.get(bufferarray);
// if(boneName.equals("Torso")){
// System.out.println("Found torso bone");
// System.out.println(currentUniform);
// System.out.println(currentMat);
// System.exit(0);
// }
GL20.glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, currentUniform), false, bufferarray);
} else {
// System.out.println("Bonename: " + boneName);

View File

@ -233,7 +233,7 @@ public class RenderingEngine {
Globals.projectionMatrix = new Matrix4f();
Globals.viewMatrix = new Matrix4f();
float verticalFOV = (float)(Globals.verticalFOV * Math.PI /180.0f);
float aspectRatio = (float)((float)Globals.WINDOW_WIDTH / (float)Globals.WINDOW_HEIGHT);
float aspectRatio = (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));

View File

@ -19,7 +19,7 @@ public class ActorUtils {
public static void applyBlenderTransformer(Entity actorEntity){
Actor entityActor = EntityUtils.getActor(actorEntity);
entityActor.setAnimationScalar(100f);
entityActor.setAnimationScalar(60f); //should be the value of the fps i think
EntityUtils.getScale(actorEntity).set(0.005f);
}