From e69d4915dab1f6f217687e444c8e306b49d22668 Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Tue, 21 Feb 2023 21:27:50 -0700 Subject: [PATCH] Some import and namespace fixes, see https://github.com/phetsims/dot/issues/101 --- js/Permutation.ts | 1 - js/Utils.js | 3 ++- js/UtilsTests.js | 10 +++++----- tests/playground.html | 6 ++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/js/Permutation.ts b/js/Permutation.ts index a5aa971..2a421ef 100644 --- a/js/Permutation.ts +++ b/js/Permutation.ts @@ -7,7 +7,6 @@ */ import dot from './dot.js'; -import './Utils.js'; import Utils from './Utils.js'; class Permutation { diff --git a/js/Utils.js b/js/Utils.js index 3d7dd28..34f700b 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -8,6 +8,7 @@ import dot from './dot.js'; import Vector2 from './Vector2.js'; +import Vector3 from './Vector3.js'; // constants const EPSILON = Number.MIN_VALUE; @@ -304,7 +305,7 @@ const Utils = { epsilon = epsilon === undefined ? 1e-5 : epsilon; // center is the origin for now, but leaving in computations so that we can change that in the future. optimize away if needed - const center = new dot.Vector3( 0, 0, 0 ); + const center = new Vector3( 0, 0, 0 ); const rayDir = ray.direction; const pos = ray.position; diff --git a/js/UtilsTests.js b/js/UtilsTests.js index f4da38f..60cd48c 100644 --- a/js/UtilsTests.js +++ b/js/UtilsTests.js @@ -80,11 +80,11 @@ QUnit.test( 'lineLineIntersection', assert => { QUnit.test( 'lineSegmentIntersection', assert => { const h = Utils.lineSegmentIntersection; - const p1 = dot.Vector2.ZERO; - const p2 = new dot.Vector2( 1, 1 ); - const p3 = new dot.Vector2( -10, 8 ); - const p4 = new dot.Vector2( -3, -3 ); - const p5 = new dot.Vector2( 8, -10 ); + const p1 = Vector2.ZERO; + const p2 = new Vector2( 1, 1 ); + const p3 = new Vector2( -10, 8 ); + const p4 = new Vector2( -3, -3 ); + const p5 = new Vector2( 8, -10 ); const f = ( p1, p2, p3, p4 ) => h( p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y ); diff --git a/tests/playground.html b/tests/playground.html index c300aac..557b7f2 100644 --- a/tests/playground.html +++ b/tests/playground.html @@ -23,10 +23,12 @@ window.assertions.enableAssert(); window.assertions.enableAssertSlow(); - import dot from '../js/main.js'; - import phetCore from '../../phet-core/js/main.js'; + import phetCore from '../../chipper/dist/js/phet-core/js/main.js'; + import axon from '../../chipper/dist/js/axon/js/main.js'; + import dot from '../../chipper/dist/js/dot/js/main.js'; window.dot = dot; + window.axon = axon; window.phetCore = phetCore; console.log( 'loaded' );