documentation, bug fixes
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
@ -334,7 +334,7 @@
|
|||||||
"maxHealth" : 100,
|
"maxHealth" : 100,
|
||||||
"onDamageIFrames" : 30
|
"onDamageIFrames" : 30
|
||||||
},
|
},
|
||||||
"modelPath" : "Models/baseman5.glb"
|
"modelPath" : "Models/person2_1.glb"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"files" : []
|
"files" : []
|
||||||
|
|||||||
@ -22,28 +22,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path" : "Models/proceduralTree1/proceduralTrunk1.fbx",
|
|
||||||
"meshes" : [
|
|
||||||
{
|
|
||||||
"meshName" : "Cube",
|
|
||||||
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
|
||||||
"offset" : [0.0, 0.0, 0.0],
|
|
||||||
"scale" : [1.0, 1.0, 1.0]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path" : "Models/proceduralTree2/proceduralTree2.fbx",
|
|
||||||
"meshes" : [
|
|
||||||
{
|
|
||||||
"meshName" : "Trunk",
|
|
||||||
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
|
||||||
"offset" : [0.0, 0.0, 0.0],
|
|
||||||
"scale" : [1.0, 1.0, 1.0]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path" : "Models/proceduralTree2/proceduralTree2v2.fbx",
|
"path" : "Models/proceduralTree2/proceduralTree2v2.fbx",
|
||||||
"meshes" : [
|
"meshes" : [
|
||||||
@ -51,7 +29,30 @@
|
|||||||
"meshName" : "Trunk",
|
"meshName" : "Trunk",
|
||||||
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
||||||
"offset" : [0.0, 0.0, 0.0],
|
"offset" : [0.0, 0.0, 0.0],
|
||||||
"scale" : [1.0, 1.0, 1.0]
|
"scale" : [100.0, 100.0, 100.0]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "Models/foliageBlockTemplate1Test1.fbx",
|
||||||
|
"meshes" : [
|
||||||
|
{
|
||||||
|
"meshName" : "Plane",
|
||||||
|
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
||||||
|
"offset" : [0.0, 0.0, 0.0],
|
||||||
|
"scale" : [100.0, 100.0, 100.0]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"meshName" : "Plane.001",
|
||||||
|
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
||||||
|
"offset" : [0.0, 0.0, 0.0],
|
||||||
|
"scale" : [100.0, 100.0, 100.0]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"meshName" : "Plane.002",
|
||||||
|
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
||||||
|
"offset" : [0.0, 0.0, 0.0],
|
||||||
|
"scale" : [100.0, 100.0, 100.0]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -65,6 +66,16 @@
|
|||||||
"meshes" : [
|
"meshes" : [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path" : "Models/person2_1.glb",
|
||||||
|
"globalTransform": {
|
||||||
|
"rotation" : [0,0,0,1],
|
||||||
|
"offset" : [0.0, 0.0, 0.0],
|
||||||
|
"scale" : [0.6, 0.6, 0.6]
|
||||||
|
},
|
||||||
|
"meshes" : [
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path" : "Models/grass2.fbx",
|
"path" : "Models/grass2.fbx",
|
||||||
"globalTransform": {
|
"globalTransform": {
|
||||||
@ -77,7 +88,7 @@
|
|||||||
"meshName" : "Plane",
|
"meshName" : "Plane",
|
||||||
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
"rotation" : [-0.7071068, 0.0, 0.0, 0.7071068],
|
||||||
"offset" : [0.0, 0.0, 0.0],
|
"offset" : [0.0, 0.0, 0.0],
|
||||||
"scale" : [1.0, 1.0, 1.0]
|
"scale" : [100.0, 100.0, 100.0]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
assets/Models/person2_1.glb
Normal file
BIN
assets/Models/shorts.glb
Normal file
@ -1,3 +1,3 @@
|
|||||||
#maven.buildNumber.plugin properties file
|
#maven.buildNumber.plugin properties file
|
||||||
#Sat Apr 13 21:46:23 EDT 2024
|
#Sun Apr 14 15:53:43 EDT 2024
|
||||||
buildNumber=96
|
buildNumber=98
|
||||||
|
|||||||
68
docs/src/blender/BasicClothingGuide.md
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
@page BasicClothingGuide Basic Clothing Guide
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## High Level Overview
|
||||||
|
The idea of this page is to track notes about creating simple clothing items that work with existing creature models.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Setting Up The File
|
||||||
|
Create a new blender file.
|
||||||
|
|
||||||
|
Link the armature from the existing creature model.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Append the relevant meshes from the existing creature model.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Clean up the existing mesh
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
You can use the circle select mode to significantly speed up selection of vertices to delete
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Attach Armature
|
||||||
|
|
||||||
|
Add the armature modifier to the mesh you have created
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Select the dropper icon for Object
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
And click on the armature object in the tree view in the top right
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
You can validate that it added the modifier correctly by selecting the bones, going into pose mode, and setting the pose to watch the mesh move.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Solidify Modifier
|
||||||
|
|
||||||
|
Add the solidify modifier to make the clothing have depth
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
- @subpage WeavingMeshes
|
- @subpage WeavingMeshes
|
||||||
|
- @subpage BasicClothingGuide
|
||||||
|
After Width: | Height: | Size: 47 KiB |
BIN
docs/src/images/blender/basicClothing/clothingAppend.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 133 KiB |
BIN
docs/src/images/blender/basicClothing/clothingLinkOption.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 18 KiB |
BIN
docs/src/images/blender/basicClothing/clothingTestWithPose.png
Normal file
|
After Width: | Height: | Size: 184 KiB |
@ -218,6 +218,7 @@ Terrain editing UI
|
|||||||
(04/13/2024)
|
(04/13/2024)
|
||||||
UI Work
|
UI Work
|
||||||
- Level editor ability to destroy an entity on server, have it also destroy on client, AND not persist on save
|
- Level editor ability to destroy an entity on server, have it also destroy on client, AND not persist on save
|
||||||
|
- Environment controls (not persisting in save yet)
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,11 @@ import electrosphere.logger.LoggerInterface;
|
|||||||
*/
|
*/
|
||||||
public class CollisionEngine {
|
public class CollisionEngine {
|
||||||
|
|
||||||
|
//step interval time size
|
||||||
public static final float ENGINE_STEP_SIZE = 0.01f;
|
public static final float ENGINE_STEP_SIZE = 0.01f;
|
||||||
|
|
||||||
|
//gravity constant
|
||||||
|
public static final float GRAVITY_MAGNITUDE = 9.8f;
|
||||||
|
|
||||||
//world data that the collision engine leverages for position correction and the like
|
//world data that the collision engine leverages for position correction and the like
|
||||||
CollisionWorldData collisionWorldData;
|
CollisionWorldData collisionWorldData;
|
||||||
@ -88,13 +92,10 @@ public class CollisionEngine {
|
|||||||
//callbacks for collision check
|
//callbacks for collision check
|
||||||
RayCastCallback rayCastCallback = new RayCastCallback();
|
RayCastCallback rayCastCallback = new RayCastCallback();
|
||||||
|
|
||||||
//physics damping
|
|
||||||
static final float linearDamping = 0.02f;
|
|
||||||
|
|
||||||
public CollisionEngine(){
|
public CollisionEngine(){
|
||||||
world = OdeHelper.createWorld();
|
world = OdeHelper.createWorld();
|
||||||
space = OdeHelper.createBHVSpace(Collidable.TYPE_STATIC_BIT);
|
space = OdeHelper.createBHVSpace(Collidable.TYPE_STATIC_BIT);
|
||||||
world.setGravity(0,-3,0);
|
world.setGravity(0,-GRAVITY_MAGNITUDE,0);
|
||||||
contactgroup = OdeHelper.createJointGroup();
|
contactgroup = OdeHelper.createJointGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import static org.lwjgl.glfw.GLFW.GLFW_KEY_E;
|
|||||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_ENTER;
|
import static org.lwjgl.glfw.GLFW.GLFW_KEY_ENTER;
|
||||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_ESCAPE;
|
import static org.lwjgl.glfw.GLFW.GLFW_KEY_ESCAPE;
|
||||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_F;
|
import static org.lwjgl.glfw.GLFW.GLFW_KEY_F;
|
||||||
|
import static org.lwjgl.glfw.GLFW.GLFW_KEY_F2;
|
||||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_F24;
|
import static org.lwjgl.glfw.GLFW.GLFW_KEY_F24;
|
||||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_G;
|
import static org.lwjgl.glfw.GLFW.GLFW_KEY_G;
|
||||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_H;
|
import static org.lwjgl.glfw.GLFW.GLFW_KEY_H;
|
||||||
@ -94,9 +95,9 @@ import electrosphere.entity.types.creature.CreatureUtils;
|
|||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
import electrosphere.menu.WindowStrings;
|
import electrosphere.menu.WindowStrings;
|
||||||
import electrosphere.menu.WindowUtils;
|
import electrosphere.menu.WindowUtils;
|
||||||
|
import electrosphere.menu.debug.ImGuiWindowMacros;
|
||||||
import electrosphere.menu.ingame.MenuGeneratorsInGame;
|
import electrosphere.menu.ingame.MenuGeneratorsInGame;
|
||||||
import electrosphere.menu.ingame.MenuGeneratorsInventory;
|
import electrosphere.menu.ingame.MenuGeneratorsInventory;
|
||||||
import electrosphere.menu.mainmenu.MenuGeneratorsDebug;
|
|
||||||
import electrosphere.renderer.ui.elements.Window;
|
import electrosphere.renderer.ui.elements.Window;
|
||||||
import electrosphere.renderer.ui.events.ClickEvent;
|
import electrosphere.renderer.ui.events.ClickEvent;
|
||||||
import electrosphere.renderer.ui.events.KeyboardEvent;
|
import electrosphere.renderer.ui.events.KeyboardEvent;
|
||||||
@ -378,7 +379,7 @@ public class ControlHandler {
|
|||||||
Debug controls
|
Debug controls
|
||||||
*/
|
*/
|
||||||
handler.addControl(DATA_STRING_INPUT_CODE_DEBUG_SPAWN_ITEM, new Control(ControlType.KEY,GLFW_KEY_Q));
|
handler.addControl(DATA_STRING_INPUT_CODE_DEBUG_SPAWN_ITEM, new Control(ControlType.KEY,GLFW_KEY_Q));
|
||||||
handler.addControl(DEBUG_OPEN_DEBUG_MENU, new Control(ControlType.KEY, GLFW_KEY_O));
|
handler.addControl(DEBUG_OPEN_DEBUG_MENU, new Control(ControlType.KEY, GLFW_KEY_F2));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
return
|
return
|
||||||
@ -980,7 +981,9 @@ public class ControlHandler {
|
|||||||
Vector3d eyePos = new Vector3d(CameraEntityUtils.getCameraEye(camera));
|
Vector3d eyePos = new Vector3d(CameraEntityUtils.getCameraEye(camera));
|
||||||
Vector3d centerPos = new Vector3d(CameraEntityUtils.getCameraCenter(camera));
|
Vector3d centerPos = new Vector3d(CameraEntityUtils.getCameraCenter(camera));
|
||||||
Vector3d cursorPos = collisionEngine.rayCastPosition(new Vector3d(centerPos), new Vector3d(eyePos).mul(-1.0), 5.0);
|
Vector3d cursorPos = collisionEngine.rayCastPosition(new Vector3d(centerPos), new Vector3d(eyePos).mul(-1.0), 5.0);
|
||||||
TerrainEditing.editTerrain(cursorPos, 1.1f, 2, 0.01f);
|
if(Globals.clientSelectedVoxelType != null){
|
||||||
|
TerrainEditing.editTerrain(cursorPos, 1.1f, Globals.clientSelectedVoxelType.getId(), 0.1f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
controls.get(INPUT_CODE_PLACE_TERRAIN).setOnRepeat(new ControlMethod(){public void execute(){
|
controls.get(INPUT_CODE_PLACE_TERRAIN).setOnRepeat(new ControlMethod(){public void execute(){
|
||||||
@ -993,7 +996,9 @@ public class ControlHandler {
|
|||||||
Vector3d eyePos = new Vector3d(CameraEntityUtils.getCameraEye(camera));
|
Vector3d eyePos = new Vector3d(CameraEntityUtils.getCameraEye(camera));
|
||||||
Vector3d centerPos = new Vector3d(CameraEntityUtils.getCameraCenter(camera));
|
Vector3d centerPos = new Vector3d(CameraEntityUtils.getCameraCenter(camera));
|
||||||
Vector3d cursorPos = collisionEngine.rayCastPosition(new Vector3d(centerPos), new Vector3d(eyePos).mul(-1.0), 5.0);
|
Vector3d cursorPos = collisionEngine.rayCastPosition(new Vector3d(centerPos), new Vector3d(eyePos).mul(-1.0), 5.0);
|
||||||
TerrainEditing.editTerrain(cursorPos, 1.1f, 2, 0.01f);
|
if(Globals.clientSelectedVoxelType != null){
|
||||||
|
TerrainEditing.editTerrain(cursorPos, 1.1f, Globals.clientSelectedVoxelType.getId(), 0.1f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
controls.get(INPUT_CODE_PLACE_TERRAIN).setRepeatTimeout(0.2f * Main.targetFrameRate);
|
controls.get(INPUT_CODE_PLACE_TERRAIN).setRepeatTimeout(0.2f * Main.targetFrameRate);
|
||||||
@ -1049,14 +1054,7 @@ public class ControlHandler {
|
|||||||
alwaysOnDebugControlList.add(controls.get(DEBUG_OPEN_DEBUG_MENU));
|
alwaysOnDebugControlList.add(controls.get(DEBUG_OPEN_DEBUG_MENU));
|
||||||
controls.get(DEBUG_OPEN_DEBUG_MENU).setOnPress(new ControlMethod(){public void execute(){
|
controls.get(DEBUG_OPEN_DEBUG_MENU).setOnPress(new ControlMethod(){public void execute(){
|
||||||
LoggerInterface.loggerEngine.INFO("open debug menu");
|
LoggerInterface.loggerEngine.INFO("open debug menu");
|
||||||
// Window mainMenuWindow = new Window(0, 0, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT);
|
ImGuiWindowMacros.toggleMainDebugMenu();
|
||||||
Window mainMenuInGame = MenuGeneratorsDebug.createTopLevelDebugMenu();
|
|
||||||
// mainMenuWindow.addChild(mainMenuInGame);
|
|
||||||
Globals.elementManager.registerWindow(WindowStrings.WINDOW_DEBUG, mainMenuInGame);
|
|
||||||
WindowUtils.recursiveSetVisible(Globals.elementManager.getWindow(WindowStrings.WINDOW_DEBUG), true);
|
|
||||||
Globals.elementManager.focusFirstElement();
|
|
||||||
Globals.controlHandler.setHandlerState(ControlsState.IN_GAME_MAIN_MENU);
|
|
||||||
Globals.controlHandler.showMouse();
|
|
||||||
//play sound effect
|
//play sound effect
|
||||||
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/openMenu.ogg", VirtualAudioSourceType.UI, false);
|
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/openMenu.ogg", VirtualAudioSourceType.UI, false);
|
||||||
}});
|
}});
|
||||||
|
|||||||
@ -450,6 +450,10 @@ public class Globals {
|
|||||||
//game config
|
//game config
|
||||||
gameConfigDefault = electrosphere.game.data.Config.loadDefaultConfig();
|
gameConfigDefault = electrosphere.game.data.Config.loadDefaultConfig();
|
||||||
gameConfigCurrent = gameConfigDefault;
|
gameConfigCurrent = gameConfigDefault;
|
||||||
|
|
||||||
|
//
|
||||||
|
//Values that depend on the loaded config
|
||||||
|
Globals.clientSelectedVoxelType = (VoxelType)gameConfigCurrent.getVoxelData().getTypes().toArray()[1];
|
||||||
//player manager
|
//player manager
|
||||||
playerManager = new PlayerManager();
|
playerManager = new PlayerManager();
|
||||||
//behavior tree tracking service
|
//behavior tree tracking service
|
||||||
|
|||||||
@ -146,9 +146,9 @@ public class Main {
|
|||||||
|
|
||||||
//uncomment to test loading a model into engine
|
//uncomment to test loading a model into engine
|
||||||
// if(1==1){
|
// if(1==1){
|
||||||
// Globals.assetManager.addModelPathToQueue("/Models/tank1.fbx");
|
// Globals.assetManager.addModelPathToQueue("/Models/baseman9.glb");
|
||||||
// Globals.assetManager.loadAssetsInQueue();
|
// Globals.assetManager.loadAssetsInQueue();
|
||||||
// Model model = Globals.assetManager.fetchModel("/Models/tank1.fbx");
|
// Model model = Globals.assetManager.fetchModel("/Models/baseman9.glb");
|
||||||
// // for(electrosphere.renderer.anim.Animation anim : model.animations){
|
// // for(electrosphere.renderer.anim.Animation anim : model.animations){
|
||||||
// // if(anim.name.equals("Armature|Idle1")){
|
// // if(anim.name.equals("Armature|Idle1")){
|
||||||
// // System.out.println(anim.duration);
|
// // System.out.println(anim.duration);
|
||||||
@ -161,7 +161,8 @@ public class Main {
|
|||||||
// // break;
|
// // break;
|
||||||
// // }
|
// // }
|
||||||
// // }
|
// // }
|
||||||
// model.animations.get(0).fullDescribeAnimation();
|
// model.describeHighLevel();
|
||||||
|
// // model.animations.get(0).fullDescribeAnimation();
|
||||||
// // model.describeHighLevel();
|
// // model.describeHighLevel();
|
||||||
// System.exit(0);
|
// System.exit(0);
|
||||||
// }
|
// }
|
||||||
|
|||||||
@ -28,8 +28,7 @@ import org.ode4j.ode.DBody;
|
|||||||
import org.ode4j.ode.DWorld;
|
import org.ode4j.ode.DWorld;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Manages all assets loaded into the engine including initially loading and destructing
|
||||||
* @author amaterasu
|
|
||||||
*/
|
*/
|
||||||
public class AssetManager {
|
public class AssetManager {
|
||||||
|
|
||||||
|
|||||||
@ -226,7 +226,7 @@ public class ClientLoading {
|
|||||||
|
|
||||||
Entity cursorTracker = EntityCreationUtils.createClientSpatialEntity();
|
Entity cursorTracker = EntityCreationUtils.createClientSpatialEntity();
|
||||||
EntityCreationUtils.makeEntityDrawable(cursorTracker, "Models/unitsphere_1.fbx");
|
EntityCreationUtils.makeEntityDrawable(cursorTracker, "Models/unitsphere_1.fbx");
|
||||||
EntityUtils.getScale(cursorTracker).set(0.3f);
|
EntityUtils.getScale(cursorTracker).set(30f);
|
||||||
Globals.clientSceneWrapper.getScene().registerBehaviorTree(new BehaviorTree() {
|
Globals.clientSceneWrapper.getScene().registerBehaviorTree(new BehaviorTree() {
|
||||||
@Override
|
@Override
|
||||||
public void simulate(float deltaTime) {
|
public void simulate(float deltaTime) {
|
||||||
|
|||||||
@ -215,22 +215,22 @@ public class ServerGroundMovementTree implements BehaviorTree {
|
|||||||
case SETFACING:
|
case SETFACING:
|
||||||
break;
|
break;
|
||||||
case MOVEUPDATE: {
|
case MOVEUPDATE: {
|
||||||
if(updateTime > lastUpdateTime){
|
if(updateTime >= lastUpdateTime){
|
||||||
lastUpdateTime = updateTime;
|
lastUpdateTime = updateTime;
|
||||||
switch(message.gettreeState()){
|
switch(message.gettreeState()){
|
||||||
case 0:
|
case 0:
|
||||||
state = MovementTreeState.STARTUP;
|
state = MovementTreeState.STARTUP;
|
||||||
// System.out.println("Set state STARTUP");
|
// System.out.println("Set state STARTUP");
|
||||||
GravityUtils.serverAttemptActivateGravity(parent);
|
GravityUtils.serverAttemptActivateGravity(parent);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
state = MovementTreeState.MOVE;
|
state = MovementTreeState.MOVE;
|
||||||
// System.out.println("Set state MOVE");
|
// System.out.println("Set state MOVE");
|
||||||
GravityUtils.serverAttemptActivateGravity(parent);
|
GravityUtils.serverAttemptActivateGravity(parent);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
state = MovementTreeState.SLOWDOWN;
|
state = MovementTreeState.SLOWDOWN;
|
||||||
// System.out.println("Set state SLOWDOWN");
|
// System.out.println("Set state SLOWDOWN");
|
||||||
GravityUtils.serverAttemptActivateGravity(parent);
|
GravityUtils.serverAttemptActivateGravity(parent);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
|||||||
@ -241,4 +241,11 @@ public class ImGuiWindowMacros {
|
|||||||
RenderingEngine.addImGuiWindow(mainDebugWindow);
|
RenderingEngine.addImGuiWindow(mainDebugWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggles the open state of the menu
|
||||||
|
*/
|
||||||
|
public static void toggleMainDebugMenu(){
|
||||||
|
mainDebugWindow.setOpen(!mainDebugWindow.isOpen());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,9 @@ public class MenuGeneratorsLevelEditor {
|
|||||||
//width of the side panel
|
//width of the side panel
|
||||||
static final int SIDE_PANEL_WIDTH = 500;
|
static final int SIDE_PANEL_WIDTH = 500;
|
||||||
|
|
||||||
|
//is the voxel selection window open
|
||||||
|
static boolean voxelWindowOpen = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the level editor side panel top view
|
* Creates the level editor side panel top view
|
||||||
@ -106,7 +109,13 @@ public class MenuGeneratorsLevelEditor {
|
|||||||
|
|
||||||
//select voxel button
|
//select voxel button
|
||||||
scrollable.addChild(Button.createButton("Select Voxel Type", new ClickEventCallback() {public boolean execute(ClickEvent event){
|
scrollable.addChild(Button.createButton("Select Voxel Type", new ClickEventCallback() {public boolean execute(ClickEvent event){
|
||||||
WindowUtils.replaceWindow(WindowStrings.VOXEL_TYPE_SELECTION,MenuGeneratorsTerrainEditing.createVoxelTypeSelectionPanel());
|
if(voxelWindowOpen){
|
||||||
|
voxelWindowOpen = false;
|
||||||
|
WindowUtils.closeWindow(WindowStrings.VOXEL_TYPE_SELECTION);
|
||||||
|
} else {
|
||||||
|
voxelWindowOpen = true;
|
||||||
|
WindowUtils.replaceWindow(WindowStrings.VOXEL_TYPE_SELECTION,MenuGeneratorsTerrainEditing.createVoxelTypeSelectionPanel());
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}}));
|
}}));
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,14 @@ public class ImGuiWindow {
|
|||||||
this.open.set(open);
|
this.open.set(open);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether the window is open or not
|
||||||
|
* @return true if open, false otherwise
|
||||||
|
*/
|
||||||
|
public boolean isOpen(){
|
||||||
|
return this.open.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An optional callback for the window that lets you directly call imgui functions
|
* An optional callback for the window that lets you directly call imgui functions
|
||||||
|
|||||||
@ -475,10 +475,13 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
|
|||||||
//update terrain
|
//update terrain
|
||||||
serverTerrainManager.deformTerrainAtLocationToValue(worldPosition, voxelPosition, weight, type);
|
serverTerrainManager.deformTerrainAtLocationToValue(worldPosition, voxelPosition, weight, type);
|
||||||
//broadcast update to terrain
|
//broadcast update to terrain
|
||||||
groundDataCells.get(getServerDataCellKey(worldPosition)).broadcastNetworkMessage(TerrainMessage.constructUpdateVoxelMessage(
|
ServerDataCell cell = groundDataCells.get(getServerDataCellKey(worldPosition));
|
||||||
worldPosition.x, worldPosition.y, worldPosition.z,
|
if(cell != null){
|
||||||
voxelPosition.x, voxelPosition.y, voxelPosition.z,
|
cell.broadcastNetworkMessage(TerrainMessage.constructUpdateVoxelMessage(
|
||||||
weight, type));
|
worldPosition.x, worldPosition.y, worldPosition.z,
|
||||||
|
voxelPosition.x, voxelPosition.y, voxelPosition.z,
|
||||||
|
weight, type));
|
||||||
|
}
|
||||||
terrainEditLock.release();
|
terrainEditLock.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||