This commit is contained in:
parent
a7ef1db485
commit
3a34dc28ce
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@ -54,14 +54,6 @@
|
||||
"projectName": "Renderer",
|
||||
"args": "--headless"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Launch Simulation Only",
|
||||
"request": "launch",
|
||||
"mainClass": "electrosphere.engine.Main",
|
||||
"projectName": "Renderer",
|
||||
"args": "--simulate"
|
||||
},
|
||||
{
|
||||
"name": "C/C++: gcc.exe build and debug active file",
|
||||
"type": "cppdbg",
|
||||
|
||||
@ -1585,6 +1585,8 @@ BlockFab metadata
|
||||
Structure editing tab in editor view
|
||||
Reduce physics generation calls on GriddedDataCellManager
|
||||
Fab selection doesn't overflow anymore
|
||||
Cleaning up parts of Main class
|
||||
Spawn test structure in macro data on creation
|
||||
|
||||
|
||||
|
||||
|
||||
@ -332,9 +332,6 @@ public class Globals {
|
||||
//macro simulation
|
||||
public static MacroSimulation macroSimulation;
|
||||
public static MacroData macroData;
|
||||
|
||||
//flag to only run a simulation without full client
|
||||
public static boolean RUN_SIMULATION_ONLY = false;
|
||||
|
||||
//micro simulation
|
||||
public static MicroSimulation microSimulation;
|
||||
|
||||
@ -20,8 +20,6 @@ import electrosphere.engine.time.Timekeeper;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.renderer.RenderingEngine;
|
||||
import electrosphere.server.MainServerFunctions;
|
||||
import electrosphere.server.macro.MacroData;
|
||||
import electrosphere.server.simulation.MacroSimulation;
|
||||
|
||||
|
||||
/**
|
||||
@ -50,7 +48,9 @@ public class Main {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tracks whether the application is running or not
|
||||
*/
|
||||
public static boolean running = true;
|
||||
|
||||
/**
|
||||
@ -58,14 +58,25 @@ public class Main {
|
||||
*/
|
||||
static boolean initOde = false;
|
||||
|
||||
//target amount of time per frame
|
||||
/**
|
||||
* target amount of time per frame
|
||||
*/
|
||||
public static float targetFrameRate = 60.0f;
|
||||
/**
|
||||
* Target period per frame
|
||||
*/
|
||||
static float targetFramePeriod = 1.0f/targetFrameRate;
|
||||
|
||||
//framestep variable
|
||||
/**
|
||||
* Framestep tracking variable
|
||||
*/
|
||||
static int framestep = 2;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The initial method of the application
|
||||
* @param args CLI args
|
||||
*/
|
||||
public static void main(String args[]){
|
||||
|
||||
//
|
||||
@ -74,9 +85,9 @@ public class Main {
|
||||
//
|
||||
//
|
||||
|
||||
startUp(args);
|
||||
Main.startUp(args);
|
||||
|
||||
mainLoop();
|
||||
Main.mainLoop();
|
||||
|
||||
}
|
||||
|
||||
@ -84,7 +95,7 @@ public class Main {
|
||||
* Starts up the engine
|
||||
*/
|
||||
public static void startUp(){
|
||||
startUp(new String[]{
|
||||
Main.startUp(new String[]{
|
||||
"Renderer"
|
||||
});
|
||||
}
|
||||
@ -115,49 +126,7 @@ public class Main {
|
||||
OdeHelper.initODE();
|
||||
initOde = true;
|
||||
}
|
||||
|
||||
//world gen testing
|
||||
//gen terrain
|
||||
if(Globals.RUN_SIMULATION_ONLY){
|
||||
//gen world
|
||||
Globals.macroData = MacroData.generateWorld(0);
|
||||
Globals.macroData.describeWorld();
|
||||
boolean run = true;
|
||||
Globals.macroSimulation = new MacroSimulation();
|
||||
while(run){
|
||||
Globals.macroSimulation.simulate();
|
||||
try {
|
||||
TimeUnit.MILLISECONDS.sleep(1000);
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if(1==1){
|
||||
// Globals.audioEngine = new AudioEngine();
|
||||
// Globals.audioEngine.init();
|
||||
// Globals.assetManager.addAudioPathToQueue("/Audio/MenuStartup.ogg");
|
||||
// Globals.assetManager.loadAssetsInQueue();
|
||||
// Globals.audioEngine.setGain(0.1f);
|
||||
// AudioSource startupSound = AudioUtils.playAudioAtLocation("/Audio/MenuStartup.ogg", new Vector3f(3,0,0));
|
||||
// if(startupSound != null){
|
||||
// while(startupSound.isPlaying()){
|
||||
// try {
|
||||
// TimeUnit.MILLISECONDS.sleep(10);
|
||||
// } catch (InterruptedException ex) {
|
||||
// ex.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// System.exit(0);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
//debug: create terrain/world viewer
|
||||
// TerrainViewer.runViewer();
|
||||
|
||||
//create the drawing context
|
||||
if(Globals.RUN_CLIENT && !Globals.HEADLESS){
|
||||
//create opengl context
|
||||
@ -180,31 +149,6 @@ public class Main {
|
||||
}
|
||||
}));
|
||||
|
||||
//uncomment to test loading a model into engine
|
||||
// if(1==1){
|
||||
// //Models/creatures/person2/person2_1.glb
|
||||
// ///Models/creatures/viewmodel.glb
|
||||
// Globals.assetManager.addModelPathToQueue("/Models/creatures/person2/person2_1.glb");
|
||||
// Globals.assetManager.loadAssetsInQueue();
|
||||
// electrosphere.renderer.model.Model model = Globals.assetManager.fetchModel("/Models/creatures/person2/person2_1.glb");
|
||||
// // for(electrosphere.renderer.anim.Animation anim : model.getAnimations()){
|
||||
// // 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();
|
||||
// // model.animations.get(0).fullDescribeAnimation();
|
||||
// // model.describeHighLevel();
|
||||
// System.exit(0);
|
||||
// }
|
||||
|
||||
//create the audio context
|
||||
Globals.audioEngine = new AudioEngine();
|
||||
if(Globals.RUN_CLIENT && !Globals.HEADLESS && Globals.RUN_AUDIO){
|
||||
@ -235,7 +179,6 @@ public class Main {
|
||||
LoggerInterface.loggerStartup.INFO("Recapture screen");
|
||||
Globals.controlHandler.setRecapture(true);
|
||||
}
|
||||
// RenderUtils.recaptureScreen();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -19,9 +19,6 @@ public class CLIParser {
|
||||
Globals.RUN_SERVER = true;
|
||||
Globals.HEADLESS = true;
|
||||
} break;
|
||||
case "--simulate": {
|
||||
Globals.RUN_SIMULATION_ONLY = true;
|
||||
} break;
|
||||
case "--maxLogs": {
|
||||
LoggerInterface.setInitLogLevel(LogLevel.LOOP_DEBUG);
|
||||
} break;
|
||||
|
||||
@ -109,10 +109,11 @@ public class MacroData {
|
||||
rVal.characters.add(testChar);
|
||||
|
||||
//add a test character
|
||||
// Structure struct = Structure.
|
||||
// testChar.setPos(new Vector3d(ServerWorldData.convertChunkToRealSpace(new Vector3i(32774, 1, 32770))));
|
||||
// Race.setRace(testChar, Race.create("human", "human"));
|
||||
// rVal.characters.add(testChar);
|
||||
Structure struct = Structure.createStructure(
|
||||
Globals.gameConfigCurrent.getStructureData().getType("test1"),
|
||||
new Vector3d(ServerWorldData.convertChunkToRealSpace(new Vector3i(32774, 1, 32770)))
|
||||
);
|
||||
rVal.structures.add(struct);
|
||||
|
||||
//spawn initial characters in each race
|
||||
//find initial positions to place characters at per race
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.List;
|
||||
import org.joml.AABBd;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
import electrosphere.game.data.struct.StructureData;
|
||||
import electrosphere.server.macro.character.CharacterData;
|
||||
import electrosphere.server.macro.character.CharacterDataStrings;
|
||||
import electrosphere.server.macro.spatial.MacroAreaObject;
|
||||
@ -50,9 +51,24 @@ public class Structure extends CharacterData implements MacroAreaObject {
|
||||
* Constructor
|
||||
* @param dataType The data type of the structure
|
||||
*/
|
||||
public Structure(){
|
||||
private Structure(){
|
||||
super(CharacterDataStrings.STRUCTURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a structure
|
||||
* @param data The data
|
||||
* @param position The position
|
||||
* @return The structure
|
||||
*/
|
||||
public static Structure createStructure(StructureData data, Vector3d position){
|
||||
Structure rVal = new Structure();
|
||||
rVal.fabPath = data.getFabPath();
|
||||
rVal.type = data.getId();
|
||||
rVal.position = position;
|
||||
rVal.aabb = new AABBd(new Vector3d(0,0,0), data.getDimensions());
|
||||
return rVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts some data in the structure
|
||||
|
||||
Loading…
Reference in New Issue
Block a user