version bump lwjgl
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
1163f034eb
commit
b86217a285
@ -334,7 +334,7 @@
|
|||||||
"maxHealth" : 100,
|
"maxHealth" : 100,
|
||||||
"onDamageIFrames" : 30
|
"onDamageIFrames" : 30
|
||||||
},
|
},
|
||||||
"modelPath" : "Models/baseman5.fbx"
|
"modelPath" : "Models/baseman5.glb"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"files" : []
|
"files" : []
|
||||||
|
|||||||
BIN
assets/Models/baseman5.glb
Normal file
BIN
assets/Models/baseman5.glb
Normal file
Binary file not shown.
@ -56,11 +56,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path" : "Models/baseman5.fbx",
|
"path" : "Models/baseman5.glb",
|
||||||
"globalTransform": {
|
"globalTransform": {
|
||||||
"rotation" : [0,0,0,1],
|
"rotation" : [0,0,0,1],
|
||||||
"offset" : [0.0, 0.0, 0.0],
|
"offset" : [0.0, 0.0, 0.0],
|
||||||
"scale" : [0.005, 0.005, 0.005]
|
"scale" : [0.6, 0.6, 0.6]
|
||||||
},
|
},
|
||||||
"meshes" : [
|
"meshes" : [
|
||||||
]
|
]
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
"/Textures/GoblinEyes.png"
|
"/Textures/GoblinEyes.png"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Models/baseman5.fbx" : {
|
"Models/baseman5.glb" : {
|
||||||
"Torso.001" : [
|
"Torso.001" : [
|
||||||
"/Textures/skin1.png",
|
"/Textures/skin1.png",
|
||||||
"/Textures/skin1.png"
|
"/Textures/skin1.png"
|
||||||
|
|||||||
7
pom.xml
7
pom.xml
@ -9,8 +9,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<lwjgl.version>3.2.3</lwjgl.version>
|
<lwjgl.version>3.3.3</lwjgl.version>
|
||||||
<lwjgl.remotery.version>3.3.3</lwjgl.remotery.version>
|
|
||||||
<joml.version>1.9.19</joml.version>
|
<joml.version>1.9.19</joml.version>
|
||||||
<recast.version>1.5.7</recast.version>
|
<recast.version>1.5.7</recast.version>
|
||||||
<imgui.version>1.86.11</imgui.version>
|
<imgui.version>1.86.11</imgui.version>
|
||||||
@ -116,12 +115,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.lwjgl</groupId>
|
<groupId>org.lwjgl</groupId>
|
||||||
<artifactId>lwjgl-remotery</artifactId>
|
<artifactId>lwjgl-remotery</artifactId>
|
||||||
<version>${lwjgl.remotery.version}</version>
|
<version>${lwjgl.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.lwjgl</groupId>
|
<groupId>org.lwjgl</groupId>
|
||||||
<artifactId>lwjgl-remotery</artifactId>
|
<artifactId>lwjgl-remotery</artifactId>
|
||||||
<version>${lwjgl.remotery.version}</version>
|
<version>${lwjgl.version}</version>
|
||||||
<classifier>${lwjgl.natives}</classifier>
|
<classifier>${lwjgl.natives}</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
@ -212,7 +212,7 @@ public class ClientLoading {
|
|||||||
EntityCreationUtils.makeEntityDrawable(skybox, "Models/skyboxSphere.fbx");
|
EntityCreationUtils.makeEntityDrawable(skybox, "Models/skyboxSphere.fbx");
|
||||||
DrawableUtils.disableCulling(skybox);
|
DrawableUtils.disableCulling(skybox);
|
||||||
EntityUtils.getRotation(skybox).rotateX((float)(-Math.PI/2.0f));
|
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");
|
Globals.assetManager.queueOverrideMeshShader("Models/skyboxSphere.fbx", "Sphere", "Shaders/skysphere/skysphere.vs", "Shaders/skysphere/skysphere.fs");
|
||||||
|
|
||||||
//cloud ring pseudo skybox
|
//cloud ring pseudo skybox
|
||||||
@ -220,7 +220,7 @@ public class ClientLoading {
|
|||||||
EntityCreationUtils.makeEntityDrawable(cloudRing, "Models/cloudRing.fbx");
|
EntityCreationUtils.makeEntityDrawable(cloudRing, "Models/cloudRing.fbx");
|
||||||
DrawableUtils.disableCulling(cloudRing);
|
DrawableUtils.disableCulling(cloudRing);
|
||||||
EntityUtils.getRotation(cloudRing).rotateX((float)(-Math.PI/2.0f));
|
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.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");
|
Globals.assetManager.queueOverrideMeshShader("Models/cloudRing.fbx", "Sphere", "Shaders/skysphere/skysphere.vs", "Shaders/skysphere/skysphere.fs");
|
||||||
|
|
||||||
|
|||||||
@ -22,9 +22,10 @@ public class ActorUtils {
|
|||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static void applyBlenderTransformer(Entity actorEntity){
|
public static void applyBlenderTransformer(Entity actorEntity){
|
||||||
Actor entityActor = EntityUtils.getActor(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){
|
public static void applyBlenderRotation(Entity actorEntity){
|
||||||
|
|||||||
@ -17,8 +17,10 @@ import org.joml.Vector3f;
|
|||||||
* @author amaterasu
|
* @author amaterasu
|
||||||
*/
|
*/
|
||||||
public class AnimChannel {
|
public class AnimChannel {
|
||||||
|
|
||||||
double timeCurrent;
|
double timeCurrent;
|
||||||
double timeTotal;
|
double timeTotal;
|
||||||
|
double ticksPerSecond;
|
||||||
String nodeID;
|
String nodeID;
|
||||||
|
|
||||||
|
|
||||||
@ -32,8 +34,9 @@ public class AnimChannel {
|
|||||||
TreeMap<Double,Keyframe> scaleFrameTree;
|
TreeMap<Double,Keyframe> scaleFrameTree;
|
||||||
|
|
||||||
|
|
||||||
public AnimChannel(double maxTime){
|
public AnimChannel(double maxTime, double ticksPerSecond){
|
||||||
timeTotal = maxTime;
|
timeTotal = maxTime;
|
||||||
|
this.ticksPerSecond = ticksPerSecond;
|
||||||
positionFrameTree = new TreeMap<Double,Keyframe>();
|
positionFrameTree = new TreeMap<Double,Keyframe>();
|
||||||
rotationFrameTree = new TreeMap<Double,Keyframe>();
|
rotationFrameTree = new TreeMap<Double,Keyframe>();
|
||||||
scaleFrameTree = new TreeMap<Double,Keyframe>();
|
scaleFrameTree = new TreeMap<Double,Keyframe>();
|
||||||
|
|||||||
@ -63,8 +63,8 @@ public class Animation {
|
|||||||
//
|
//
|
||||||
this.animData = animData;
|
this.animData = animData;
|
||||||
name = animData.mName().dataString();
|
name = animData.mName().dataString();
|
||||||
this.duration = animData.mDuration();
|
|
||||||
this.ticksPerSecond = animData.mTicksPerSecond();
|
this.ticksPerSecond = animData.mTicksPerSecond();
|
||||||
|
this.duration = animData.mDuration() / this.ticksPerSecond;
|
||||||
this.ID = ID;
|
this.ID = ID;
|
||||||
//
|
//
|
||||||
//Print metadata
|
//Print metadata
|
||||||
@ -86,7 +86,7 @@ public class Animation {
|
|||||||
AINodeAnim currentChannelData = AINodeAnim.create(animData.mChannels().get(i));
|
AINodeAnim currentChannelData = AINodeAnim.create(animData.mChannels().get(i));
|
||||||
|
|
||||||
//Create channel
|
//Create channel
|
||||||
AnimChannel currentChannel = new AnimChannel(duration);
|
AnimChannel currentChannel = new AnimChannel(duration,ticksPerSecond);
|
||||||
currentChannel.nodeID = currentChannelData.mNodeName().dataString();
|
currentChannel.nodeID = currentChannelData.mNodeName().dataString();
|
||||||
channels.add(currentChannel);
|
channels.add(currentChannel);
|
||||||
|
|
||||||
@ -99,7 +99,8 @@ public class Animation {
|
|||||||
org.lwjgl.assimp.AIVectorKey.Buffer buff = currentChannelData.mPositionKeys();
|
org.lwjgl.assimp.AIVectorKey.Buffer buff = currentChannelData.mPositionKeys();
|
||||||
if(buff != null && buff.hasRemaining()){
|
if(buff != null && buff.hasRemaining()){
|
||||||
AIVectorKey key = buff.get();
|
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(
|
Vector4d positionRaw = new Vector4d(
|
||||||
key.mValue().x(),
|
key.mValue().x(),
|
||||||
key.mValue().y(),
|
key.mValue().y(),
|
||||||
@ -107,14 +108,15 @@ public class Animation {
|
|||||||
1
|
1
|
||||||
);
|
);
|
||||||
currentFrame.position = new Vector3f((float)positionRaw.x,(float)positionRaw.y,(float)positionRaw.z);
|
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;
|
currentChannel.startingPosition = currentFrame.position;
|
||||||
|
|
||||||
Keyframe previousFrame;
|
Keyframe previousFrame;
|
||||||
while(buff.hasRemaining()){
|
while(buff.hasRemaining()){
|
||||||
previousFrame = currentFrame;
|
previousFrame = currentFrame;
|
||||||
key = buff.get();
|
key = buff.get();
|
||||||
currentFrame = new Keyframe(key.mTime());
|
time = key.mTime() / this.ticksPerSecond;
|
||||||
|
currentFrame = new Keyframe(time);
|
||||||
positionRaw = new Vector4d(
|
positionRaw = new Vector4d(
|
||||||
key.mValue().x(),
|
key.mValue().x(),
|
||||||
key.mValue().y(),
|
key.mValue().y(),
|
||||||
@ -128,7 +130,7 @@ public class Animation {
|
|||||||
previousFrame.position.z == currentFrame.position.z
|
previousFrame.position.z == currentFrame.position.z
|
||||||
){
|
){
|
||||||
} else {
|
} 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();
|
org.lwjgl.assimp.AIQuatKey.Buffer buff = currentChannelData.mRotationKeys();
|
||||||
if(buff != null && buff.hasRemaining()){
|
if(buff != null && buff.hasRemaining()){
|
||||||
AIQuatKey key = buff.get();
|
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 = new Quaterniond();
|
||||||
currentFrame.rotation.set(key.mValue().x(), key.mValue().y(), key.mValue().z(), key.mValue().w());
|
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;
|
currentChannel.startingRotation = currentFrame.rotation;
|
||||||
|
|
||||||
@ -149,7 +152,8 @@ public class Animation {
|
|||||||
while(buff.hasRemaining()){
|
while(buff.hasRemaining()){
|
||||||
previousFrame = currentFrame;
|
previousFrame = currentFrame;
|
||||||
key = buff.get();
|
key = buff.get();
|
||||||
currentFrame = new Keyframe(key.mTime());
|
time = key.mTime() / this.ticksPerSecond;
|
||||||
|
currentFrame = new Keyframe(time);
|
||||||
currentFrame.rotation = new Quaterniond();
|
currentFrame.rotation = new Quaterniond();
|
||||||
currentFrame.rotation.set(key.mValue().x(), key.mValue().y(), key.mValue().z(), key.mValue().w());
|
currentFrame.rotation.set(key.mValue().x(), key.mValue().y(), key.mValue().z(), key.mValue().w());
|
||||||
//check for duplicate
|
//check for duplicate
|
||||||
@ -159,7 +163,7 @@ public class Animation {
|
|||||||
previousFrame.rotation.z == currentFrame.rotation.z
|
previousFrame.rotation.z == currentFrame.rotation.z
|
||||||
){
|
){
|
||||||
} else {
|
} 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();
|
org.lwjgl.assimp.AIVectorKey.Buffer buff = currentChannelData.mScalingKeys();
|
||||||
if(buff != null && buff.hasRemaining()){
|
if(buff != null && buff.hasRemaining()){
|
||||||
AIVectorKey key = buff.get();
|
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(
|
currentFrame.scale = new Vector3f(
|
||||||
(float)(key.mValue().x()),
|
(float)(key.mValue().x()),
|
||||||
(float)(key.mValue().y()),
|
(float)(key.mValue().y()),
|
||||||
(float)(key.mValue().z())
|
(float)(key.mValue().z())
|
||||||
);
|
);
|
||||||
currentChannel.addScaleFrame(key.mTime(),currentFrame);
|
currentChannel.addScaleFrame(time,currentFrame);
|
||||||
Keyframe previousFrame;
|
Keyframe previousFrame;
|
||||||
while(buff.hasRemaining()){
|
while(buff.hasRemaining()){
|
||||||
previousFrame = currentFrame;
|
previousFrame = currentFrame;
|
||||||
key = buff.get();
|
key = buff.get();
|
||||||
currentFrame = new Keyframe(key.mTime());
|
time = key.mTime() / this.ticksPerSecond;
|
||||||
|
currentFrame = new Keyframe(time);
|
||||||
currentFrame.scale = new Vector3f(
|
currentFrame.scale = new Vector3f(
|
||||||
(float)(key.mValue().x()),
|
(float)(key.mValue().x()),
|
||||||
(float)(key.mValue().y()),
|
(float)(key.mValue().y()),
|
||||||
@ -191,7 +197,7 @@ public class Animation {
|
|||||||
currentFrame.scale.z == previousFrame.scale.z
|
currentFrame.scale.z == previousFrame.scale.z
|
||||||
){
|
){
|
||||||
} else {
|
} else {
|
||||||
currentChannel.addScaleFrame(key.mTime(),currentFrame);
|
currentChannel.addScaleFrame(time,currentFrame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user