Skip to content

Commit

Permalink
Reduce pathing step size
Browse files Browse the repository at this point in the history
I don't think this added any accuracy and was just costing CPU time
  • Loading branch information
cam72cam committed Jan 12, 2024
1 parent ccdc1d5 commit 6bbbde9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static Vec3d nextPositionDirect(World world, Vec3d currentPosition, TileR
* trying to move. Instead we should probably calculate the vector between the closest pos
* and the current pos and move distance along that. How would that work for slopes at the ends? just fine?
*/
List<PosStep> positions = ((IIterableTrack) rail.info.getBuilder(world)).getPath(0.25 * rail.info.settings.gauge.scale());
List<PosStep> positions = ((IIterableTrack) rail.info.getBuilder(world)).getPath(rail.info.settings.gauge.scale());
Vec3d center = rail.info.placementInfo.placementPosition.add(rail.getPos()).add(0, heightOffset, 0);
Vec3d target = currentPosition.add(delta);
Vec3d relative = target.subtract(center);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ default double offsetFromTrack(RailInfo info, Vec3i pos, Vec3d position) {
Vec3d relative = position.subtract(info.placementInfo.placementPosition).subtract(pos);
relative = relative.add(0, -(relative.y % 1), 0);

List<PosStep> positions = getPath(info.settings.gauge.scale() / 8);
List<PosStep> positions = getPath(info.settings.gauge.scale());

/*double distSquared = 100 * 100;
for (Vec3d gagPos : positions) {
Expand Down

0 comments on commit 6bbbde9

Please sign in to comment.