Commit 48ba44a4 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

handling error (probably cons. of fronto)

parent b0857154
Loading
Loading
Loading
Loading
+16 −7
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@
 **
 **
 */
 */
import java.awt.Point;
import java.awt.Point;
import java.io.IOException;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Collections;
import java.util.Comparator;
import java.util.Comparator;
@@ -3498,13 +3499,21 @@ public class TilePlanes {
				PlaneData otherPd,
				PlaneData otherPd,
				boolean correct_distortions)
				boolean correct_distortions)
		{
		{
			try {
				Matrix this_wv =  new Matrix(this.getWorldXYZ(correct_distortions, 0),3);
				Matrix this_wv =  new Matrix(this.getWorldXYZ(correct_distortions, 0),3);
			Matrix other_wv = new Matrix(otherPd.getWorldXYZ(correct_distortions, 0),3);
				Matrix other_wv = new Matrix(otherPd.getWorldXYZ(correct_distortions, 0),3); // FIXME: this caused null pointer
				Matrix cp = cross3d(this_wv, other_wv);
				Matrix cp = cross3d(this_wv, other_wv);
				double cp2 = cp.transpose().times(cp).get(0, 0);
				double cp2 = cp.transpose().times(cp).get(0, 0);
				double this_wv2 = this_wv.transpose().times(this_wv).get(0, 0);
				double this_wv2 = this_wv.transpose().times(this_wv).get(0, 0);
				double other_wv2 = other_wv.transpose().times(other_wv).get(0, 0);
				double other_wv2 = other_wv.transpose().times(other_wv).get(0, 0);
				return cp2/(this_wv2 * other_wv2);
				return cp2/(this_wv2 * other_wv2);
			} catch (Exception e) {
				System.out.println("Problem in getWorldSin2():");
				// TODO Auto-generated catch block
				e.printStackTrace();
				// do nothing, just keep
				return 1.0;
			}
		}
		}
		public double getWorldSin2(
		public double getWorldSin2(
				PlaneData otherPd)
				PlaneData otherPd)