trackeditor: translated points are 2D

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9289 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
iobyte 2024-01-27 20:50:11 +00:00
parent e07bafe83f
commit a2b972fed3
8 changed files with 29 additions and 14 deletions

View File

@ -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.20";
public final String version = "1.4.21";
private String path;
private double imageScale = 1;

View File

@ -176,9 +176,9 @@ public class Curve extends Segment
for (int i = 0; i < points.length; i++)
points[i] = new Point3D();
trPoints = new Point3D[4 * (7 + (showArrows > 0.0 ? 1 : 0)) * nbSteps];
trPoints = new Point2D.Double[4 * (7 + (showArrows > 0.0 ? 1 : 0)) * nbSteps];
for (int i = 0; i < trPoints.length; i++)
trPoints[i] = new Point3D();
trPoints[i] = new Point2D.Double();
}
boolean dir = type.equals("rgt");

View File

@ -41,9 +41,9 @@ public class ObjShapeHandle extends Segment
for (int i = 0; i < points.length; i++)
points[i] = new Point3D();
trPoints = new Point3D[1];
trPoints = new Point2D.Double[1];
for (int i = 0; i < trPoints.length; i++)
trPoints[i] = new Point3D();
trPoints[i] = new Point2D.Double();
}
points[0].x = location.getX();

View File

@ -149,9 +149,9 @@ public class ObjShapeObject extends Segment
for (int i = 0; i < points.length; i++)
points[i] = new Point3D();
trPoints = new Point3D[4];
trPoints = new Point2D.Double[4];
for (int i = 0; i < trPoints.length; i++)
trPoints[i] = new Point3D();
trPoints[i] = new Point2D.Double();
}
points[0].x = this.location.getX() - width / 2;

View File

@ -128,9 +128,9 @@ public class ObjShapeRelief extends Segment
for (int i = 0; i < points.length; i++)
points[i] = new Point3D();
trPoints = new Point3D[vertices.size()];
trPoints = new Point2D.Double[vertices.size()];
for (int i = 0; i < trPoints.length; i++)
trPoints[i] = new Point3D();
trPoints[i] = new Point2D.Double();
}
for (int i = 0; i < points.length; i++)

View File

@ -41,9 +41,9 @@ public class ObjShapeTerrain extends Segment
for (int i = 0; i < points.length; i++)
points[i] = new Point3D();
trPoints = new Point3D[4];
trPoints = new Point2D.Double[4];
for (int i = 0; i < trPoints.length; i++)
trPoints[i] = new Point3D();
trPoints[i] = new Point2D.Double();
}
double border = editorFrame.getTrackData().getGraphic().getTerrainGeneration().getBorderMargin();

View File

@ -105,7 +105,7 @@ public class Segment implements Cloneable
// shape to be drawn
public Point3D points[];
public Point3D trPoints[];
public Point2D.Double trPoints[];
// datas for fast 'draw' process
int xToDraw[] = new int[4];
@ -2268,6 +2268,21 @@ public class Segment implements Cloneable
System.out.println(indent + " name : " + name);
System.out.println(indent + " type : " + type);
System.out.println(indent + " count : " + count);
System.out.println(indent + " calculatedHeightStart : " + calculatedHeightStart);
System.out.println(indent + " calculatedHeightStartLeft : " + calculatedHeightStartLeft);
System.out.println(indent + " calculatedHeightStartRight : " + calculatedHeightStartRight);
System.out.println(indent + " calculatedHeightEnd : " + calculatedHeightEndLeft);
System.out.println(indent + " calculatedHeightEndLeft : " + calculatedHeightEndLeft);
System.out.println(indent + " calculatedHeightEndRight : " + calculatedHeightEndRight);
System.out.println(indent + " calculatedGrade : " + calculatedGrade);
System.out.println(indent + " calculatedBankingStart : " + calculatedBankingStart);
System.out.println(indent + " calculatedBankingEnd : " + calculatedBankingEnd);
System.out.println(indent + " calculatedStartTangent : " + calculatedStartTangent);
System.out.println(indent + " calculatedStartTangentLeft : " + calculatedStartTangentLeft);
System.out.println(indent + " calculatedStartTangentRight : " + calculatedStartTangentRight);
System.out.println(indent + " calculatedEndTangent : " + calculatedEndTangent);
System.out.println(indent + " calculatedEndTangentLeft : " + calculatedEndTangentLeft);
System.out.println(indent + " calculatedEndTangentRight : " + calculatedEndTangentRight);
if (points != null)
{
System.out.println(indent + " points : " + points.length);

View File

@ -118,9 +118,9 @@ public class Straight extends Segment
for (int i = 0; i < points.length; i++)
points[i] = new Point3D();
trPoints = new Point3D[4 * (7 + (showArrows > 0.0 ? 1 : 0)) * nbSteps];
trPoints = new Point2D.Double[4 * (7 + (showArrows > 0.0 ? 1 : 0)) * nbSteps];
for (int i = 0; i < trPoints.length; i++)
trPoints[i] = new Point3D();
trPoints[i] = new Point2D.Double();
}
int currentSubSeg = 0;