@vived/app 2.14.0 → 2.15.3
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/lib/Entities/Babylon.js +1 -1
- package/lib/Entities/FocusCamera.js +9 -9
- package/lib/Entities/MemoizedBoolean.d.ts +1 -0
- package/lib/Entities/MemoizedBoolean.js +3 -0
- package/lib/Entities/MemoizedNumber.d.ts +1 -0
- package/lib/Entities/MemoizedNumber.js +3 -0
- package/lib/Entities/MemoizedString.d.ts +1 -0
- package/lib/Entities/MemoizedString.js +3 -0
- package/lib/Entities/MemoizedVector2.d.ts +1 -0
- package/lib/Entities/MemoizedVector2.js +4 -1
- package/lib/Entities/MemoizedVector3.d.ts +1 -0
- package/lib/Entities/MemoizedVector3.js +4 -1
- package/lib/Entities/QuestionChallenge.d.ts +21 -0
- package/lib/Entities/QuestionChallenge.js +103 -0
- package/lib/Entities/QuestionChallengeAnswer.d.ts +32 -0
- package/lib/Entities/QuestionChallengeAnswer.js +51 -0
- package/lib/Entities/index.d.ts +2 -0
- package/lib/Entities/index.js +2 -0
- package/lib/PresentationManagers/QuestionChallenge/AuthorQuestionChallengeAnswerPM.d.ts +24 -0
- package/lib/PresentationManagers/QuestionChallenge/AuthorQuestionChallengeAnswerPM.js +65 -0
- package/lib/PresentationManagers/QuestionChallenge/AuthorQuestionChallengePM.d.ts +17 -0
- package/lib/PresentationManagers/QuestionChallenge/AuthorQuestionChallengePM.js +46 -0
- package/lib/PresentationManagers/QuestionChallenge/QuestionChallengeAnswerPM.d.ts +17 -0
- package/lib/PresentationManagers/QuestionChallenge/QuestionChallengeAnswerPM.js +51 -0
- package/lib/PresentationManagers/QuestionChallenge/QuestionChallengePM.d.ts +15 -0
- package/lib/PresentationManagers/QuestionChallenge/QuestionChallengePM.js +34 -0
- package/lib/PresentationManagers/QuestionChallenge/index.d.ts +4 -0
- package/lib/PresentationManagers/QuestionChallenge/index.js +16 -0
- package/lib/PresentationManagers/index.d.ts +1 -0
- package/lib/PresentationManagers/index.js +1 -0
- package/lib/UseCases/FocusCamera/BumpDollyFocusCamera.js +3 -3
- package/lib/UseCases/FocusCamera/PinchDollyFocusCamera.js +3 -3
- package/lib/UseCases/FocusCamera/PixelDollyFocusCamera.js +3 -3
- package/lib/UseCases/FocusCamera/PixelOrbitFocusCamera.js +1 -1
- package/lib/UseCases/FocusCamera/PixelPlanePanFocusCamera.js +1 -1
- package/lib/UseCases/QuestionChallenge/SerializeQuestionChallenge.d.ts +25 -0
- package/lib/UseCases/QuestionChallenge/SerializeQuestionChallenge.js +70 -0
- package/lib/UseCases/QuestionChallenge/index.d.ts +4 -0
- package/lib/UseCases/QuestionChallenge/index.js +16 -0
- package/lib/UseCases/QuestionChallenge/setQuesionChallengeAnswerFeedback.d.ts +2 -0
- package/lib/UseCases/QuestionChallenge/setQuesionChallengeAnswerFeedback.js +16 -0
- package/lib/UseCases/QuestionChallenge/setQuesionChallengeAnswerText.d.ts +2 -0
- package/lib/UseCases/QuestionChallenge/setQuesionChallengeAnswerText.js +16 -0
- package/lib/UseCases/QuestionChallenge/toggleQuesionChallengeAnswerIsCorrect.d.ts +2 -0
- package/lib/UseCases/QuestionChallenge/toggleQuesionChallengeAnswerIsCorrect.js +16 -0
- package/lib/UseCases/index.d.ts +1 -0
- package/lib/UseCases/index.js +1 -0
- package/lib/ValueObjects/Angle.d.ts +2 -2
- package/lib/ValueObjects/Angle.js +2 -2
- package/lib/ValueObjects/Color.d.ts +4 -8
- package/lib/ValueObjects/Color.js +9 -21
- package/lib/ValueObjects/LineSegment2D.d.ts +5 -6
- package/lib/ValueObjects/LineSegment2D.js +46 -30
- package/lib/ValueObjects/ParametricLine.d.ts +1 -1
- package/lib/ValueObjects/ParametricLine.js +8 -8
- package/lib/ValueObjects/ParametricPlane.d.ts +1 -1
- package/lib/ValueObjects/ParametricPlane.js +10 -10
- package/lib/ValueObjects/Vector2.d.ts +11 -11
- package/lib/ValueObjects/Vector2.js +14 -14
- package/lib/ValueObjects/Vector3.d.ts +16 -16
- package/lib/ValueObjects/Vector3.js +18 -18
- package/package.json +1 -1
|
@@ -13,31 +13,31 @@ class ParametricPlane {
|
|
|
13
13
|
}
|
|
14
14
|
static FromThreePoints(A, B, C) {
|
|
15
15
|
const point = A;
|
|
16
|
-
const AB = Vector3_1.Vector3.
|
|
17
|
-
const AC = Vector3_1.Vector3.
|
|
18
|
-
const normal = Vector3_1.Vector3.
|
|
16
|
+
const AB = Vector3_1.Vector3.Subtract(B, A);
|
|
17
|
+
const AC = Vector3_1.Vector3.Subtract(C, A);
|
|
18
|
+
const normal = Vector3_1.Vector3.Cross(AB, AC);
|
|
19
19
|
return new ParametricPlane(point, normal);
|
|
20
20
|
}
|
|
21
21
|
static XY() {
|
|
22
|
-
const p = Vector3_1.Vector3.
|
|
22
|
+
const p = Vector3_1.Vector3.Zero();
|
|
23
23
|
const n = new Vector3_1.Vector3(0, 0, 1);
|
|
24
24
|
return new ParametricPlane(p, n);
|
|
25
25
|
}
|
|
26
26
|
static ZX() {
|
|
27
|
-
const p = Vector3_1.Vector3.
|
|
27
|
+
const p = Vector3_1.Vector3.Zero();
|
|
28
28
|
const n = new Vector3_1.Vector3(0, 1, 0);
|
|
29
29
|
return new ParametricPlane(p, n);
|
|
30
30
|
}
|
|
31
31
|
static YZ() {
|
|
32
|
-
const p = Vector3_1.Vector3.
|
|
32
|
+
const p = Vector3_1.Vector3.Zero();
|
|
33
33
|
const n = new Vector3_1.Vector3(1, 0, 0);
|
|
34
34
|
return new ParametricPlane(p, n);
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
GetParameters() {
|
|
37
37
|
const a = this.normal.x;
|
|
38
38
|
const b = this.normal.y;
|
|
39
39
|
const c = this.normal.z;
|
|
40
|
-
let d = Vector3_1.Vector3.
|
|
40
|
+
let d = Vector3_1.Vector3.Dot(this.point, this.normal);
|
|
41
41
|
if (d !== 0) {
|
|
42
42
|
d *= -1;
|
|
43
43
|
}
|
|
@@ -50,14 +50,14 @@ class ParametricPlane {
|
|
|
50
50
|
}
|
|
51
51
|
intersectLine(line) {
|
|
52
52
|
const { x0, y0, z0, a, b, c } = line;
|
|
53
|
-
const { a: A, b: B, c: C, d: D } = this.
|
|
53
|
+
const { a: A, b: B, c: C, d: D } = this.GetParameters();
|
|
54
54
|
const tNumerator = -(A * x0 + B * y0 + C * z0 + D);
|
|
55
55
|
const tDenominator = A * a + B * b + C * c;
|
|
56
56
|
if (tDenominator === 0) {
|
|
57
57
|
return undefined;
|
|
58
58
|
}
|
|
59
59
|
const t = tNumerator / tDenominator;
|
|
60
|
-
const intersect = ParametricLine_1.ParametricLine.
|
|
60
|
+
const intersect = ParametricLine_1.ParametricLine.GetPointAtDistance(line, t);
|
|
61
61
|
return intersect;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Angle } from ".";
|
|
2
2
|
export declare class Vector2 {
|
|
3
3
|
static zero(): Vector2;
|
|
4
|
-
static
|
|
5
|
-
static
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static
|
|
13
|
-
static
|
|
14
|
-
static
|
|
4
|
+
static One(): Vector2;
|
|
5
|
+
static Equal(a: Vector2, b: Vector2): boolean;
|
|
6
|
+
static Add(a: Vector2, b: Vector2): Vector2;
|
|
7
|
+
static Subtract(a: Vector2, b: Vector2): Vector2;
|
|
8
|
+
static Close: (a: Vector2, b: Vector2, threshold?: number) => boolean;
|
|
9
|
+
static Rotate: (vec: Vector2, angle: Angle) => Vector2;
|
|
10
|
+
static Scale: (vector: Vector2, scale: number) => Vector2;
|
|
11
|
+
static NewVectorOfLength: (vector: Vector2, length: number) => Vector2;
|
|
12
|
+
static Dot: (a: Vector2, b: Vector2) => number;
|
|
13
|
+
static AngleBetween: (a: Vector2, b: Vector2) => Angle;
|
|
14
|
+
static Cross: (a: Vector2, b: Vector2) => number;
|
|
15
15
|
readonly x: number;
|
|
16
16
|
readonly y: number;
|
|
17
17
|
get magnitued(): number;
|
|
@@ -10,20 +10,20 @@ class Vector2 {
|
|
|
10
10
|
static zero() {
|
|
11
11
|
return new Vector2(0, 0);
|
|
12
12
|
}
|
|
13
|
-
static
|
|
13
|
+
static One() {
|
|
14
14
|
return new Vector2(1, 1);
|
|
15
15
|
}
|
|
16
|
-
static
|
|
16
|
+
static Equal(a, b) {
|
|
17
17
|
if (a.x !== b.x)
|
|
18
18
|
return false;
|
|
19
19
|
if (a.y !== b.y)
|
|
20
20
|
return false;
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
|
-
static
|
|
23
|
+
static Add(a, b) {
|
|
24
24
|
return new Vector2(a.x + b.x, a.y + b.y);
|
|
25
25
|
}
|
|
26
|
-
static
|
|
26
|
+
static Subtract(a, b) {
|
|
27
27
|
return new Vector2(a.x - b.x, a.y - b.y);
|
|
28
28
|
}
|
|
29
29
|
get magnitued() {
|
|
@@ -49,39 +49,39 @@ class Vector2 {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
exports.Vector2 = Vector2;
|
|
52
|
-
Vector2.
|
|
53
|
-
const diff = Vector2.
|
|
52
|
+
Vector2.Close = (a, b, threshold = 0.01) => {
|
|
53
|
+
const diff = Vector2.Subtract(a, b);
|
|
54
54
|
const diffMag = diff.magnitued;
|
|
55
55
|
if (diffMag < threshold)
|
|
56
56
|
return true;
|
|
57
57
|
else
|
|
58
58
|
return false;
|
|
59
59
|
};
|
|
60
|
-
Vector2.
|
|
60
|
+
Vector2.Rotate = (vec, angle) => {
|
|
61
61
|
const x = vec.x * Math.cos(angle.radians) - vec.y * Math.sin(angle.radians);
|
|
62
62
|
const y = vec.x * Math.sin(angle.radians) + vec.y * Math.cos(angle.radians);
|
|
63
63
|
return new Vector2(x, y);
|
|
64
64
|
};
|
|
65
|
-
Vector2.
|
|
65
|
+
Vector2.Scale = (vector, scale) => {
|
|
66
66
|
const x = scale * vector.x;
|
|
67
67
|
const y = scale * vector.y;
|
|
68
68
|
return new Vector2(x, y);
|
|
69
69
|
};
|
|
70
|
-
Vector2.
|
|
70
|
+
Vector2.NewVectorOfLength = (vector, length) => {
|
|
71
71
|
const unit = vector.unit;
|
|
72
72
|
const x = length * unit.x;
|
|
73
73
|
const y = length * unit.y;
|
|
74
74
|
return new Vector2(x, y);
|
|
75
75
|
};
|
|
76
|
-
Vector2.
|
|
76
|
+
Vector2.Dot = (a, b) => {
|
|
77
77
|
return a.x * b.x + a.y * b.y;
|
|
78
78
|
};
|
|
79
|
-
Vector2.
|
|
80
|
-
const dot = Vector2.
|
|
79
|
+
Vector2.AngleBetween = (a, b) => {
|
|
80
|
+
const dot = Vector2.Dot(a, b);
|
|
81
81
|
const magnitues = a.magnitued * b.magnitued;
|
|
82
82
|
const angRadians = Math.acos(dot / magnitues);
|
|
83
|
-
return _1.Angle.
|
|
83
|
+
return _1.Angle.FromRadians(angRadians);
|
|
84
84
|
};
|
|
85
|
-
Vector2.
|
|
85
|
+
Vector2.Cross = (a, b) => {
|
|
86
86
|
return a.x * b.y - a.y * b.x;
|
|
87
87
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export declare class Vector3 {
|
|
2
|
-
static
|
|
3
|
-
static
|
|
4
|
-
static
|
|
5
|
-
static
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static
|
|
13
|
-
static
|
|
14
|
-
static
|
|
15
|
-
static
|
|
16
|
-
static
|
|
17
|
-
static
|
|
2
|
+
static Zero(): Vector3;
|
|
3
|
+
static One(): Vector3;
|
|
4
|
+
static Right(length?: number): Vector3;
|
|
5
|
+
static Left(length?: number): Vector3;
|
|
6
|
+
static Up(length?: number): Vector3;
|
|
7
|
+
static Down(length?: number): Vector3;
|
|
8
|
+
static Forward(length?: number): Vector3;
|
|
9
|
+
static Backward(length?: number): Vector3;
|
|
10
|
+
static FromArray(values: [number, number, number]): Vector3;
|
|
11
|
+
static Add: (a: Vector3, b: Vector3) => Vector3;
|
|
12
|
+
static Subtract: (a: Vector3, b: Vector3) => Vector3;
|
|
13
|
+
static Equal: (a: Vector3, b: Vector3) => boolean;
|
|
14
|
+
static Close: (a: Vector3, b: Vector3, tolerance?: number) => boolean;
|
|
15
|
+
static Cross: (a: Vector3, b: Vector3) => Vector3;
|
|
16
|
+
static Dot: (a: Vector3, b: Vector3) => number;
|
|
17
|
+
static NewVectorOfLength: (vec: Vector3, length: number) => Vector3;
|
|
18
18
|
readonly x: number;
|
|
19
19
|
readonly y: number;
|
|
20
20
|
readonly z: number;
|
|
@@ -7,31 +7,31 @@ class Vector3 {
|
|
|
7
7
|
this.y = y;
|
|
8
8
|
this.z = z;
|
|
9
9
|
}
|
|
10
|
-
static
|
|
10
|
+
static Zero() {
|
|
11
11
|
return new Vector3(0, 0, 0);
|
|
12
12
|
}
|
|
13
|
-
static
|
|
13
|
+
static One() {
|
|
14
14
|
return new Vector3(1, 1, 1);
|
|
15
15
|
}
|
|
16
|
-
static
|
|
16
|
+
static Right(length = 1) {
|
|
17
17
|
return new Vector3(length, 0, 0);
|
|
18
18
|
}
|
|
19
|
-
static
|
|
19
|
+
static Left(length = 1) {
|
|
20
20
|
return new Vector3(-length, 0, 0);
|
|
21
21
|
}
|
|
22
|
-
static
|
|
22
|
+
static Up(length = 1) {
|
|
23
23
|
return new Vector3(0, length, 0);
|
|
24
24
|
}
|
|
25
|
-
static
|
|
25
|
+
static Down(length = 1) {
|
|
26
26
|
return new Vector3(0, -length, 0);
|
|
27
27
|
}
|
|
28
|
-
static
|
|
28
|
+
static Forward(length = 1) {
|
|
29
29
|
return new Vector3(0, 0, length);
|
|
30
30
|
}
|
|
31
|
-
static
|
|
31
|
+
static Backward(length = 1) {
|
|
32
32
|
return new Vector3(0, 0, -length);
|
|
33
33
|
}
|
|
34
|
-
static
|
|
34
|
+
static FromArray(values) {
|
|
35
35
|
return new Vector3(values[0], values[1], values[2]);
|
|
36
36
|
}
|
|
37
37
|
get magnitued() {
|
|
@@ -44,7 +44,7 @@ class Vector3 {
|
|
|
44
44
|
get unit() {
|
|
45
45
|
const mag = this.magnitued;
|
|
46
46
|
if (mag === 0) {
|
|
47
|
-
return Vector3.
|
|
47
|
+
return Vector3.Zero();
|
|
48
48
|
}
|
|
49
49
|
const unitX = this.x / mag;
|
|
50
50
|
const unitY = this.y / mag;
|
|
@@ -56,36 +56,36 @@ class Vector3 {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
exports.Vector3 = Vector3;
|
|
59
|
-
Vector3.
|
|
59
|
+
Vector3.Add = (a, b) => {
|
|
60
60
|
return new Vector3(a.x + b.x, a.y + b.y, a.z + b.z);
|
|
61
61
|
};
|
|
62
|
-
Vector3.
|
|
62
|
+
Vector3.Subtract = (a, b) => {
|
|
63
63
|
return new Vector3(a.x - b.x, a.y - b.y, a.z - b.z);
|
|
64
64
|
};
|
|
65
|
-
Vector3.
|
|
65
|
+
Vector3.Equal = (a, b) => {
|
|
66
66
|
if (a.x === b.x && a.y === b.y && a.z === b.z)
|
|
67
67
|
return true;
|
|
68
68
|
else
|
|
69
69
|
return false;
|
|
70
70
|
};
|
|
71
|
-
Vector3.
|
|
72
|
-
const diff = Vector3.
|
|
71
|
+
Vector3.Close = (a, b, tolerance = 0.01) => {
|
|
72
|
+
const diff = Vector3.Subtract(a, b);
|
|
73
73
|
const diffMag = diff.magnitued;
|
|
74
74
|
if (diffMag < tolerance)
|
|
75
75
|
return true;
|
|
76
76
|
else
|
|
77
77
|
return false;
|
|
78
78
|
};
|
|
79
|
-
Vector3.
|
|
79
|
+
Vector3.Cross = (a, b) => {
|
|
80
80
|
const x = a.y * b.z - a.z * b.y;
|
|
81
81
|
const y = a.z * b.x - a.x * b.z;
|
|
82
82
|
const z = a.x * b.y - a.y * b.x;
|
|
83
83
|
return new Vector3(x, y, z);
|
|
84
84
|
};
|
|
85
|
-
Vector3.
|
|
85
|
+
Vector3.Dot = (a, b) => {
|
|
86
86
|
return a.x * b.x + a.y * b.y + a.z * b.z;
|
|
87
87
|
};
|
|
88
|
-
Vector3.
|
|
88
|
+
Vector3.NewVectorOfLength = (vec, length) => {
|
|
89
89
|
const unit = vec.unit;
|
|
90
90
|
return new Vector3(length * unit.x, length * unit.y, length * unit.z);
|
|
91
91
|
};
|