version bump lwjgl
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-03-24 15:48:23 -04:00
parent 1163f034eb
commit b86217a285
9 changed files with 40 additions and 31 deletions

View File

@ -334,7 +334,7 @@
"maxHealth" : 100,
"onDamageIFrames" : 30
},
"modelPath" : "Models/baseman5.fbx"
"modelPath" : "Models/baseman5.glb"
}
],
"files" : []

BIN
assets/Models/baseman5.glb Normal file

Binary file not shown.

View File

@ -56,11 +56,11 @@
]
},
{
"path" : "Models/baseman5.fbx",
"path" : "Models/baseman5.glb",
"globalTransform": {
"rotation" : [0,0,0,1],
"offset" : [0.0, 0.0, 0.0],
"scale" : [0.005, 0.005, 0.005]
"scale" : [0.6, 0.6, 0.6]
},
"meshes" : [
]

View File

@ -68,7 +68,7 @@
"/Textures/GoblinEyes.png"
]
},
"Models/baseman5.fbx" : {
"Models/baseman5.glb" : {
"Torso.001" : [
"/Textures/skin1.png",
"/Textures/skin1.png"

View File

@ -9,8 +9,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<lwjgl.version>3.2.3</lwjgl.version>
<lwjgl.remotery.version>3.3.3</lwjgl.remotery.version>
<lwjgl.version>3.3.3</lwjgl.version>
<joml.version>1.9.19</joml.version>
<recast.version>1.5.7</recast.version>
<imgui.version>1.86.11</imgui.version>
@ -116,12 +115,12 @@
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-remotery</artifactId>
<version>${lwjgl.remotery.version}</version>
<version>${lwjgl.version}</version>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-remotery</artifactId>
<version>${lwjgl.remotery.version}</version>
<version>${lwjgl.version}</version>
<classifier>${lwjgl.natives}</classifier>
</dependency>

View File

@ -212,7 +212,7 @@ public class ClientLoading {
EntityCreationUtils.makeEntityDrawable(skybox, "Models/skyboxSphere.fbx");
DrawableUtils.disableCulling(skybox);
EntityUtils.getRotation(skybox).rotateX((float)(-Math.PI/2.0f));
EntityUtils.getScale(skybox).mul(2000.0f);
EntityUtils.getScale(skybox).mul(200000.0f);
Globals.assetManager.queueOverrideMeshShader("Models/skyboxSphere.fbx", "Sphere", "Shaders/skysphere/skysphere.vs", "Shaders/skysphere/skysphere.fs");
//cloud ring pseudo skybox
@ -220,7 +220,7 @@ public class ClientLoading {
EntityCreationUtils.makeEntityDrawable(cloudRing, "Models/cloudRing.fbx");
DrawableUtils.disableCulling(cloudRing);
EntityUtils.getRotation(cloudRing).rotateX((float)(-Math.PI/2.0f));
EntityUtils.getScale(cloudRing).mul(1000.0f);
EntityUtils.getScale(cloudRing).mul(100000.0f);
Globals.clientScene.registerBehaviorTree(new ApplyRotationTree(cloudRing,new Quaterniond().rotationZ(0.0001)));
Globals.assetManager.queueOverrideMeshShader("Models/cloudRing.fbx", "Sphere", "Shaders/skysphere/skysphere.vs", "Shaders/skysphere/skysphere.fs");

View File

@ -22,9 +22,10 @@ public class ActorUtils {
return rVal;
}
@Deprecated
public static void applyBlenderTransformer(Entity actorEntity){
Actor entityActor = EntityUtils.getActor(actorEntity);
entityActor.setAnimationScalar(60f); //should be the value of the fps i think
// entityActor.setAnimationScalar(60f); //should be the value of the fps i think
}
public static void applyBlenderRotation(Entity actorEntity){

View File

@ -17,8 +17,10 @@ import org.joml.Vector3f;
* @author amaterasu
*/
public class AnimChannel {
double timeCurrent;
double timeTotal;
double ticksPerSecond;
String nodeID;
@ -32,8 +34,9 @@ public class AnimChannel {
TreeMap<Double,Keyframe> scaleFrameTree;
public AnimChannel(double maxTime){
public AnimChannel(double maxTime, double ticksPerSecond){
timeTotal = maxTime;
this.ticksPerSecond = ticksPerSecond;
positionFrameTree = new TreeMap<Double,Keyframe>();
rotationFrameTree = new TreeMap<Double,Keyframe>();
scaleFrameTree = new TreeMap<Double,Keyframe>();

View File

@ -63,17 +63,17 @@ public class Animation {
//
this.animData = animData;
name = animData.mName().dataString();
this.duration = animData.mDuration();
this.ticksPerSecond = animData.mTicksPerSecond();
this.duration = animData.mDuration() / this.ticksPerSecond;
this.ID = ID;
//
//Print metadata
//
// System.out.println("Animation name: \"" + name + "\"");
// System.out.println("ID:(" + ID + ")");
// System.out.println("Ticks per second: " + ticksPerSecond);
// System.out.println("Anim sizeof: " + animData.sizeof());
// System.out.println("Duration: " + duration);
// System.out.println("Animation name: \"" + name + "\"");
// System.out.println("ID:(" + ID + ")");
// System.out.println("Ticks per second: " + ticksPerSecond);
// System.out.println("Anim sizeof: " + animData.sizeof());
// System.out.println("Duration: " + duration);
//
@ -86,7 +86,7 @@ public class Animation {
AINodeAnim currentChannelData = AINodeAnim.create(animData.mChannels().get(i));
//Create channel
AnimChannel currentChannel = new AnimChannel(duration);
AnimChannel currentChannel = new AnimChannel(duration,ticksPerSecond);
currentChannel.nodeID = currentChannelData.mNodeName().dataString();
channels.add(currentChannel);
@ -99,7 +99,8 @@ public class Animation {
org.lwjgl.assimp.AIVectorKey.Buffer buff = currentChannelData.mPositionKeys();
if(buff != null && buff.hasRemaining()){
AIVectorKey key = buff.get();
Keyframe currentFrame = new Keyframe(key.mTime());
double time = key.mTime() / this.ticksPerSecond;
Keyframe currentFrame = new Keyframe(time);
Vector4d positionRaw = new Vector4d(
key.mValue().x(),
key.mValue().y(),
@ -107,14 +108,15 @@ public class Animation {
1
);
currentFrame.position = new Vector3f((float)positionRaw.x,(float)positionRaw.y,(float)positionRaw.z);
currentChannel.addPositionFrame(key.mTime(),currentFrame);
currentChannel.addPositionFrame(time,currentFrame);
currentChannel.startingPosition = currentFrame.position;
Keyframe previousFrame;
while(buff.hasRemaining()){
previousFrame = currentFrame;
key = buff.get();
currentFrame = new Keyframe(key.mTime());
time = key.mTime() / this.ticksPerSecond;
currentFrame = new Keyframe(time);
positionRaw = new Vector4d(
key.mValue().x(),
key.mValue().y(),
@ -128,7 +130,7 @@ public class Animation {
previousFrame.position.z == currentFrame.position.z
){
} else {
currentChannel.addPositionFrame(key.mTime(),currentFrame);
currentChannel.addPositionFrame(time,currentFrame);
}
}
}
@ -138,10 +140,11 @@ public class Animation {
org.lwjgl.assimp.AIQuatKey.Buffer buff = currentChannelData.mRotationKeys();
if(buff != null && buff.hasRemaining()){
AIQuatKey key = buff.get();
Keyframe currentFrame = new Keyframe(key.mTime());
double time = key.mTime() / this.ticksPerSecond;
Keyframe currentFrame = new Keyframe(time);
currentFrame.rotation = new Quaterniond();
currentFrame.rotation.set(key.mValue().x(), key.mValue().y(), key.mValue().z(), key.mValue().w());
currentChannel.addRotationFrame(key.mTime(),currentFrame);
currentChannel.addRotationFrame(time,currentFrame);
currentChannel.startingRotation = currentFrame.rotation;
@ -149,7 +152,8 @@ public class Animation {
while(buff.hasRemaining()){
previousFrame = currentFrame;
key = buff.get();
currentFrame = new Keyframe(key.mTime());
time = key.mTime() / this.ticksPerSecond;
currentFrame = new Keyframe(time);
currentFrame.rotation = new Quaterniond();
currentFrame.rotation.set(key.mValue().x(), key.mValue().y(), key.mValue().z(), key.mValue().w());
//check for duplicate
@ -159,7 +163,7 @@ public class Animation {
previousFrame.rotation.z == currentFrame.rotation.z
){
} else {
currentChannel.addRotationFrame(key.mTime(),currentFrame);
currentChannel.addRotationFrame(time,currentFrame);
}
}
}
@ -169,18 +173,20 @@ public class Animation {
org.lwjgl.assimp.AIVectorKey.Buffer buff = currentChannelData.mScalingKeys();
if(buff != null && buff.hasRemaining()){
AIVectorKey key = buff.get();
Keyframe currentFrame = new Keyframe(key.mTime());
double time = key.mTime() / this.ticksPerSecond;
Keyframe currentFrame = new Keyframe(time);
currentFrame.scale = new Vector3f(
(float)(key.mValue().x()),
(float)(key.mValue().y()),
(float)(key.mValue().z())
);
currentChannel.addScaleFrame(key.mTime(),currentFrame);
currentChannel.addScaleFrame(time,currentFrame);
Keyframe previousFrame;
while(buff.hasRemaining()){
previousFrame = currentFrame;
key = buff.get();
currentFrame = new Keyframe(key.mTime());
time = key.mTime() / this.ticksPerSecond;
currentFrame = new Keyframe(time);
currentFrame.scale = new Vector3f(
(float)(key.mValue().x()),
(float)(key.mValue().y()),
@ -191,7 +197,7 @@ public class Animation {
currentFrame.scale.z == previousFrame.scale.z
){
} else {
currentChannel.addScaleFrame(key.mTime(),currentFrame);
currentChannel.addScaleFrame(time,currentFrame);
}
}
}