Compare commits
2 Commits
93a3c266e1
...
238776cfde
| Author | SHA1 | Date | |
|---|---|---|---|
| 238776cfde | |||
| 60741d3116 |
Binary file not shown.
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
#Mon Oct 12 14:17:44 CEST 2026
|
||||
#Mon Oct 19 14:39:04 CEST 2026
|
||||
attachedEmitters.count=0
|
||||
attachedLights.count=0
|
||||
attachedSounds.count=0
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
#Thu Oct 15 15:05:26 CEST 2026
|
||||
#Mon Oct 19 14:39:11 CEST 2026
|
||||
attachedEmitters.count=0
|
||||
attachedLights.count=0
|
||||
attachedSounds.count=0
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
"damage": 50,
|
||||
"grip": {
|
||||
"posX": 0.10248406,
|
||||
"posY": 0.104730606,
|
||||
"posY": 0.10473058,
|
||||
"posZ": 0.4630257,
|
||||
"rotX": 0.0,
|
||||
"rotY": 0.0,
|
||||
"rotZ": 0.0,
|
||||
"grip2PosX": 0.0024840608,
|
||||
"grip2PosY": 0.104730606,
|
||||
"grip2PosY": 0.10473058,
|
||||
"grip2PosZ": 0.6630257,
|
||||
"handOffsetX": 0.0,
|
||||
"handOffsetY": 0.0,
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
"damage": 0,
|
||||
"grip": {
|
||||
"posX": 0.1114975,
|
||||
"posY": 0.07676052,
|
||||
"posZ": -0.27503356,
|
||||
"posY": 0.07795838,
|
||||
"posZ": 0.36503196,
|
||||
"rotX": 0.0,
|
||||
"rotY": 0.0,
|
||||
"rotZ": 0.0,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"SWORD": {
|
||||
"handOffX": 0.105,
|
||||
"handOffY": 0.1,
|
||||
"handOffZ": 0.5,
|
||||
"handOffX": 0.095,
|
||||
"handOffY": 0.045,
|
||||
"handOffZ": 0.645,
|
||||
"hand2OffX": 0.0,
|
||||
"hand2OffY": 0.0,
|
||||
"hand2OffZ": 0.0
|
||||
|
||||
@@ -174,7 +174,7 @@ public class EditorApp extends Application {
|
||||
animPreviewController = new de.blight.editor.toolset.anim.AnimPreviewController(toolCtx);
|
||||
animSetController = new de.blight.editor.toolset.anim.AnimSetController(toolCtx);
|
||||
objectController = new de.blight.editor.toolset.object.ObjectController(toolCtx);
|
||||
modelEditorController = new de.blight.editor.toolset.model.ModelEditorController(toolCtx, () -> assetController.openOverlay());
|
||||
modelEditorController = new de.blight.editor.toolset.model.ModelEditorController(toolCtx, () -> { assetController.openOverlay(); assetController.expandModelsNode(); });
|
||||
modelEditorController.setObjectController(objectController);
|
||||
atmosphereController = new de.blight.editor.toolset.atmosphere.AtmosphereController(toolCtx);
|
||||
waterController = new de.blight.editor.toolset.water.WaterController(toolCtx);
|
||||
|
||||
@@ -1551,7 +1551,7 @@ public class ModelEditorState extends BaseAppState {
|
||||
|
||||
// Schritt 3: Richtung A→B auf +Z ausrichten
|
||||
Vector3f bladeDir = B.subtract(A).normalizeLocal();
|
||||
if (bladeDir.z < 0) bladeDir.negateLocal(); // +Z-Richtung bevorzugen
|
||||
if (bladeDir.z > 0) bladeDir.negateLocal(); // -Z-Richtung bevorzugen
|
||||
Quaternion rot1 = awRotateToZ(bladeDir);
|
||||
|
||||
// Mitte der Hauptachse → Ursprung
|
||||
@@ -1609,11 +1609,11 @@ public class ModelEditorState extends BaseAppState {
|
||||
float guardNorm = (float) guardBucket / (BKTS - 1);
|
||||
log.info("[ModelEditor] AlignWeapon: Parierstange bei normZ={} (Bucket {}/{})",
|
||||
String.format("%.2f", guardNorm), guardBucket, BKTS);
|
||||
if (guardNorm > 0.5f) {
|
||||
// Parierstange in +Z-Hälfte → Pommel bei +Z, Klinge bei -Z → 180° um X flippen
|
||||
if (guardNorm < 0.5f) {
|
||||
// Parierstange in -Z-Hälfte → Pommel bei -Z, Klinge bei +Z → 180° um X flippen
|
||||
Quaternion flip = new Quaternion().fromAngles(FastMath.PI, 0f, 0f);
|
||||
combined = flip.mult(combined);
|
||||
log.info("[ModelEditor] AlignWeapon: Pommel bei +Z detektiert → Schwert geflippt");
|
||||
log.info("[ModelEditor] AlignWeapon: Pommel bei -Z detektiert → Schwert geflippt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2156,8 +2156,9 @@ public class ModelEditorState extends BaseAppState {
|
||||
float g2x = input.gripEditorGrip2PosX;
|
||||
float g2y = input.gripEditorGrip2PosY;
|
||||
float g2z = input.gripEditorGrip2PosZ;
|
||||
boolean bladeAtMinusZ = g2z > g1z;
|
||||
boolean isTwoHand = bladeAtMinusZ && (g2x != 0f || g2y != 0f || g2z != 0f);
|
||||
boolean hasGrip2 = g2x != 0f || g2y != 0f || g2z != 0f;
|
||||
boolean bladeAtMinusZ = hasGrip2 ? (g2z > g1z) : (g1z > 0f);
|
||||
boolean isTwoHand = hasGrip2 && bladeAtMinusZ;
|
||||
|
||||
Quaternion charWorldRot = charPreviewNode.getWorldRotation();
|
||||
Quaternion charWorldRotInv = charWorldRot.inverse();
|
||||
|
||||
@@ -277,11 +277,8 @@ public class ModelEditorController implements ToolController {
|
||||
public void openModelEditor(String relPath, Path absolutePath) {
|
||||
this.pendingRelPath = relPath;
|
||||
this.pendingAbsPath = absolutePath;
|
||||
if (ctx.registry().getActive() == this) {
|
||||
activate();
|
||||
} else {
|
||||
ctx.registry().activate(this);
|
||||
}
|
||||
ctx.switchToWorld().run();
|
||||
ctx.registry().activate(this);
|
||||
}
|
||||
|
||||
/** Öffnet den Datei-Dialog für den Modell-Import. */
|
||||
|
||||
@@ -407,6 +407,8 @@ public class PlayerInputControl implements CombatStyleBase.AnimReceiver {
|
||||
this.visual = visual;
|
||||
}
|
||||
|
||||
public Spatial getVisual() { return visual; }
|
||||
|
||||
/**
|
||||
* Setzt die Navigationsquellen (PathFinder + Terrain). Muss vor oder beim
|
||||
* ersten setAnimationContext gesetzt sein, damit der CharacterNavigator
|
||||
|
||||
@@ -72,6 +72,7 @@ public class WeaponAttachmentControl extends AbstractControl {
|
||||
// Wird im 2. Frame aus den Runtime-Node-Positionen berechnet (skalierungs-unabhängig).
|
||||
private Vector3f palmOffsetLocal;
|
||||
|
||||
|
||||
private Item lastEquippedWeapon;
|
||||
private boolean lastDrawnState = false;
|
||||
private Spatial weaponSpatial;
|
||||
@@ -224,7 +225,10 @@ public class WeaponAttachmentControl extends AbstractControl {
|
||||
Quaternion animDelta = (handBindRotInChar != null)
|
||||
? boneRotInChar.mult(handBindRotInChar.inverse())
|
||||
: boneRotInChar;
|
||||
boolean bladeAtMinusZ2 = grip != null && grip.getGrip2PosZ() != 0f && grip.getGrip2PosZ() > grip.getPosZ();
|
||||
boolean bladeAtMinusZ2 = grip != null && (
|
||||
(grip.getGrip2PosX() != 0f || grip.getGrip2PosY() != 0f || grip.getGrip2PosZ() != 0f)
|
||||
? grip.getGrip2PosZ() > grip.getPosZ()
|
||||
: grip.getPosZ() > 0f);
|
||||
Quaternion bladeFlip2 = bladeAtMinusZ2
|
||||
? new Quaternion().fromAngles(com.jme3.math.FastMath.PI, 0f, 0f)
|
||||
: new Quaternion();
|
||||
@@ -368,20 +372,22 @@ public class WeaponAttachmentControl extends AbstractControl {
|
||||
DEG_TO_RAD * grip.getRotY(),
|
||||
DEG_TO_RAD * grip.getRotZ())
|
||||
: new Quaternion();
|
||||
// Klinge bei -Z erkannt (grip2PosZ > posZ) → 180° um X vorschalten, damit BACK_ROT_NORM
|
||||
// dieselbe Wirkung hat wie bei korrekt ausgerichtetem Modell (Klinge bei +Z).
|
||||
boolean bladeAtMinusZ = grip != null && grip.getGrip2PosZ() != 0f && grip.getGrip2PosZ() > grip.getPosZ();
|
||||
boolean bladeAtMinusZ = grip != null && (
|
||||
(grip.getGrip2PosX() != 0f || grip.getGrip2PosY() != 0f || grip.getGrip2PosZ() != 0f)
|
||||
? grip.getGrip2PosZ() > grip.getPosZ()
|
||||
: grip.getPosZ() > 0f);
|
||||
Quaternion bladeFlip = bladeAtMinusZ
|
||||
? new Quaternion().fromAngles(com.jme3.math.FastMath.PI, 0f, 0f)
|
||||
: new Quaternion();
|
||||
|
||||
Quaternion weaponRot = boneRotInChar.mult(BACK_ROT_NORM).mult(bladeFlip).mult(gripRot.inverse());
|
||||
Vector3f gripTarget = bonePosInChar.add(boneRotInChar.mult(
|
||||
twoHanded ? TWO_HAND_BACK_GRIP_OFFSET : BACK_GRIP_OFFSET));
|
||||
Vector3f offset = twoHanded ? TWO_HAND_BACK_GRIP_OFFSET : BACK_GRIP_OFFSET;
|
||||
Vector3f gripTarget = bonePosInChar.add(boneRotInChar.mult(offset));
|
||||
// X=0: Waffenmitte (nicht handspezifischer Griffpunkt) auf Wirbelsäule zentrieren
|
||||
Vector3f gripPos = (grip != null)
|
||||
? new Vector3f(grip.getPosX(), grip.getPosY(), grip.getPosZ())
|
||||
? new Vector3f(0f, grip.getPosY(), grip.getPosZ())
|
||||
: Vector3f.ZERO;
|
||||
Vector3f backPos = gripTarget.subtract(weaponRot.mult(gripPos));
|
||||
if (bladeAtMinusZ) backPos = backPos.add(0.1f, 0f, 0f);
|
||||
weaponSpatial.setLocalRotation(weaponRot);
|
||||
weaponSpatial.setLocalTranslation(backPos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user