trackeditor: fix spline calculations by using tangents correctly
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9302 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
parent
05f6220cee
commit
67a51d9b58
|
@ -88,9 +88,7 @@ import utils.circuit.MainTrack;
|
|||
import utils.circuit.ObjShapeObject;
|
||||
import utils.circuit.ObjectMap;
|
||||
import utils.circuit.Pits;
|
||||
import utils.circuit.Point3D;
|
||||
import utils.circuit.Reliefs;
|
||||
import utils.circuit.Sector;
|
||||
import utils.circuit.Segment;
|
||||
import utils.circuit.Straight;
|
||||
import utils.circuit.Surface;
|
||||
|
@ -654,7 +652,7 @@ public class EditorFrame extends JFrame
|
|||
|
||||
setTitle(originalTitle + " - Project: " + projectFileName);
|
||||
|
||||
//writeTrack();
|
||||
writeTrack();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,6 +45,7 @@ import javax.swing.event.PopupMenuListener;
|
|||
|
||||
import utils.Editor;
|
||||
import utils.EditorPoint;
|
||||
import utils.MutableDouble;
|
||||
import utils.SegmentVector;
|
||||
import utils.circuit.Curve;
|
||||
import utils.circuit.GraphicObject;
|
||||
|
@ -1709,9 +1710,6 @@ public class CircuitView extends JComponent implements KeyListener, MouseListene
|
|||
obj.getType().equals("lft") ||
|
||||
obj.getType().equals("str"))
|
||||
{
|
||||
double height = obj.getHeightAt(editorFrame, mousePoint.x, mousePoint.y);
|
||||
coordinates = String.format("x: %.3f y: %.3f z: %.3f", mousePoint.x, mousePoint.y, height);
|
||||
/*
|
||||
MutableDouble height = new MutableDouble();
|
||||
MutableDouble slopeLeft = new MutableDouble();
|
||||
MutableDouble slopeRight = new MutableDouble();
|
||||
|
@ -1719,9 +1717,8 @@ public class CircuitView extends JComponent implements KeyListener, MouseListene
|
|||
{
|
||||
double slope = (slopeLeft.getValue() + slopeRight.getValue()) / 2.0;
|
||||
|
||||
coordinates = String.format("x: %.3f y: %.3f z: %.3f slope: %.3f", mousePoint.x, mousePoint.y, height.getValue(), slope);
|
||||
coordinates = String.format("x: %.3f y: %.3f z: %.3f grade: %.3f", mousePoint.x, mousePoint.y, height.getValue(), slope);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class Properties
|
|||
private static Properties instance = new Properties();
|
||||
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
|
||||
public final String title = "sd2-trackeditor";
|
||||
public final String version = "1.4.29";
|
||||
public final String version = "1.4.30";
|
||||
private String path;
|
||||
|
||||
private double imageScale = 1;
|
||||
|
|
|
@ -191,12 +191,12 @@ public class Curve extends Segment
|
|||
|
||||
boolean linear = getValidProfil(editorFrame).equals("linear");
|
||||
|
||||
double T1l = getCalculatedStartTangentLeft() * getLength();
|
||||
double T2l = getCalculatedEndTangentLeft() * getLength();
|
||||
double T1l = (getCalculatedStartTangentLeft() / 100.0) * getLength();
|
||||
double T2l = (getCalculatedEndTangentLeft() / 100.0) * getLength();
|
||||
double tl = 0.0;
|
||||
double dtl = 1.0 / nbSteps;
|
||||
double T1r = getCalculatedStartTangentRight() * getLength();
|
||||
double T2r = getCalculatedEndTangentRight() * getLength();
|
||||
double T1r = (getCalculatedStartTangentRight() / 100.0) * getLength();
|
||||
double T2r = (getCalculatedEndTangentRight() / 100.0) * getLength();
|
||||
double tr = 0.0;
|
||||
double dtr = 1.0 / nbSteps;
|
||||
double curzsl = leftStartHeight;
|
||||
|
|
|
@ -141,12 +141,12 @@ public class Straight extends Segment
|
|||
|
||||
boolean linear = getValidProfil(editorFrame).equals("linear");
|
||||
|
||||
double T1l = getCalculatedStartTangentLeft() * getLength();
|
||||
double T2l = getCalculatedEndTangentLeft() * getLength();
|
||||
double T1l = (getCalculatedStartTangentLeft() / 100.0) * getLength();
|
||||
double T2l = (getCalculatedEndTangentLeft() / 100.0) * getLength();
|
||||
double tl = 0.0;
|
||||
double dtl = 1.0 / nbSteps;
|
||||
double T1r = getCalculatedStartTangentRight() * getLength();
|
||||
double T2r = getCalculatedEndTangentRight() * getLength();
|
||||
double T1r = (getCalculatedStartTangentRight() / 100.0) * getLength();
|
||||
double T2r = (getCalculatedEndTangentRight() / 100.0) * getLength();
|
||||
double tr = 0.0;
|
||||
double dtr = 1.0 / nbSteps;
|
||||
double curzsl = leftStartHeight;
|
||||
|
|
Loading…
Reference in New Issue