Skip to content

Commit

Permalink
Some import and namespace fixes, see #101
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Feb 22, 2023
1 parent 33b5da0 commit e69d491
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion js/Permutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

import dot from './dot.js';
import './Utils.js';
import Utils from './Utils.js';

class Permutation {
Expand Down
3 changes: 2 additions & 1 deletion js/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions js/UtilsTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
6 changes: 4 additions & 2 deletions tests/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down

0 comments on commit e69d491

Please sign in to comment.