Skip to content

Commit cf054d1

Browse files
committed
j2sMenu.js fix for iPad touch; PT.FLOAT_MIN_VALUE removed
1 parent 7352ef6 commit cf054d1

File tree

7 files changed

+560
-590
lines changed

7 files changed

+560
-590
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20230522181019
1+
20230604170156
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20230522181019
1+
20230604170156
431 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/javajs/util/Measure.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static T3[] computeHelicalAxis(P3 a, P3 b, Quat dq) {
134134
V3 vda = new V3();
135135
V3 vcb = V3.newV(n);
136136
if (v_dot_n == 0)
137-
v_dot_n = PT.FLOAT_MIN_SAFE; // allow for perpendicular axis to vab
137+
v_dot_n = 2E-45f; // allow for perpendicular axis to vab
138138
vcb.scale(v_dot_n);
139139
vda.sub2(vcb, vab);
140140
vda.scale(0.5f);
@@ -146,7 +146,7 @@ public static T3[] computeHelicalAxis(P3 a, P3 b, Quat dq) {
146146
P3 pt_a_prime = P3.newP(a);
147147
pt_a_prime.sub(r);
148148
// already done this. ??
149-
if (v_dot_n != PT.FLOAT_MIN_SAFE)
149+
if (v_dot_n != 2E-45f)
150150
n.scale(v_dot_n);
151151
// must calculate directed angle:
152152
P3 pt_b_prime = P3.newP(pt_a_prime);
@@ -156,7 +156,7 @@ public static T3[] computeHelicalAxis(P3 a, P3 b, Quat dq) {
156156
theta = dq.getThetaDirectedV(n); // allow for r = 0
157157
// anything else is an array
158158
float residuesPerTurn = Math.abs(theta == 0 ? 0 : 360f / theta);
159-
float pitch = Math.abs(v_dot_n == PT.FLOAT_MIN_SAFE ? 0 : n.length()
159+
float pitch = Math.abs(v_dot_n == 2E-45f ? 0 : n.length()
160160
* (theta == 0 ? 1 : 360f / theta));
161161
return new T3[] { pt_a_prime, n, r, P3.new3(theta, pitch, residuesPerTurn), pt_b_prime };
162162
}

sources/net.sf.j2s.java.core/src/javajs/util/MeasureD.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static T3d[] computeHelicalAxis(P3d a, P3d b, Qd dq) {
134134
V3d vda = new V3d();
135135
V3d vcb = V3d.newV(n);
136136
if (v_dot_n == 0)
137-
v_dot_n = PT.FLOAT_MIN_SAFE; // allow for perpendicular axis to vab
137+
v_dot_n = 2E-45; // allow for perpendicular axis to vab
138138
vcb.scale(v_dot_n);
139139
vda.sub2(vcb, vab);
140140
vda.scale(0.5f);
@@ -146,7 +146,7 @@ public static T3d[] computeHelicalAxis(P3d a, P3d b, Qd dq) {
146146
P3d pt_a_prime = P3d.newP(a);
147147
pt_a_prime.sub(r);
148148
// already done this. ??
149-
if (v_dot_n != PT.FLOAT_MIN_SAFE)
149+
if (v_dot_n != 2E-45)
150150
n.scale(v_dot_n);
151151
// must calculate directed angle:
152152
P3d pt_b_prime = P3d.newP(pt_a_prime);
@@ -156,7 +156,7 @@ public static T3d[] computeHelicalAxis(P3d a, P3d b, Qd dq) {
156156
theta = dq.getThetaDirectedV(n); // allow for r = 0
157157
// anything else is an array
158158
double residuesPerTurn = Math.abs(theta == 0 ? 0 : 360f / theta);
159-
double pitch = Math.abs(v_dot_n == PT.FLOAT_MIN_SAFE ? 0 : n.length()
159+
double pitch = Math.abs(v_dot_n == 2E-45 ? 0 : n.length()
160160
* (theta == 0 ? 1 : 360f / theta));
161161
return new T3d[] { pt_a_prime, n, r, P3d.new3(theta, pitch, residuesPerTurn), pt_b_prime };
162162
}

0 commit comments

Comments
 (0)