@immugio/three-math-extensions 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -3
- package/README.md +1 -80
- package/cjs/Line2D.js +11 -2
- package/cjs/index.js +3 -1
- package/cjs/isPointInPolygon.js +16 -0
- package/docs/README.md +86 -1
- package/docs/classes/BoundingBox.md +7 -7
- package/docs/classes/Line2D.md +88 -60
- package/docs/classes/Line3D.md +32 -32
- package/docs/classes/Polygon.md +15 -15
- package/docs/classes/Rectangle.md +17 -17
- package/docs/classes/Size2.md +3 -3
- package/docs/classes/Vec2.md +54 -6
- package/docs/classes/Vec3.md +11 -11
- package/docs/interfaces/Point2.md +2 -2
- package/docs/interfaces/Point3.md +3 -3
- package/docs/modules.md +25 -3
- package/esm/Line2D.js +11 -2
- package/esm/index.js +1 -0
- package/esm/isPointInPolygon.js +12 -0
- package/package.json +1 -1
- package/src/Line2D.ts +12 -2
- package/src/index.ts +2 -1
- package/src/isPointInPolygon.ts +19 -0
- package/types/Line2D.d.ts +4 -2
- package/types/index.d.ts +1 -0
- package/types/isPointInPolygon.d.ts +2 -0
package/docs/classes/Line3D.md
CHANGED
|
@@ -73,7 +73,7 @@ Line3.constructor
|
|
|
73
73
|
|
|
74
74
|
#### Defined in
|
|
75
75
|
|
|
76
|
-
[src/Line3D.ts:13](https://github.com/Immugio/three-math-extensions/blob/
|
|
76
|
+
[src/Line3D.ts:13](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L13)
|
|
77
77
|
|
|
78
78
|
## Properties
|
|
79
79
|
|
|
@@ -87,7 +87,7 @@ Line3.end
|
|
|
87
87
|
|
|
88
88
|
#### Defined in
|
|
89
89
|
|
|
90
|
-
[src/Line3D.ts:9](https://github.com/Immugio/three-math-extensions/blob/
|
|
90
|
+
[src/Line3D.ts:9](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L9)
|
|
91
91
|
|
|
92
92
|
___
|
|
93
93
|
|
|
@@ -101,7 +101,7 @@ Line3.start
|
|
|
101
101
|
|
|
102
102
|
#### Defined in
|
|
103
103
|
|
|
104
|
-
[src/Line3D.ts:8](https://github.com/Immugio/three-math-extensions/blob/
|
|
104
|
+
[src/Line3D.ts:8](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L8)
|
|
105
105
|
|
|
106
106
|
## Accessors
|
|
107
107
|
|
|
@@ -117,7 +117,7 @@ Returns the center of this line
|
|
|
117
117
|
|
|
118
118
|
#### Defined in
|
|
119
119
|
|
|
120
|
-
[src/Line3D.ts:270](https://github.com/Immugio/three-math-extensions/blob/
|
|
120
|
+
[src/Line3D.ts:270](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L270)
|
|
121
121
|
|
|
122
122
|
___
|
|
123
123
|
|
|
@@ -133,7 +133,7 @@ Returns the direction of this line.
|
|
|
133
133
|
|
|
134
134
|
#### Defined in
|
|
135
135
|
|
|
136
|
-
[src/Line3D.ts:263](https://github.com/Immugio/three-math-extensions/blob/
|
|
136
|
+
[src/Line3D.ts:263](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L263)
|
|
137
137
|
|
|
138
138
|
___
|
|
139
139
|
|
|
@@ -149,7 +149,7 @@ Returns the start and end points of the line as an array.
|
|
|
149
149
|
|
|
150
150
|
#### Defined in
|
|
151
151
|
|
|
152
|
-
[src/Line3D.ts:293](https://github.com/Immugio/three-math-extensions/blob/
|
|
152
|
+
[src/Line3D.ts:293](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L293)
|
|
153
153
|
|
|
154
154
|
___
|
|
155
155
|
|
|
@@ -165,7 +165,7 @@ Returns this line's length.
|
|
|
165
165
|
|
|
166
166
|
#### Defined in
|
|
167
167
|
|
|
168
|
-
[src/Line3D.ts:247](https://github.com/Immugio/three-math-extensions/blob/
|
|
168
|
+
[src/Line3D.ts:247](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L247)
|
|
169
169
|
|
|
170
170
|
## Methods
|
|
171
171
|
|
|
@@ -187,7 +187,7 @@ Divides the Line3D into a number of segments of the given length.
|
|
|
187
187
|
|
|
188
188
|
#### Defined in
|
|
189
189
|
|
|
190
|
-
[src/Line3D.ts:405](https://github.com/Immugio/three-math-extensions/blob/
|
|
190
|
+
[src/Line3D.ts:405](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L405)
|
|
191
191
|
|
|
192
192
|
___
|
|
193
193
|
|
|
@@ -216,7 +216,7 @@ Clones the line, does not modify this.
|
|
|
216
216
|
|
|
217
217
|
#### Defined in
|
|
218
218
|
|
|
219
|
-
[src/Line3D.ts:51](https://github.com/Immugio/three-math-extensions/blob/
|
|
219
|
+
[src/Line3D.ts:51](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L51)
|
|
220
220
|
|
|
221
221
|
___
|
|
222
222
|
|
|
@@ -242,7 +242,7 @@ Clones the line, does not modify this.
|
|
|
242
242
|
|
|
243
243
|
#### Defined in
|
|
244
244
|
|
|
245
|
-
[src/Line3D.ts:76](https://github.com/Immugio/three-math-extensions/blob/
|
|
245
|
+
[src/Line3D.ts:76](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L76)
|
|
246
246
|
|
|
247
247
|
___
|
|
248
248
|
|
|
@@ -262,7 +262,7 @@ Line3.clone
|
|
|
262
262
|
|
|
263
263
|
#### Defined in
|
|
264
264
|
|
|
265
|
-
[src/Line3D.ts:522](https://github.com/Immugio/three-math-extensions/blob/
|
|
265
|
+
[src/Line3D.ts:522](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L522)
|
|
266
266
|
|
|
267
267
|
___
|
|
268
268
|
|
|
@@ -285,7 +285,7 @@ Check that this line section contains provided point.
|
|
|
285
285
|
|
|
286
286
|
#### Defined in
|
|
287
287
|
|
|
288
|
-
[src/Line3D.ts:302](https://github.com/Immugio/three-math-extensions/blob/
|
|
288
|
+
[src/Line3D.ts:302](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L302)
|
|
289
289
|
|
|
290
290
|
___
|
|
291
291
|
|
|
@@ -312,7 +312,7 @@ line section.
|
|
|
312
312
|
|
|
313
313
|
#### Defined in
|
|
314
314
|
|
|
315
|
-
[src/Line3D.ts:200](https://github.com/Immugio/three-math-extensions/blob/
|
|
315
|
+
[src/Line3D.ts:200](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L200)
|
|
316
316
|
|
|
317
317
|
___
|
|
318
318
|
|
|
@@ -335,7 +335,7 @@ Distance from this line to provided point.
|
|
|
335
335
|
|
|
336
336
|
#### Defined in
|
|
337
337
|
|
|
338
|
-
[src/Line3D.ts:312](https://github.com/Immugio/three-math-extensions/blob/
|
|
338
|
+
[src/Line3D.ts:312](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L312)
|
|
339
339
|
|
|
340
340
|
___
|
|
341
341
|
|
|
@@ -362,7 +362,7 @@ Line3.equals
|
|
|
362
362
|
|
|
363
363
|
#### Defined in
|
|
364
364
|
|
|
365
|
-
[src/Line3D.ts:515](https://github.com/Immugio/three-math-extensions/blob/
|
|
365
|
+
[src/Line3D.ts:515](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L515)
|
|
366
366
|
|
|
367
367
|
___
|
|
368
368
|
|
|
@@ -394,7 +394,7 @@ Returns null if lines are not parallel.
|
|
|
394
394
|
|
|
395
395
|
#### Defined in
|
|
396
396
|
|
|
397
|
-
[src/Line3D.ts:323](https://github.com/Immugio/three-math-extensions/blob/
|
|
397
|
+
[src/Line3D.ts:323](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L323)
|
|
398
398
|
|
|
399
399
|
___
|
|
400
400
|
|
|
@@ -421,7 +421,7 @@ https://stackoverflow.com/questions/2316490/the-algorithm-to-find-the-point-of-i
|
|
|
421
421
|
|
|
422
422
|
#### Defined in
|
|
423
423
|
|
|
424
|
-
[src/Line3D.ts:456](https://github.com/Immugio/three-math-extensions/blob/
|
|
424
|
+
[src/Line3D.ts:456](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L456)
|
|
425
425
|
|
|
426
426
|
___
|
|
427
427
|
|
|
@@ -448,7 +448,7 @@ is parallel to this line.
|
|
|
448
448
|
|
|
449
449
|
#### Defined in
|
|
450
450
|
|
|
451
|
-
[src/Line3D.ts:344](https://github.com/Immugio/three-math-extensions/blob/
|
|
451
|
+
[src/Line3D.ts:344](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L344)
|
|
452
452
|
|
|
453
453
|
___
|
|
454
454
|
|
|
@@ -479,7 +479,7 @@ Clones the line, does not modify this.
|
|
|
479
479
|
|
|
480
480
|
#### Defined in
|
|
481
481
|
|
|
482
|
-
[src/Line3D.ts:111](https://github.com/Immugio/three-math-extensions/blob/
|
|
482
|
+
[src/Line3D.ts:111](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L111)
|
|
483
483
|
|
|
484
484
|
___
|
|
485
485
|
|
|
@@ -499,7 +499,7 @@ ___
|
|
|
499
499
|
|
|
500
500
|
#### Defined in
|
|
501
501
|
|
|
502
|
-
[src/Line3D.ts:380](https://github.com/Immugio/three-math-extensions/blob/
|
|
502
|
+
[src/Line3D.ts:380](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L380)
|
|
503
503
|
|
|
504
504
|
___
|
|
505
505
|
|
|
@@ -519,7 +519,7 @@ ___
|
|
|
519
519
|
|
|
520
520
|
#### Defined in
|
|
521
521
|
|
|
522
|
-
[src/Line3D.ts:368](https://github.com/Immugio/three-math-extensions/blob/
|
|
522
|
+
[src/Line3D.ts:368](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L368)
|
|
523
523
|
|
|
524
524
|
___
|
|
525
525
|
|
|
@@ -535,7 +535,7 @@ Project the line to 2D space, Y value is dropped
|
|
|
535
535
|
|
|
536
536
|
#### Defined in
|
|
537
537
|
|
|
538
|
-
[src/Line3D.ts:508](https://github.com/Immugio/three-math-extensions/blob/
|
|
538
|
+
[src/Line3D.ts:508](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L508)
|
|
539
539
|
|
|
540
540
|
___
|
|
541
541
|
|
|
@@ -563,7 +563,7 @@ line section.
|
|
|
563
563
|
|
|
564
564
|
#### Defined in
|
|
565
565
|
|
|
566
|
-
[src/Line3D.ts:210](https://github.com/Immugio/three-math-extensions/blob/
|
|
566
|
+
[src/Line3D.ts:210](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L210)
|
|
567
567
|
|
|
568
568
|
___
|
|
569
569
|
|
|
@@ -586,7 +586,7 @@ Returns a new line that is the projection of this line onto @other. Uses `closes
|
|
|
586
586
|
|
|
587
587
|
#### Defined in
|
|
588
588
|
|
|
589
|
-
[src/Line3D.ts:394](https://github.com/Immugio/three-math-extensions/blob/
|
|
589
|
+
[src/Line3D.ts:394](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L394)
|
|
590
590
|
|
|
591
591
|
___
|
|
592
592
|
|
|
@@ -606,7 +606,7 @@ ___
|
|
|
606
606
|
|
|
607
607
|
#### Defined in
|
|
608
608
|
|
|
609
|
-
[src/Line3D.ts:359](https://github.com/Immugio/three-math-extensions/blob/
|
|
609
|
+
[src/Line3D.ts:359](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L359)
|
|
610
610
|
|
|
611
611
|
___
|
|
612
612
|
|
|
@@ -628,7 +628,7 @@ Set the center of the line to the provided point. Length and direction remain un
|
|
|
628
628
|
|
|
629
629
|
#### Defined in
|
|
630
630
|
|
|
631
|
-
[src/Line3D.ts:278](https://github.com/Immugio/three-math-extensions/blob/
|
|
631
|
+
[src/Line3D.ts:278](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L278)
|
|
632
632
|
|
|
633
633
|
___
|
|
634
634
|
|
|
@@ -650,7 +650,7 @@ Set the length of this line. Center and direction remain unchanged.
|
|
|
650
650
|
|
|
651
651
|
#### Defined in
|
|
652
652
|
|
|
653
|
-
[src/Line3D.ts:255](https://github.com/Immugio/three-math-extensions/blob/
|
|
653
|
+
[src/Line3D.ts:255](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L255)
|
|
654
654
|
|
|
655
655
|
___
|
|
656
656
|
|
|
@@ -664,7 +664,7 @@ ___
|
|
|
664
664
|
|
|
665
665
|
#### Defined in
|
|
666
666
|
|
|
667
|
-
[src/Line3D.ts:526](https://github.com/Immugio/three-math-extensions/blob/
|
|
667
|
+
[src/Line3D.ts:526](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L526)
|
|
668
668
|
|
|
669
669
|
___
|
|
670
670
|
|
|
@@ -686,7 +686,7 @@ Move this line by the given vector.
|
|
|
686
686
|
|
|
687
687
|
#### Defined in
|
|
688
688
|
|
|
689
|
-
[src/Line3D.ts:441](https://github.com/Immugio/three-math-extensions/blob/
|
|
689
|
+
[src/Line3D.ts:441](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L441)
|
|
690
690
|
|
|
691
691
|
___
|
|
692
692
|
|
|
@@ -707,7 +707,7 @@ ___
|
|
|
707
707
|
|
|
708
708
|
#### Defined in
|
|
709
709
|
|
|
710
|
-
[src/Line3D.ts:18](https://github.com/Immugio/three-math-extensions/blob/
|
|
710
|
+
[src/Line3D.ts:18](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L18)
|
|
711
711
|
|
|
712
712
|
___
|
|
713
713
|
|
|
@@ -732,7 +732,7 @@ The polygon will only be closed if either
|
|
|
732
732
|
|
|
733
733
|
#### Defined in
|
|
734
734
|
|
|
735
|
-
[src/Line3D.ts:27](https://github.com/Immugio/three-math-extensions/blob/
|
|
735
|
+
[src/Line3D.ts:27](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L27)
|
|
736
736
|
|
|
737
737
|
___
|
|
738
738
|
|
|
@@ -757,4 +757,4 @@ Lines must be parallel for joining.
|
|
|
757
757
|
|
|
758
758
|
#### Defined in
|
|
759
759
|
|
|
760
|
-
[src/Line3D.ts:165](https://github.com/Immugio/three-math-extensions/blob/
|
|
760
|
+
[src/Line3D.ts:165](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Line3D.ts#L165)
|
package/docs/classes/Polygon.md
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
#### Defined in
|
|
48
48
|
|
|
49
|
-
[src/Polygon.ts:8](https://github.com/Immugio/three-math-extensions/blob/
|
|
49
|
+
[src/Polygon.ts:8](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L8)
|
|
50
50
|
|
|
51
51
|
## Properties
|
|
52
52
|
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
|
|
57
57
|
#### Defined in
|
|
58
58
|
|
|
59
|
-
[src/Polygon.ts:8](https://github.com/Immugio/three-math-extensions/blob/
|
|
59
|
+
[src/Polygon.ts:8](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L8)
|
|
60
60
|
|
|
61
61
|
___
|
|
62
62
|
|
|
@@ -66,7 +66,7 @@ ___
|
|
|
66
66
|
|
|
67
67
|
#### Defined in
|
|
68
68
|
|
|
69
|
-
[src/Polygon.ts:8](https://github.com/Immugio/three-math-extensions/blob/
|
|
69
|
+
[src/Polygon.ts:8](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L8)
|
|
70
70
|
|
|
71
71
|
## Accessors
|
|
72
72
|
|
|
@@ -80,7 +80,7 @@ ___
|
|
|
80
80
|
|
|
81
81
|
#### Defined in
|
|
82
82
|
|
|
83
|
-
[src/Polygon.ts:24](https://github.com/Immugio/three-math-extensions/blob/
|
|
83
|
+
[src/Polygon.ts:24](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L24)
|
|
84
84
|
|
|
85
85
|
## Methods
|
|
86
86
|
|
|
@@ -94,7 +94,7 @@ ___
|
|
|
94
94
|
|
|
95
95
|
#### Defined in
|
|
96
96
|
|
|
97
|
-
[src/Polygon.ts:73](https://github.com/Immugio/three-math-extensions/blob/
|
|
97
|
+
[src/Polygon.ts:73](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L73)
|
|
98
98
|
|
|
99
99
|
___
|
|
100
100
|
|
|
@@ -108,7 +108,7 @@ ___
|
|
|
108
108
|
|
|
109
109
|
#### Defined in
|
|
110
110
|
|
|
111
|
-
[src/Polygon.ts:48](https://github.com/Immugio/three-math-extensions/blob/
|
|
111
|
+
[src/Polygon.ts:48](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L48)
|
|
112
112
|
|
|
113
113
|
___
|
|
114
114
|
|
|
@@ -122,7 +122,7 @@ ___
|
|
|
122
122
|
|
|
123
123
|
#### Defined in
|
|
124
124
|
|
|
125
|
-
[src/Polygon.ts:29](https://github.com/Immugio/three-math-extensions/blob/
|
|
125
|
+
[src/Polygon.ts:29](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L29)
|
|
126
126
|
|
|
127
127
|
___
|
|
128
128
|
|
|
@@ -136,7 +136,7 @@ ___
|
|
|
136
136
|
|
|
137
137
|
#### Defined in
|
|
138
138
|
|
|
139
|
-
[src/Polygon.ts:115](https://github.com/Immugio/three-math-extensions/blob/
|
|
139
|
+
[src/Polygon.ts:115](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L115)
|
|
140
140
|
|
|
141
141
|
___
|
|
142
142
|
|
|
@@ -150,7 +150,7 @@ ___
|
|
|
150
150
|
|
|
151
151
|
#### Defined in
|
|
152
152
|
|
|
153
|
-
[src/Polygon.ts:57](https://github.com/Immugio/three-math-extensions/blob/
|
|
153
|
+
[src/Polygon.ts:57](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L57)
|
|
154
154
|
|
|
155
155
|
___
|
|
156
156
|
|
|
@@ -170,7 +170,7 @@ ___
|
|
|
170
170
|
|
|
171
171
|
#### Defined in
|
|
172
172
|
|
|
173
|
-
[src/Polygon.ts:119](https://github.com/Immugio/three-math-extensions/blob/
|
|
173
|
+
[src/Polygon.ts:119](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L119)
|
|
174
174
|
|
|
175
175
|
___
|
|
176
176
|
|
|
@@ -184,7 +184,7 @@ ___
|
|
|
184
184
|
|
|
185
185
|
#### Defined in
|
|
186
186
|
|
|
187
|
-
[src/Polygon.ts:96](https://github.com/Immugio/three-math-extensions/blob/
|
|
187
|
+
[src/Polygon.ts:96](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L96)
|
|
188
188
|
|
|
189
189
|
___
|
|
190
190
|
|
|
@@ -198,7 +198,7 @@ ___
|
|
|
198
198
|
|
|
199
199
|
#### Defined in
|
|
200
200
|
|
|
201
|
-
[src/Polygon.ts:86](https://github.com/Immugio/three-math-extensions/blob/
|
|
201
|
+
[src/Polygon.ts:86](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L86)
|
|
202
202
|
|
|
203
203
|
___
|
|
204
204
|
|
|
@@ -212,7 +212,7 @@ ___
|
|
|
212
212
|
|
|
213
213
|
#### Defined in
|
|
214
214
|
|
|
215
|
-
[src/Polygon.ts:110](https://github.com/Immugio/three-math-extensions/blob/
|
|
215
|
+
[src/Polygon.ts:110](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L110)
|
|
216
216
|
|
|
217
217
|
___
|
|
218
218
|
|
|
@@ -233,7 +233,7 @@ ___
|
|
|
233
233
|
|
|
234
234
|
#### Defined in
|
|
235
235
|
|
|
236
|
-
[src/Polygon.ts:11](https://github.com/Immugio/three-math-extensions/blob/
|
|
236
|
+
[src/Polygon.ts:11](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L11)
|
|
237
237
|
|
|
238
238
|
___
|
|
239
239
|
|
|
@@ -254,4 +254,4 @@ ___
|
|
|
254
254
|
|
|
255
255
|
#### Defined in
|
|
256
256
|
|
|
257
|
-
[src/Polygon.ts:15](https://github.com/Immugio/three-math-extensions/blob/
|
|
257
|
+
[src/Polygon.ts:15](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Polygon.ts#L15)
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
#### Defined in
|
|
52
52
|
|
|
53
|
-
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/
|
|
53
|
+
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L7)
|
|
54
54
|
|
|
55
55
|
## Properties
|
|
56
56
|
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
#### Defined in
|
|
62
62
|
|
|
63
|
-
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/
|
|
63
|
+
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L7)
|
|
64
64
|
|
|
65
65
|
___
|
|
66
66
|
|
|
@@ -70,7 +70,7 @@ ___
|
|
|
70
70
|
|
|
71
71
|
#### Defined in
|
|
72
72
|
|
|
73
|
-
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/
|
|
73
|
+
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L7)
|
|
74
74
|
|
|
75
75
|
___
|
|
76
76
|
|
|
@@ -80,7 +80,7 @@ ___
|
|
|
80
80
|
|
|
81
81
|
#### Defined in
|
|
82
82
|
|
|
83
|
-
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/
|
|
83
|
+
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L7)
|
|
84
84
|
|
|
85
85
|
___
|
|
86
86
|
|
|
@@ -90,7 +90,7 @@ ___
|
|
|
90
90
|
|
|
91
91
|
#### Defined in
|
|
92
92
|
|
|
93
|
-
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/
|
|
93
|
+
[src/Rectangle.ts:7](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L7)
|
|
94
94
|
|
|
95
95
|
## Accessors
|
|
96
96
|
|
|
@@ -104,7 +104,7 @@ ___
|
|
|
104
104
|
|
|
105
105
|
#### Defined in
|
|
106
106
|
|
|
107
|
-
[src/Rectangle.ts:20](https://github.com/Immugio/three-math-extensions/blob/
|
|
107
|
+
[src/Rectangle.ts:20](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L20)
|
|
108
108
|
|
|
109
109
|
___
|
|
110
110
|
|
|
@@ -118,7 +118,7 @@ ___
|
|
|
118
118
|
|
|
119
119
|
#### Defined in
|
|
120
120
|
|
|
121
|
-
[src/Rectangle.ts:41](https://github.com/Immugio/three-math-extensions/blob/
|
|
121
|
+
[src/Rectangle.ts:41](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L41)
|
|
122
122
|
|
|
123
123
|
___
|
|
124
124
|
|
|
@@ -132,7 +132,7 @@ ___
|
|
|
132
132
|
|
|
133
133
|
#### Defined in
|
|
134
134
|
|
|
135
|
-
[src/Rectangle.ts:27](https://github.com/Immugio/three-math-extensions/blob/
|
|
135
|
+
[src/Rectangle.ts:27](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L27)
|
|
136
136
|
|
|
137
137
|
___
|
|
138
138
|
|
|
@@ -146,7 +146,7 @@ ___
|
|
|
146
146
|
|
|
147
147
|
#### Defined in
|
|
148
148
|
|
|
149
|
-
[src/Rectangle.ts:13](https://github.com/Immugio/three-math-extensions/blob/
|
|
149
|
+
[src/Rectangle.ts:13](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L13)
|
|
150
150
|
|
|
151
151
|
## Methods
|
|
152
152
|
|
|
@@ -160,7 +160,7 @@ ___
|
|
|
160
160
|
|
|
161
161
|
#### Defined in
|
|
162
162
|
|
|
163
|
-
[src/Rectangle.ts:54](https://github.com/Immugio/three-math-extensions/blob/
|
|
163
|
+
[src/Rectangle.ts:54](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L54)
|
|
164
164
|
|
|
165
165
|
___
|
|
166
166
|
|
|
@@ -174,7 +174,7 @@ ___
|
|
|
174
174
|
|
|
175
175
|
#### Defined in
|
|
176
176
|
|
|
177
|
-
[src/Rectangle.ts:9](https://github.com/Immugio/three-math-extensions/blob/
|
|
177
|
+
[src/Rectangle.ts:9](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L9)
|
|
178
178
|
|
|
179
179
|
___
|
|
180
180
|
|
|
@@ -194,7 +194,7 @@ ___
|
|
|
194
194
|
|
|
195
195
|
#### Defined in
|
|
196
196
|
|
|
197
|
-
[src/Rectangle.ts:90](https://github.com/Immugio/three-math-extensions/blob/
|
|
197
|
+
[src/Rectangle.ts:90](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L90)
|
|
198
198
|
|
|
199
199
|
___
|
|
200
200
|
|
|
@@ -214,7 +214,7 @@ ___
|
|
|
214
214
|
|
|
215
215
|
#### Defined in
|
|
216
216
|
|
|
217
|
-
[src/Rectangle.ts:80](https://github.com/Immugio/three-math-extensions/blob/
|
|
217
|
+
[src/Rectangle.ts:80](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L80)
|
|
218
218
|
|
|
219
219
|
___
|
|
220
220
|
|
|
@@ -234,7 +234,7 @@ ___
|
|
|
234
234
|
|
|
235
235
|
#### Defined in
|
|
236
236
|
|
|
237
|
-
[src/Rectangle.ts:34](https://github.com/Immugio/three-math-extensions/blob/
|
|
237
|
+
[src/Rectangle.ts:34](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L34)
|
|
238
238
|
|
|
239
239
|
___
|
|
240
240
|
|
|
@@ -250,7 +250,7 @@ The polygon is always constructed as "clockwise", assuming X axis to the right a
|
|
|
250
250
|
|
|
251
251
|
#### Defined in
|
|
252
252
|
|
|
253
|
-
[src/Rectangle.ts:71](https://github.com/Immugio/three-math-extensions/blob/
|
|
253
|
+
[src/Rectangle.ts:71](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L71)
|
|
254
254
|
|
|
255
255
|
___
|
|
256
256
|
|
|
@@ -264,7 +264,7 @@ ___
|
|
|
264
264
|
|
|
265
265
|
#### Defined in
|
|
266
266
|
|
|
267
|
-
[src/Rectangle.ts:64](https://github.com/Immugio/three-math-extensions/blob/
|
|
267
|
+
[src/Rectangle.ts:64](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L64)
|
|
268
268
|
|
|
269
269
|
___
|
|
270
270
|
|
|
@@ -284,4 +284,4 @@ ___
|
|
|
284
284
|
|
|
285
285
|
#### Defined in
|
|
286
286
|
|
|
287
|
-
[src/Rectangle.ts:45](https://github.com/Immugio/three-math-extensions/blob/
|
|
287
|
+
[src/Rectangle.ts:45](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Rectangle.ts#L45)
|
package/docs/classes/Size2.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
#### Defined in
|
|
30
30
|
|
|
31
|
-
[src/Size2.ts:2](https://github.com/Immugio/three-math-extensions/blob/
|
|
31
|
+
[src/Size2.ts:2](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Size2.ts#L2)
|
|
32
32
|
|
|
33
33
|
## Properties
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
#### Defined in
|
|
40
40
|
|
|
41
|
-
[src/Size2.ts:2](https://github.com/Immugio/three-math-extensions/blob/
|
|
41
|
+
[src/Size2.ts:2](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Size2.ts#L2)
|
|
42
42
|
|
|
43
43
|
___
|
|
44
44
|
|
|
@@ -48,4 +48,4 @@ ___
|
|
|
48
48
|
|
|
49
49
|
#### Defined in
|
|
50
50
|
|
|
51
|
-
[src/Size2.ts:2](https://github.com/Immugio/three-math-extensions/blob/
|
|
51
|
+
[src/Size2.ts:2](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Size2.ts#L2)
|
package/docs/classes/Vec2.md
CHANGED
|
@@ -21,9 +21,11 @@ Vec2 represents a 2D vector. It extends `Vector2` from the `threejs` library.
|
|
|
21
21
|
- [in3DSpace](Vec2.md#in3dspace)
|
|
22
22
|
- [isNear](Vec2.md#isnear)
|
|
23
23
|
- [moveTowards](Vec2.md#movetowards)
|
|
24
|
+
- [parallelTo](Vec2.md#parallelto)
|
|
24
25
|
- [roundIfCloseToInteger](Vec2.md#roundifclosetointeger)
|
|
25
26
|
- [signedAngle](Vec2.md#signedangle)
|
|
26
27
|
- [fromPoint](Vec2.md#frompoint)
|
|
28
|
+
- [fromPoints](Vec2.md#frompoints)
|
|
27
29
|
|
|
28
30
|
## Constructors
|
|
29
31
|
|
|
@@ -68,7 +70,7 @@ A new Vec3 instance.
|
|
|
68
70
|
|
|
69
71
|
#### Defined in
|
|
70
72
|
|
|
71
|
-
[src/Vec2.ts:
|
|
73
|
+
[src/Vec2.ts:60](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Vec2.ts#L60)
|
|
72
74
|
|
|
73
75
|
___
|
|
74
76
|
|
|
@@ -92,7 +94,7 @@ maxDistance is the maximum distance between the two vectors within which they ar
|
|
|
92
94
|
|
|
93
95
|
#### Defined in
|
|
94
96
|
|
|
95
|
-
[src/Vec2.ts:
|
|
97
|
+
[src/Vec2.ts:68](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Vec2.ts#L68)
|
|
96
98
|
|
|
97
99
|
___
|
|
98
100
|
|
|
@@ -117,7 +119,30 @@ This Vec2 instance.
|
|
|
117
119
|
|
|
118
120
|
#### Defined in
|
|
119
121
|
|
|
120
|
-
[src/Vec2.ts:
|
|
122
|
+
[src/Vec2.ts:34](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Vec2.ts#L34)
|
|
123
|
+
|
|
124
|
+
___
|
|
125
|
+
|
|
126
|
+
### parallelTo
|
|
127
|
+
|
|
128
|
+
▸ **parallelTo**(`other`, `toleranceRadians?`): `boolean`
|
|
129
|
+
|
|
130
|
+
check if the angle between the two vectors is close enough to 0 or 180 degrees (same or opposite direction) within the given tolerance
|
|
131
|
+
|
|
132
|
+
#### Parameters
|
|
133
|
+
|
|
134
|
+
| Name | Type | Default value | Description |
|
|
135
|
+
| :------ | :------ | :------ | :------ |
|
|
136
|
+
| `other` | `Vector2` | `undefined` | Vector2 |
|
|
137
|
+
| `toleranceRadians` | `number` | `0` | number angle tolerance in radians |
|
|
138
|
+
|
|
139
|
+
#### Returns
|
|
140
|
+
|
|
141
|
+
`boolean`
|
|
142
|
+
|
|
143
|
+
#### Defined in
|
|
144
|
+
|
|
145
|
+
[src/Vec2.ts:89](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Vec2.ts#L89)
|
|
121
146
|
|
|
122
147
|
___
|
|
123
148
|
|
|
@@ -141,7 +166,7 @@ This Vec2 instance.
|
|
|
141
166
|
|
|
142
167
|
#### Defined in
|
|
143
168
|
|
|
144
|
-
[src/Vec2.ts:
|
|
169
|
+
[src/Vec2.ts:45](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Vec2.ts#L45)
|
|
145
170
|
|
|
146
171
|
___
|
|
147
172
|
|
|
@@ -157,7 +182,7 @@ Returns the angle between this vector and positive x-axis, the return value is b
|
|
|
157
182
|
|
|
158
183
|
#### Defined in
|
|
159
184
|
|
|
160
|
-
[src/Vec2.ts:
|
|
185
|
+
[src/Vec2.ts:79](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Vec2.ts#L79)
|
|
161
186
|
|
|
162
187
|
___
|
|
163
188
|
|
|
@@ -181,4 +206,27 @@ A new Vec2 instance.
|
|
|
181
206
|
|
|
182
207
|
#### Defined in
|
|
183
208
|
|
|
184
|
-
[src/Vec2.ts:16](https://github.com/Immugio/three-math-extensions/blob/
|
|
209
|
+
[src/Vec2.ts:16](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Vec2.ts#L16)
|
|
210
|
+
|
|
211
|
+
___
|
|
212
|
+
|
|
213
|
+
### fromPoints
|
|
214
|
+
|
|
215
|
+
▸ `Static` **fromPoints**(`...points`): [`Vec2`](Vec2.md)[]
|
|
216
|
+
|
|
217
|
+
Creates a new Vec2[] array from arguments of {x, y} objects.
|
|
218
|
+
*
|
|
219
|
+
|
|
220
|
+
#### Parameters
|
|
221
|
+
|
|
222
|
+
| Name | Type | Description |
|
|
223
|
+
| :------ | :------ | :------ |
|
|
224
|
+
| `...points` | [`Point2`](../interfaces/Point2.md)[] | The ...{x, y} instances. |
|
|
225
|
+
|
|
226
|
+
#### Returns
|
|
227
|
+
|
|
228
|
+
[`Vec2`](Vec2.md)[]
|
|
229
|
+
|
|
230
|
+
#### Defined in
|
|
231
|
+
|
|
232
|
+
[src/Vec2.ts:24](https://github.com/Immugio/three-math-extensions/blob/66cba15/src/Vec2.ts#L24)
|