Compare commits
5 Commits
c3e028b9f8
...
62931e3273
| Author | SHA1 | Date | |
|---|---|---|---|
| 62931e3273 | |||
| f2cb866cd5 | |||
| 02196aa438 | |||
| e794c1f97a | |||
| 867a895c6e |
@@ -962,7 +962,8 @@ public class EditorApp extends Application {
|
||||
case CONTROL -> input.ctrlHeld = pressed;
|
||||
case ALT -> input.altHeld = pressed;
|
||||
case ENTER -> {
|
||||
if (pressed && input.activeLayer == SharedInput.LAYER_WATERFALL)
|
||||
if (pressed && (input.activeLayer == SharedInput.LAYER_WATERFALL
|
||||
|| input.activeLayer == SharedInput.LAYER_RIVER))
|
||||
input.finalizeWaterfallRequested = true;
|
||||
if (pressed && input.activeLayer == SharedInput.LAYER_VOXEL_CLIFF) {
|
||||
input.generateCliffVoxelsRequested = true;
|
||||
@@ -976,7 +977,8 @@ public class EditorApp extends Application {
|
||||
|| input.activeLayer == SharedInput.LAYER_ZONEN
|
||||
|| input.activeLayer == SharedInput.LAYER_WATER
|
||||
|| input.activeLayer == SharedInput.LAYER_WATERFALL
|
||||
|| input.activeLayer == SharedInput.LAYER_VOXEL_CLIFF))
|
||||
|| input.activeLayer == SharedInput.LAYER_VOXEL_CLIFF
|
||||
|| input.activeLayer == SharedInput.LAYER_RIVER))
|
||||
input.cancelZoneDrawing = true;
|
||||
else if (pressed && input.activeLayer == SharedInput.LAYER_OBJECTS
|
||||
&& "objecteditor".equals(registry.activeToolId()))
|
||||
@@ -1020,6 +1022,9 @@ public class EditorApp extends Application {
|
||||
input.deleteVoxelCliffZoneRequested = true;
|
||||
else if (input.activeLayer == SharedInput.LAYER_WATER)
|
||||
input.deleteWaterRequested = true;
|
||||
else if (input.activeLayer == SharedInput.LAYER_RIVER
|
||||
&& input.selectedWaterfallInfo != null)
|
||||
input.deleteWaterfallRequested = true;
|
||||
else if (input.activeLayer == SharedInput.LAYER_WATERFALL
|
||||
&& input.selectedWaterfallInfo != null) {
|
||||
Platform.runLater(() -> {
|
||||
@@ -1042,7 +1047,8 @@ public class EditorApp extends Application {
|
||||
}
|
||||
}
|
||||
case BACK_SPACE -> {
|
||||
if (pressed && input.activeLayer == SharedInput.LAYER_WATERFALL)
|
||||
if (pressed && (input.activeLayer == SharedInput.LAYER_WATERFALL
|
||||
|| input.activeLayer == SharedInput.LAYER_RIVER))
|
||||
input.undoWaterfallPointRequested = true;
|
||||
}
|
||||
case SPACE -> {
|
||||
|
||||
@@ -302,6 +302,8 @@ public class SharedInput {
|
||||
public volatile boolean objectSelectionChanged = false;
|
||||
/** Wird von JME3 gesetzt, wenn ein Objekt gerade neu platziert wurde (nicht nur selektiert). */
|
||||
public volatile boolean objectJustPlaced = false;
|
||||
/** JavaFX → JME3: Selektion sofort aufheben (z. B. nach Massenplatzierung). */
|
||||
public volatile boolean deselectAllRequest = false;
|
||||
/** Wird von JME3 gesetzt, wenn ein Objekt im Platzierungsmodus angeklickt wurde → JFX wechselt Panel zu Edit. */
|
||||
public volatile boolean objectClickedWhileInPlaceMode = false;
|
||||
|
||||
|
||||
@@ -416,6 +416,11 @@ public class SceneObjectState extends BaseAppState {
|
||||
|| input.activeLayer == SharedInput.LAYER_AUSWAHL;
|
||||
if (!isObjectLayer) return;
|
||||
|
||||
if (input.deselectAllRequest) {
|
||||
input.deselectAllRequest = false;
|
||||
deselectAll();
|
||||
}
|
||||
|
||||
if (input.deselectAllOnAuswahl) {
|
||||
input.deselectAllOnAuswahl = false;
|
||||
deselectAll();
|
||||
|
||||
@@ -2478,6 +2478,41 @@ public class VoxelEditorState extends BaseAppState {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Schritt 2c: Höhenfeld-Glättung ──────────────────────────────────
|
||||
// Schritt 2 (Waypoint-Interpolation) erzeugt an Stufen-Übergängen periodische
|
||||
// Höhenoszillationen: für eine Treppe 2,2,3,3,4,4 entstehen statt der idealen
|
||||
// 3, 3.5, 4, 4.5 die Werte 3.33, 3.67, 4.33, 4.67 — ein kleiner "Hügel" pro
|
||||
// Treppenstufe. Ursache: die Formel (h0·dUp + hUp·dDown)/(dUp+dDown) verwendet
|
||||
// h0 (aktuelle Rohhöhe) statt die ideale lineare Interpolation zwischen den
|
||||
// Ankerhöhen, was bei Zellen INNERHALB einer Stufe (mehrere Zellen gleicher
|
||||
// Höhe) unterschiedliche Ergebnisse je nach Position produziert.
|
||||
// Fix: 4 Passes eines XZ-Nachbarschafts-Mittelwerts glätten die Oszillationen
|
||||
// auf <0.05 m heraus (jeder Pass halbiert die Amplitude, bei 4 Passes fast
|
||||
// unsichtbar). Cliff-Schutz: keine Mittelung über Höhenunterschiede > 1.5 m.
|
||||
{
|
||||
final int HF_PASSES = 4;
|
||||
final float HF_CLIFF_THR = 1.5f;
|
||||
final long DX = 60001L; // X-Nachbar-Offset im hk-Schema
|
||||
for (int pass = 0; pass < HF_PASSES; pass++) {
|
||||
Map<Long, Float> next = new HashMap<>(smoothMap.size());
|
||||
for (Map.Entry<Long, Float> e : smoothMap.entrySet()) {
|
||||
long hk = e.getKey();
|
||||
float sh = e.getValue();
|
||||
float sum = sh;
|
||||
int cnt = 1;
|
||||
for (long delta : new long[]{ DX, -DX, 1L, -1L }) {
|
||||
Float nb = smoothMap.get(hk + delta);
|
||||
if (nb != null && Math.abs(nb - sh) <= HF_CLIFF_THR) {
|
||||
sum += nb;
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
next.put(hk, sum / cnt);
|
||||
}
|
||||
smoothMap = next;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Schritt 3: Dichte anpassen ────────────────────────────────────
|
||||
// ALLE Spalten aus hfMap bekommen den Dichte-Gradienten geschrieben, auch
|
||||
// Plateau-Spalten (smoothH==h0), nicht nur echte Rampen. Grund (gefunden
|
||||
|
||||
@@ -87,6 +87,8 @@ public class ObjectController implements ToolController {
|
||||
ctx.input().objectJustPlaced = false;
|
||||
if (multiPlaceCB == null || !multiPlaceCB.isSelected()) {
|
||||
showEditPanel();
|
||||
} else {
|
||||
ctx.input().deselectAllRequest = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -682,14 +684,14 @@ public class ObjectController implements ToolController {
|
||||
String prev = treeFolderCB.getValue();
|
||||
|
||||
Path treeRoot = de.blight.editor.ProjectRoot.resolve(
|
||||
"blight-assets", "src", "main", "resources", "trees");
|
||||
"blight-assets", "src", "main", "resources", "Models", "trees");
|
||||
java.util.List<String> items = new java.util.ArrayList<>();
|
||||
items.add("(keiner)");
|
||||
if (Files.isDirectory(treeRoot)) {
|
||||
try (var walk = Files.walk(treeRoot)) {
|
||||
walk.filter(Files::isDirectory)
|
||||
.filter(p -> !p.equals(treeRoot))
|
||||
.map(p -> "trees/" + treeRoot.relativize(p).toString()
|
||||
.map(p -> "Models/trees/" + treeRoot.relativize(p).toString()
|
||||
.replace(java.io.File.separatorChar, '/'))
|
||||
.sorted()
|
||||
.forEach(items::add);
|
||||
|
||||
@@ -112,6 +112,7 @@ public class WorldObjectsState extends BaseAppState {
|
||||
|
||||
// Baum-Stammkollision: Capsule statt Vollmesh (Blätter ausgeschlossen)
|
||||
String objPath = m.modelPath() != null ? m.modelPath() : "";
|
||||
boolean hasCustomCollision = objPath.startsWith("Models/trees/") || objPath.contains("/grapevine/");
|
||||
if (objPath.contains("/grapevine/") && bulletAppState != null) {
|
||||
try {
|
||||
s.updateGeometricState();
|
||||
@@ -149,8 +150,8 @@ public class WorldObjectsState extends BaseAppState {
|
||||
}
|
||||
}
|
||||
|
||||
// Physik-Kollision für solide Objekte
|
||||
if (m.solid() && bulletAppState != null) {
|
||||
// Physik-Kollision für solide Objekte (nicht für Bäume/Reben – die haben eigene Kollision oben)
|
||||
if (m.solid() && !hasCustomCollision && bulletAppState != null) {
|
||||
try {
|
||||
RigidBodyControl rbc = new RigidBodyControl(
|
||||
CollisionShapeFactory.createMeshShape(s), 0f);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,3 +15,15 @@ Models/imported/feuerstelle1.j3o 1.46137 2.00000 -1.08840 0.00000 1.00000 0.0000
|
||||
Models/trees/palm/palm_20260914_195434.j3o 226.76038 1.25643 -893.77020 -1.59663 1.00000 -0.00000 0.00000 true true true 50.00000 150.00000 300.00000 PALM
|
||||
Models/trees/willow/willow_20260914_210538.j3o 256.04678 5.84959 -887.66675 0.00000 1.00000 0.00000 0.00000 true true true 50.00000 150.00000 300.00000 TREE
|
||||
Models/imported/kampfdummy.j3o -5.95449 2.00000 -11.12527 0.00000 1.00000 0.00000 0.00000 true true true 30.00000 80.00000 120.00000 DUMMY
|
||||
Models/trees/willow/willow_20260914_210538.j3o 150.00494 2.94445 -13.38018 0.82411 1.00000 0.00000 0.00000 true true true 30.00000 80.00000 200.00000 TREE
|
||||
Models/trees/willow/willow_20260914_210538.j3o 172.12804 2.96088 -11.39893 1.61566 1.00000 0.00000 0.00000 true true true 30.00000 80.00000 200.00000 TREE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190953.j3o 164.84961 7.14919 15.62826 -3.10077 1.00000 -0.00000 0.00000 false true true 30.00000 80.00000 120.00000 NONE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190947.j3o 155.80219 9.33038 16.30900 2.93147 1.00000 0.00000 0.00000 false true true 30.00000 80.00000 120.00000 TREE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190939.j3o 143.65674 12.30280 20.52005 0.66436 1.00000 0.00000 0.00000 false true true 30.00000 80.00000 120.00000 TREE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190947.j3o 132.98308 15.19385 24.61456 -0.02996 1.00000 -0.00000 0.00000 false true true 30.00000 80.00000 120.00000 TREE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190953.j3o 130.20370 15.43188 16.47620 -0.60550 1.00000 -0.00000 0.00000 false true true 30.00000 80.00000 120.00000 NONE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190947.j3o 140.65765 13.16088 14.08950 -0.38551 1.00000 -0.00000 0.00000 false true true 30.00000 80.00000 120.00000 TREE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190939.j3o 148.62924 10.59328 11.05173 -0.38486 1.00000 -0.00000 0.00000 false true true 30.00000 80.00000 120.00000 TREE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190953.j3o 153.52829 9.72414 9.98234 -2.23312 1.00000 -0.00000 0.00000 false true true 30.00000 80.00000 120.00000 NONE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190939.j3o 163.28604 7.18056 7.21066 2.85147 1.00000 0.00000 0.00000 false true true 30.00000 80.00000 120.00000 TREE
|
||||
Models/trees/pine/medium/pine_medium_20260706_190947.j3o 170.87265 5.19999 5.21380 1.22752 1.00000 0.00000 0.00000 false true true 30.00000 80.00000 120.00000 TREE
|
||||
|
||||
@@ -17,6 +17,15 @@ NODE 64a2b232-6180-4f6d-9984-82820ac79053 - 298.20966 2.00000 -787.21967
|
||||
NODE 0bcd1776-f65a-4d2f-9f2f-b7cff6db8dc6 - 288.40808 2.00000 -778.93536
|
||||
NODE 2b4e0e77-30a4-4314-87ad-0d3582feffd0 - 280.04413 2.00000 -766.30432
|
||||
NODE 4f3a890b-a973-41fc-9798-d897209b12d0 - 295.18164 2.00000 -735.89783
|
||||
NODE dc84178e-8e5d-4058-8007-f461b3941e3e - 188.10376 2.00000 -35.48830
|
||||
NODE c8c402c4-3c57-4ba9-b90f-a041a1c4429b - 143.74843 2.00000 -41.34730
|
||||
NODE e6159e36-6bb6-42fc-bf83-6b7d89a154e2 - 142.37703 2.00000 -69.11337
|
||||
NODE 33a4ff36-2a29-4906-b67e-c7e48256bae5 - 166.54341 2.00000 -73.48456
|
||||
NODE caf74aa0-6e6a-40ab-8963-c4e17df9478d - 120.81595 2.00000 -51.75137
|
||||
NODE 6eb73cd5-8ee6-4019-9b51-99d3155d9fc9 - 121.83101 2.00000 -35.50373
|
||||
NODE 5cad7f6d-b6c4-4bac-b32e-821ca8f8b348 - 133.05113 2.00000 -8.61603
|
||||
NODE 4a6e0d27-a464-4ced-8e77-c19e41c6ecc2 - 115.20652 2.00000 -3.92155
|
||||
NODE 9b981e16-c816-4d04-b215-b356ada34427 - 114.16183 2.00000 9.23977
|
||||
EDGE c7fe03f3-736b-4d81-accb-27dd6649e000 fa3be430-7714-49ed-9a81-4e4fb45ba564
|
||||
EDGE fa3be430-7714-49ed-9a81-4e4fb45ba564 5618a5ba-d0a5-4897-ab4d-a4a2932edb18
|
||||
EDGE f8f01e21-3963-4530-a5d6-bfdd0cb77233 d886a17b-4ad0-4437-9dbf-6c0df951742f
|
||||
@@ -33,3 +42,12 @@ EDGE 64a2b232-6180-4f6d-9984-82820ac79053 7e3c1080-d37e-4fc9-b489-c0784f34fac1
|
||||
EDGE 64a2b232-6180-4f6d-9984-82820ac79053 0bcd1776-f65a-4d2f-9f2f-b7cff6db8dc6
|
||||
EDGE 0bcd1776-f65a-4d2f-9f2f-b7cff6db8dc6 2b4e0e77-30a4-4314-87ad-0d3582feffd0
|
||||
EDGE 2b4e0e77-30a4-4314-87ad-0d3582feffd0 4f3a890b-a973-41fc-9798-d897209b12d0
|
||||
EDGE dc84178e-8e5d-4058-8007-f461b3941e3e c8c402c4-3c57-4ba9-b90f-a041a1c4429b
|
||||
EDGE c8c402c4-3c57-4ba9-b90f-a041a1c4429b e6159e36-6bb6-42fc-bf83-6b7d89a154e2
|
||||
EDGE e6159e36-6bb6-42fc-bf83-6b7d89a154e2 33a4ff36-2a29-4906-b67e-c7e48256bae5
|
||||
EDGE 33a4ff36-2a29-4906-b67e-c7e48256bae5 dc84178e-8e5d-4058-8007-f461b3941e3e
|
||||
EDGE c8c402c4-3c57-4ba9-b90f-a041a1c4429b caf74aa0-6e6a-40ab-8963-c4e17df9478d
|
||||
EDGE caf74aa0-6e6a-40ab-8963-c4e17df9478d 6eb73cd5-8ee6-4019-9b51-99d3155d9fc9
|
||||
EDGE 6eb73cd5-8ee6-4019-9b51-99d3155d9fc9 5cad7f6d-b6c4-4bac-b32e-821ca8f8b348
|
||||
EDGE 5cad7f6d-b6c4-4bac-b32e-821ca8f8b348 4a6e0d27-a464-4ced-8e77-c19e41c6ecc2
|
||||
EDGE 4a6e0d27-a464-4ced-8e77-c19e41c6ecc2 9b981e16-c816-4d04-b215-b356ada34427
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# polygon_points waterHeight flowDegrees speed waveScale waveAmplitude transparency waterR waterG waterB deepR deepG deepB
|
||||
155.13664,11.00000,-898.11578;120.48705,11.00000,-897.61938;107.05534,11.00000,-890.41797;96.71703,11.00000,-875.01575;98.34164,11.00000,-854.85681;182.64165,11.00000,-829.23749;195.95512,11.00000,-848.04095 11.00000 180.0 0.5000 0.008000 0.10000 0.15000 0.05000 0.25000 0.55000 0.02000 0.12000 0.30000
|
||||
219.67131,1.90000,-796.04559;197.17520,1.90000,-800.89313;192.60945,1.90000,-797.65149;190.13742,1.90000,-767.83209;221.88794,1.90000,-767.83209 1.90000 0.0 0.5000 0.008000 0.10000 0.15000 0.05000 0.25000 0.55000 0.02000 0.12000 0.30000
|
||||
145.45116,2.80000,4.87381;163.20361,2.80000,3.51198;172.70294,2.80000,2.84045;175.18158,2.80000,-1.35778;174.98405,2.80000,-7.36192;171.01855,2.80000,-12.93119;156.72575,2.80000,-17.72083;143.90723,2.80000,-10.86586 2.80000 0.0 0.5000 0.008000 0.10000 0.15000 0.10196 0.30196 0.10196 0.02000 0.12000 0.30000
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user