Skip to content

Commit cd8905c

Browse files
authored
Merge pull request Kai-Z-JP#356 from Kai-Z-JP/sin-accuracy
fix: oscillation of marker line
2 parents 769f6ce + f8fe37c commit cd8905c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/jp/ngt/rtm/rail/RenderMarkerBlock1122.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ private boolean changeAnchor(TileEntityMarker marker) {
389389
if (dx != 0.0D && dz != 0.0D) {
390390
RailPosition neighborRP = getNeighborRail(marker);
391391
float dirRad = (float) Math.atan2(dx, dz);
392-
float length = (float) (dx / MathHelper.sin(dirRad));
392+
float length = (float) (dx / Math.sin(dirRad));
393393
float yaw = NGTMath.toDegrees(dirRad);
394394
if (curElm == MarkerElement.HORIZONTIAL) {
395395
if (neighborRP != null && marker.getState(MarkerState.FIT_NEIGHBOR)) {

src/main/java/jp/ngt/rtm/rail/RenderMarkerBlock1710.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private void changeAnchor(TileEntityMarker tileEntity)//Minecraft.1518-this.obje
165165
double dz = vec3.zCoord - rp.posZ;
166166
if (dx != 0.0D && dz != 0.0D) {
167167
float dirRad = (float) Math.atan2(dx, dz);
168-
float length = (float) (dx / MathHelper.sin(dirRad));
168+
float length = (float) (dx / Math.sin(dirRad));
169169
float yaw = NGTMath.toDegrees(dirRad);
170170

171171
if (curElm == MarkerElement.HORIZONTIAL) {

0 commit comments

Comments
 (0)