1
1
import { assert } from 'chai' ;
2
- import { Vector , Victor , calc } from '../src' ;
2
+ import { Vector , Victor , calc } from '../src/vector ' ;
3
3
import * as Examples from '../examples' ;
4
4
5
5
const vectorTest = ( Vec3 ) => {
@@ -55,7 +55,15 @@ const vectorTest = (Vec3) => {
55
55
const length = dir . length ;
56
56
assert ( length > 0.99 && length < 1.01 , `${ dir } should have length 1, but is ${ length } ` ) ;
57
57
} ) ;
58
+ /*
59
+ it('should change length to 1 when normalize via arithmetic', () => {
60
+ const pos = new Vec3(5, 6, 7);
61
+ const dir = calc(() => pos / Math.abs(pos));
58
62
63
+ const length = dir.length;
64
+ assert(length > 0.99 && length < 1.01, `${dir} should have length 1, but is ${length}`);
65
+ });
66
+ */
59
67
it ( 'should calculate the cross product' , ( ) => {
60
68
const dir1 = new Vec3 ( 0 , 1 , 0 ) ;
61
69
const dir2 = new Vec3 ( - 1 , 0 , 1 ) ;
@@ -202,6 +210,7 @@ describe('calc test.', () => {
202
210
} ) ;
203
211
} ) ;
204
212
213
+ /*
205
214
describe('performance test', () => {
206
215
it('should be fast', () => {
207
216
let time = new Date().getTime();
@@ -228,4 +237,5 @@ describe('performance test', () => {
228
237
time = new Date().getTime() - time;
229
238
console.log('perf test faster', `${Math.round(time) / 1000}s`);
230
239
});
231
- } ) ;
240
+ });
241
+ */
0 commit comments