Weitere Bugfixes und kleine Feature Erweiterungen

This commit is contained in:
2026-08-10 19:41:32 +02:00
parent 753af2dc13
commit 145db8317f
20 changed files with 652 additions and 211 deletions

View File

@@ -290,7 +290,8 @@ public class PlacedObjectState extends BaseAppState {
}
private void paintGrass(float cx, float cz, float radius) {
int n = Math.max(1, (int) input.grassTool.density.getValue());
int n = (int) Math.round(input.grassTool.density.getValue() * radius * 2.0);
if (n <= 0) return;
float baseH = (float) input.grassTool.grassHeight.getValue();
int slot = input.grassActiveSlot;
Random rng = new Random();
@@ -423,13 +424,13 @@ public class PlacedObjectState extends BaseAppState {
pos.put(x+w).put(y ).put(z); uv.put(1).put(0);
pos.put(x+w).put(y+h).put(z); uv.put(1).put(1);
pos.put(x-w).put(y+h).put(z); uv.put(0).put(1);
for (int i = 0; i < 4; i++) { nor.put(0).put(0).put(1); tan.put(1).put(0).put(0).put(1); }
// Quad 2: liegt in ZY-Ebene (konstantes x) Normal zeigt -X, Tangent zeigt +Z
for (int i = 0; i < 4; i++) { nor.put(0).put(1).put(0); tan.put(1).put(0).put(0).put(1); }
// Quad 2: liegt in ZY-Ebene (konstantes x) Normal zeigt +Y, Tangent zeigt +Z
pos.put(x).put(y ).put(z-w); uv.put(0).put(0);
pos.put(x).put(y ).put(z+w); uv.put(1).put(0);
pos.put(x).put(y+h).put(z+w); uv.put(1).put(1);
pos.put(x).put(y+h).put(z-w); uv.put(0).put(1);
for (int i = 0; i < 4; i++) { nor.put(-1).put(0).put(0); tan.put(0).put(0).put(1).put(1); }
for (int i = 0; i < 4; i++) { nor.put(0).put(1).put(0); tan.put(0).put(0).put(1).put(1); }
idx.put(vi).put(vi+1).put(vi+2);
idx.put(vi).put(vi+2).put(vi+3);
idx.put(vi+4).put(vi+5).put(vi+6);

View File

@@ -7,9 +7,9 @@ import java.util.List;
*/
public class GrassTool extends EditorTool {
public final ToolParameter brushRadius = new ToolParameter("Pinselradius", 40.0, 1.0, 500.0);
public final ToolParameter grassHeight = new ToolParameter("Grashöhe", 1.5, 0.1, 10.0);
public final ToolParameter density = new ToolParameter("Dichte", 8.0, 1.0, 200.0);
public final ToolParameter brushRadius = new ToolParameter("Pinselradius", 5.0, 1.0, 50.0);
public final ToolParameter grassHeight = new ToolParameter("Grashöhe", 0.8, 0.0, 2.0);
public final ToolParameter density = new ToolParameter("Dichte", 0.5, 0.0, 2.0);
@Override public String getName() { return "Gras (Textur)"; }