Fix skybox tracking potentially

This commit is contained in:
austin 2021-07-25 23:34:04 -04:00
parent b5743b3a1f
commit 45e28e5568
6 changed files with 31 additions and 13 deletions

View File

@ -29,6 +29,6 @@ void main()
//send color to the frag shader
color = colors[int(id)];
//set final position with opengl space
vec4 pos = projection * view * FinalVertex;
vec4 pos = projection * view * model * FinalVertex;
gl_Position = pos.xyww;
}

View File

@ -423,8 +423,7 @@ public class LoadingThread extends Thread {
*/
Model skyboxModel = Globals.assetManager.fetchModel(AssetDataStrings.ASSET_STRING_SKYBOX_BASIC);
Entity skyboxEntity = EntityUtils.spawnDrawableEntity(AssetDataStrings.ASSET_STRING_SKYBOX_BASIC);
EntityUtils.getScale(skyboxEntity).mul(100);
Globals.skybox = EntityUtils.spawnDrawableEntity(AssetDataStrings.ASSET_STRING_SKYBOX_BASIC);
Globals.skyboxColors.add(new Vector3f(100,150,200));

View File

@ -1,6 +1,9 @@
package electrosphere.game.client;
import electrosphere.entity.CameraEntityUtils;
import electrosphere.entity.EntityUtils;
import electrosphere.main.Globals;
import org.joml.Vector3f;
/**
*
@ -12,5 +15,18 @@ public class ClientFunctions {
Globals.clientTerrainManager.handleMessages();
Globals.clientTerrainManager.ejectLoadedChunks();
}
updateSkyboxPos();
}
static void updateSkyboxPos(){
if(Globals.skybox != null){
// Vector3f skyboxPos = EntityUtils.getPosition(Globals.skybox);
//
// Vector3f playerCameraPos = EntityUtils.getPosition(Globals.playerCamera);
// if(skyboxPos != null && playerCameraPos != null){
// skyboxPos.set(playerCameraPos);
// }
EntityUtils.getPosition(Globals.skybox).set(EntityUtils.getPosition(Globals.playerCharacter)).mul(0.01f);
}
}
}

View File

@ -43,9 +43,9 @@ public class DrawCellManager {
int drawRadius = 35;
int drawRadius = 5;
int drawStepdownInterval = 3;
int drawStepdownValue = 9;
int drawStepdownValue = 25;
int physicsRadius = 3;

View File

@ -226,6 +226,9 @@ public class Globals {
//the creature the player camera will orbit and will receive controlHandler movementTree updates
public static Entity playerCharacter;
//skybox entity
public static Entity skybox;
//ai manager
public static AIManager aiManager;

View File

@ -278,14 +278,14 @@ public class RenderUtils {
float[] vertexcoords = {
1.0f,1.0f,1.0f,
1.0f,1.0f,-1.0f,
1.0f,-1.0f,1.0f,
1.0f,-1.0f,-1.0f,
-1.0f,1.0f,1.0f,
-1.0f,1.0f,-1.0f,
-1.0f,-1.0f,1.0f,
-1.0f,-1.0f,-1.0f,
100.0f, 100.0f, 100.0f,
100.0f, 100.0f,-100.0f,
100.0f,-100.0f, 100.0f,
100.0f,-100.0f,-100.0f,
-100.0f, 100.0f, 100.0f,
-100.0f, 100.0f,-100.0f,
-100.0f,-100.0f, 100.0f,
-100.0f,-100.0f,-100.0f,
};