code cleanup
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-05-05 17:27:18 -04:00
parent 4a9d8a4f90
commit c72903794c
10 changed files with 15 additions and 63 deletions

View File

@ -2,7 +2,6 @@ package electrosphere.client.collision;
import org.joml.Vector3d;
import electrosphere.client.effects.ParticleEffects;
import electrosphere.engine.Globals;
import electrosphere.entity.Entity;
import electrosphere.entity.types.creature.CreatureUtils;
@ -100,7 +99,7 @@ public class ClientNetworkHitboxCollision {
if(isBlockSound){
//TODO: handle
} else if(isDamageSound){
ParticleEffects.spawnBloodsplats(position);
// ParticleEffects.spawnBloodsplats(position);
}
} else if(ItemUtils.isWeapon(receiverEntity)){
if(isBlockSound){

View File

@ -1,47 +0,0 @@
package electrosphere.client.effects;
// import electrosphere.client.entity.particle.ParticleUtils;
// import electrosphere.engine.Globals;
// import electrosphere.entity.ClientEntityUtils;
// import electrosphere.entity.Entity;
// import electrosphere.entity.EntityUtils;
// import electrosphere.game.data.particle.ParticleData;
// import java.util.Random;
// import org.joml.Quaterniond;
import org.joml.Vector3d;
/**
* Utility functions for spawning particle effects
*/
public class ParticleEffects {
/**
* Spawns bloodsplats based on a collision
* @param position The position of the collision
*/
public static void spawnBloodsplats(Vector3d position){
// int max = 30;
// int min = 10;
// ParticleData bloodsplatData = null;
// for(ParticleData data : Globals.gameConfigCurrent.getParticleDefinition().getData()){
// if(data.getName().equals("blood")){
// bloodsplatData = data;
// }
// }
// Random rand = new Random();
// int num = (int)(rand.nextFloat() * (max - min)) + min;
// for(int i = 0; i < num; i++){
// Vector3d destination = new Vector3d(rand.nextFloat() - 0.5f,rand.nextFloat() - 0.5f,rand.nextFloat() - 0.5f).normalize();
// Entity particleEntity = ParticleUtils.clientSpawnBillboardParticle(bloodsplatData, destination);
// ClientEntityUtils.initiallyPositionEntity(
// particleEntity,
// position,
// new Quaterniond()
// );
// EntityUtils.getScale(particleEntity).mul(bloodsplatData.getSize());
// }
}
}

View File

@ -1,4 +1,4 @@
package electrosphere.client.instancing;
package electrosphere.client.entity.instance;
import java.util.Set;

View File

@ -1,4 +1,4 @@
package electrosphere.client.leveledit;
package electrosphere.client.scene;
import org.joml.Vector3d;

View File

@ -4,8 +4,8 @@ import org.joml.Vector3d;
import electrosphere.client.entity.camera.CameraEntityUtils;
import electrosphere.client.entity.crosshair.Crosshair;
import electrosphere.client.entity.instance.InstanceUpdater;
import electrosphere.client.fluid.manager.ClientFluidManager;
import electrosphere.client.instancing.InstanceUpdater;
import electrosphere.client.interact.ClientInteractionEngine;
import electrosphere.client.terrain.manager.ClientTerrainManager;
import electrosphere.client.ui.menu.ingame.ToolbarPreviewWindow;

View File

@ -20,8 +20,8 @@ import electrosphere.client.entity.character.ClientCharacterManager;
import electrosphere.client.entity.particle.ParticleService;
import electrosphere.client.fluid.cells.FluidCellManager;
import electrosphere.client.fluid.manager.ClientFluidManager;
import electrosphere.client.leveledit.ClientLevelEditorData;
import electrosphere.client.player.ClientPlayerData;
import electrosphere.client.scene.ClientLevelEditorData;
import electrosphere.client.scene.ClientSceneWrapper;
import electrosphere.client.scene.ClientWorldData;
import electrosphere.client.sim.ClientSimulation;

View File

@ -404,7 +404,7 @@ public class ErosionSimulation {
* @param elevationMapToCheck The elevation map to reference
* @return True if all neighbors are flat, false otherwise
*/
private boolean neighborIsFlat(int sourceX, int sourceY, float[][] elevationMapToCheck){
protected boolean neighborIsFlat(int sourceX, int sourceY, float[][] elevationMapToCheck){
for(int i = 0; i < 4; i++){
if(sourceX + offsetX[i] >= 0 && sourceX + offsetX[i] < primaryHeightmap.length &&
sourceY + offsetY[i] >= 0 && sourceY + offsetY[i] < primaryHeightmap[0].length

View File

@ -39,8 +39,8 @@ class InterpolationDisplay extends JPanel{
}
}
} else if(parent.displayToggle == 1) {
for (int x = 0; x < parent.continentPhaseDimension * parent.EROSION_INTERPOLATION_RATIO; x++) {
for (int y = 0; y < parent.continentPhaseDimension * parent.EROSION_INTERPOLATION_RATIO; y++) {
for (int x = 0; x < parent.continentPhaseDimension * TerrainGenerator.EROSION_INTERPOLATION_RATIO; x++) {
for (int y = 0; y < parent.continentPhaseDimension * TerrainGenerator.EROSION_INTERPOLATION_RATIO; y++) {
if (parent.erosionHeightmap[x][y] > TerrainGenerator.MOUNTAIN_THRESHOLD - 1) {
float color = Math.max(0,Math.min(parent.erosionHeightmap[x][y],100));
g.setColor(new Color((int) (color / 100.0 * 254 * (parent.brightness / 100.0)), 1, 1));

View File

@ -247,7 +247,7 @@ class TectonicSimulation {
/**
* Moves the terrain around based on the vector field
*/
private void applyVectorsToElevation(){
protected void applyVectorsToElevation(){
//allocate new elevation array
for(int x = 0; x < DIMENSION; x++){
for(int y = 0; y < DIMENSION; y++){

View File

@ -272,7 +272,7 @@ public class TerrainGenerator {
for(int x = 0; x < dim_x; x++){
for(int y = 0; y < dim_y; y++){
int num_Water_Particles = water_level[x][y];
int elevation_Center = elevation[x][y];
// int elevation_Center = elevation[x][y];
int attractor_Values[] = new int[offset_kernel_size];
for(int j = 0; j < offset_kernel_size; j++) {
if(x + kernel_offset_x[j] >= 0 && x + kernel_offset_x[j] < dim_x && y + kernel_offset_y[j] >= 0 && y + kernel_offset_y[j] < dim_y) {
@ -968,7 +968,7 @@ public class TerrainGenerator {
int floodfill_Reach_Threshold(int[][] data, int[][] closed_Set, int x, int y, int min_val, int max_val){
int rVal = 0;
int num_hits;
// int num_hits;
int offset_X[] = {-1,-1,-1,0,0,0,1,1,1};
int offset_Y[] = {-1,0,1,-1,0,1,-1,0,1};
if(data[x][y] > min_val && data[x][y] < max_val){
@ -989,7 +989,7 @@ public class TerrainGenerator {
int[][] remove_Small_Mountain_Ranged(int[][] data){
int rVal[][] = new int[continentPhaseDimension][continentPhaseDimension];
boolean removed_Something = false;
// boolean removed_Something = false;
// for (int x = 0; x < DIMENSION; x++) {
// for (int y = 0; y < DIMENSION; y++) {
// rVal[x][y] = data[x][y];
@ -1247,7 +1247,7 @@ public class TerrainGenerator {
if(data[x][y] > TerrainGenerator.OCEAN_THRESHOLD && data[x][y] < 90){
//This is the total height that can be above land
//eg if ocean level is 25, and the maximum possible height is 100, the maximum height relative to sea level would be 75
int maxHeightAboveLand = MAX_HEIGHT - OCEAN_THRESHOLD;
// int maxHeightAboveLand = MAX_HEIGHT - OCEAN_THRESHOLD;
//This is the current height above sea level
int currentHeightAboveLand = data[x][y] - OCEAN_THRESHOLD;
//This is the percentage of the total height above sea level that the current height is
@ -1278,8 +1278,8 @@ public class TerrainGenerator {
/*
Looks at 3x3 kernel
*/
int kernel_offset_x[] = {-1,0,1,-1,0,1,-1,0,1};
int kernel_offset_y[] = {1,1,1,0,0,0,-1,-1,-1};
// int kernel_offset_x[] = {-1,0,1,-1,0,1,-1,0,1};
// int kernel_offset_y[] = {1,1,1,0,0,0,-1,-1,-1};
int rVal[][] = new int[100][100];
return rVal;
}