@vived/app 2.12.0 → 2.15.2

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.
Files changed (66) hide show
  1. package/lib/Entities/Babylon.js +1 -1
  2. package/lib/Entities/FocusCamera.js +9 -9
  3. package/lib/Entities/MemoizedBoolean.d.ts +1 -0
  4. package/lib/Entities/MemoizedBoolean.js +3 -0
  5. package/lib/Entities/MemoizedNumber.d.ts +1 -0
  6. package/lib/Entities/MemoizedNumber.js +3 -0
  7. package/lib/Entities/MemoizedString.d.ts +1 -0
  8. package/lib/Entities/MemoizedString.js +3 -0
  9. package/lib/Entities/MemoizedVector2.d.ts +1 -0
  10. package/lib/Entities/MemoizedVector2.js +4 -1
  11. package/lib/Entities/MemoizedVector3.d.ts +1 -0
  12. package/lib/Entities/MemoizedVector3.js +4 -1
  13. package/lib/Entities/MouseInput.d.ts +11 -5
  14. package/lib/Entities/MouseInput.js +21 -6
  15. package/lib/Entities/QuestionChallenge.d.ts +21 -0
  16. package/lib/Entities/QuestionChallenge.js +103 -0
  17. package/lib/Entities/QuestionChallengeAnswer.d.ts +32 -0
  18. package/lib/Entities/QuestionChallengeAnswer.js +51 -0
  19. package/lib/Entities/TouchInput.d.ts +15 -7
  20. package/lib/Entities/TouchInput.js +53 -24
  21. package/lib/Entities/index.d.ts +2 -0
  22. package/lib/Entities/index.js +2 -0
  23. package/lib/PresentationManagers/QuestionChallenge/AuthorQuestionChallengeAnswerPM.d.ts +24 -0
  24. package/lib/PresentationManagers/QuestionChallenge/AuthorQuestionChallengeAnswerPM.js +65 -0
  25. package/lib/PresentationManagers/QuestionChallenge/AuthorQuestionChallengePM.d.ts +17 -0
  26. package/lib/PresentationManagers/QuestionChallenge/AuthorQuestionChallengePM.js +46 -0
  27. package/lib/PresentationManagers/QuestionChallenge/QuestionChallengeAnswerPM.d.ts +17 -0
  28. package/lib/PresentationManagers/QuestionChallenge/QuestionChallengeAnswerPM.js +51 -0
  29. package/lib/PresentationManagers/QuestionChallenge/QuestionChallengePM.d.ts +15 -0
  30. package/lib/PresentationManagers/QuestionChallenge/QuestionChallengePM.js +34 -0
  31. package/lib/PresentationManagers/QuestionChallenge/index.d.ts +4 -0
  32. package/lib/PresentationManagers/QuestionChallenge/index.js +16 -0
  33. package/lib/PresentationManagers/index.d.ts +1 -0
  34. package/lib/PresentationManagers/index.js +1 -0
  35. package/lib/UseCases/FocusCamera/BumpDollyFocusCamera.js +3 -3
  36. package/lib/UseCases/FocusCamera/PinchDollyFocusCamera.js +3 -3
  37. package/lib/UseCases/FocusCamera/PixelDollyFocusCamera.js +3 -3
  38. package/lib/UseCases/FocusCamera/PixelOrbitFocusCamera.js +1 -1
  39. package/lib/UseCases/FocusCamera/PixelPlanePanFocusCamera.js +1 -1
  40. package/lib/UseCases/QuestionChallenge/SerializeQuestionChallenge.d.ts +25 -0
  41. package/lib/UseCases/QuestionChallenge/SerializeQuestionChallenge.js +70 -0
  42. package/lib/UseCases/QuestionChallenge/index.d.ts +4 -0
  43. package/lib/UseCases/QuestionChallenge/index.js +16 -0
  44. package/lib/UseCases/QuestionChallenge/setQuesionChallengeAnswerFeedback.d.ts +2 -0
  45. package/lib/UseCases/QuestionChallenge/setQuesionChallengeAnswerFeedback.js +16 -0
  46. package/lib/UseCases/QuestionChallenge/setQuesionChallengeAnswerText.d.ts +2 -0
  47. package/lib/UseCases/QuestionChallenge/setQuesionChallengeAnswerText.js +16 -0
  48. package/lib/UseCases/QuestionChallenge/toggleQuesionChallengeAnswerIsCorrect.d.ts +2 -0
  49. package/lib/UseCases/QuestionChallenge/toggleQuesionChallengeAnswerIsCorrect.js +16 -0
  50. package/lib/UseCases/index.d.ts +1 -0
  51. package/lib/UseCases/index.js +1 -0
  52. package/lib/ValueObjects/Angle.d.ts +2 -2
  53. package/lib/ValueObjects/Angle.js +2 -2
  54. package/lib/ValueObjects/Color.d.ts +4 -8
  55. package/lib/ValueObjects/Color.js +9 -21
  56. package/lib/ValueObjects/LineSegment2D.d.ts +4 -6
  57. package/lib/ValueObjects/LineSegment2D.js +27 -30
  58. package/lib/ValueObjects/ParametricLine.d.ts +1 -1
  59. package/lib/ValueObjects/ParametricLine.js +8 -8
  60. package/lib/ValueObjects/ParametricPlane.d.ts +1 -1
  61. package/lib/ValueObjects/ParametricPlane.js +10 -10
  62. package/lib/ValueObjects/Vector2.d.ts +11 -11
  63. package/lib/ValueObjects/Vector2.js +14 -14
  64. package/lib/ValueObjects/Vector3.d.ts +16 -16
  65. package/lib/ValueObjects/Vector3.js +18 -18
  66. package/package.json +1 -1
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Color = void 0;
4
4
  class Color {
5
5
  constructor(r, g, b, a) {
6
- this._r = this.clampVal(r);
7
- this._g = this.clampVal(g);
8
- this._b = this.clampVal(b);
9
- this._a = this.clampVal(a);
6
+ this.r = this.clampVal(r);
7
+ this.g = this.clampVal(g);
8
+ this.b = this.clampVal(b);
9
+ this.a = this.clampVal(a);
10
10
  }
11
11
  static RGBA(r, g, b, a) {
12
12
  return new Color(r, g, b, a);
@@ -51,32 +51,20 @@ class Color {
51
51
  return false;
52
52
  return true;
53
53
  }
54
- get r() {
55
- return this._r;
56
- }
57
- get g() {
58
- return this._g;
59
- }
60
- get b() {
61
- return this._b;
62
- }
63
- get a() {
64
- return this._a;
65
- }
66
54
  get rPercent() {
67
- return this._r / 255;
55
+ return this.r / 255;
68
56
  }
69
57
  get gPercent() {
70
- return this._g / 255;
58
+ return this.g / 255;
71
59
  }
72
60
  get bPercent() {
73
- return this._b / 255;
61
+ return this.b / 255;
74
62
  }
75
63
  get aPercent() {
76
- return this._a / 255;
64
+ return this.a / 255;
77
65
  }
78
66
  get array() {
79
- return [this._r, this._g, this._b, this._a];
67
+ return [this.r, this.g, this.b, this.a];
80
68
  }
81
69
  clampVal(val) {
82
70
  if (val > 255)
@@ -1,12 +1,10 @@
1
1
  import { Vector2 } from "./Vector2";
2
2
  export declare class LineSegment2D {
3
- private _start;
4
- get start(): Vector2;
5
- private _end;
6
- get end(): Vector2;
3
+ static GetPositionAtPercent(line: LineSegment2D, percent: number): Vector2;
4
+ static Intersect(a: LineSegment2D, b: LineSegment2D, tolerance?: number): Vector2 | undefined;
5
+ readonly start: Vector2;
6
+ readonly end: Vector2;
7
7
  get length(): number;
8
8
  get direction(): Vector2;
9
- getPositionAtPercent(percent: number): Vector2;
10
- intersect(otherLine: LineSegment2D): Vector2 | undefined;
11
9
  constructor(start: Vector2, end: Vector2);
12
10
  }
@@ -4,52 +4,49 @@ exports.LineSegment2D = void 0;
4
4
  const Vector2_1 = require("./Vector2");
5
5
  class LineSegment2D {
6
6
  constructor(start, end) {
7
- this._start = start;
8
- this._end = end;
7
+ this.start = start;
8
+ this.end = end;
9
9
  }
10
- get start() {
11
- return this._start;
10
+ static GetPositionAtPercent(line, percent) {
11
+ const dir = line.direction;
12
+ const length = percent * line.length;
13
+ const localPos = Vector2_1.Vector2.NewVectorOfLength(dir, length);
14
+ return Vector2_1.Vector2.Add(line.start, localPos);
12
15
  }
13
- get end() {
14
- return this._end;
15
- }
16
- get length() {
17
- return Vector2_1.Vector2.subtract(this._start, this._end).magnitued;
18
- }
19
- get direction() {
20
- return Vector2_1.Vector2.subtract(this._end, this._start).unit;
21
- }
22
- getPositionAtPercent(percent) {
23
- const dir = this.direction;
24
- const length = percent * this.length;
25
- const localPos = Vector2_1.Vector2.newVectorOfLength(dir, length);
26
- return Vector2_1.Vector2.add(this._start, localPos);
27
- }
28
- intersect(otherLine) {
16
+ static Intersect(a, b, tolerance = 0) {
29
17
  // See https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection
30
- const x1 = this._start.x;
31
- const y1 = this._start.y;
32
- const x2 = this._end.x;
33
- const y2 = this._end.y;
34
- const x3 = otherLine._start.x;
35
- const y3 = otherLine._start.y;
36
- const x4 = otherLine._end.x;
37
- const y4 = otherLine._end.y;
18
+ const x1 = a.start.x;
19
+ const y1 = a.start.y;
20
+ const x2 = a.end.x;
21
+ const y2 = a.end.y;
22
+ const x3 = b.start.x;
23
+ const y3 = b.start.y;
24
+ const x4 = b.end.x;
25
+ const y4 = b.end.y;
38
26
  const denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
39
27
  if (denominator === 0) {
40
28
  return undefined;
41
29
  }
42
30
  const tNumerator = (x1 - x3) * (y3 - y4) - (y1 - y3) * (x3 - x4);
43
31
  const t = tNumerator / denominator;
44
- if (t < 0 || t > 1)
32
+ const tTolearnce = tolerance / a.length;
33
+ if (t < -tTolearnce || t > 1 + tTolearnce) {
45
34
  return undefined;
35
+ }
46
36
  const uNumerator = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);
47
37
  const u = uNumerator / denominator;
48
- if (u < 0 || u > 1)
38
+ const uTolearnce = tolerance / b.length;
39
+ if (u < -uTolearnce || u > 1 + uTolearnce)
49
40
  return undefined;
50
41
  const px = x1 + t * (x2 - x1);
51
42
  const py = y1 + t * (y2 - y1);
52
43
  return new Vector2_1.Vector2(px, py);
53
44
  }
45
+ get length() {
46
+ return Vector2_1.Vector2.Subtract(this.start, this.end).magnitued;
47
+ }
48
+ get direction() {
49
+ return Vector2_1.Vector2.Subtract(this.end, this.start).unit;
50
+ }
54
51
  }
55
52
  exports.LineSegment2D = LineSegment2D;
@@ -16,7 +16,7 @@ export declare class ParametricLine {
16
16
  static Down(): ParametricLine;
17
17
  static Left(): ParametricLine;
18
18
  static Right(): ParametricLine;
19
- static getPointAtDistance(line: ParametricLine, distance: number): Vector3;
19
+ static GetPointAtDistance(line: ParametricLine, distance: number): Vector3;
20
20
  readonly x0: number;
21
21
  readonly y0: number;
22
22
  readonly z0: number;
@@ -13,7 +13,7 @@ class ParametricLine {
13
13
  }
14
14
  // See https://planetcalc.com/8253/
15
15
  static FromTwoPoint(p1, p2) {
16
- const dir = Vector3_1.Vector3.subtract(p2, p1).unit;
16
+ const dir = Vector3_1.Vector3.Subtract(p2, p1).unit;
17
17
  return this.FromPointDirection(p1, dir);
18
18
  }
19
19
  static FromPointDirection(point, direction) {
@@ -27,36 +27,36 @@ class ParametricLine {
27
27
  });
28
28
  }
29
29
  static Forward() {
30
- const p = Vector3_1.Vector3.zero();
30
+ const p = Vector3_1.Vector3.Zero();
31
31
  const d = new Vector3_1.Vector3(0, 0, 1);
32
32
  return this.FromPointDirection(p, d);
33
33
  }
34
34
  static Backward() {
35
- const p = Vector3_1.Vector3.zero();
35
+ const p = Vector3_1.Vector3.Zero();
36
36
  const d = new Vector3_1.Vector3(0, 0, -1);
37
37
  return this.FromPointDirection(p, d);
38
38
  }
39
39
  static Up() {
40
- const p = Vector3_1.Vector3.zero();
40
+ const p = Vector3_1.Vector3.Zero();
41
41
  const d = new Vector3_1.Vector3(0, 1, 0);
42
42
  return this.FromPointDirection(p, d);
43
43
  }
44
44
  static Down() {
45
- const p = Vector3_1.Vector3.zero();
45
+ const p = Vector3_1.Vector3.Zero();
46
46
  const d = new Vector3_1.Vector3(0, -1, 0);
47
47
  return this.FromPointDirection(p, d);
48
48
  }
49
49
  static Left() {
50
- const p = Vector3_1.Vector3.zero();
50
+ const p = Vector3_1.Vector3.Zero();
51
51
  const d = new Vector3_1.Vector3(-1, 0, 0);
52
52
  return this.FromPointDirection(p, d);
53
53
  }
54
54
  static Right() {
55
- const p = Vector3_1.Vector3.zero();
55
+ const p = Vector3_1.Vector3.Zero();
56
56
  const d = new Vector3_1.Vector3(1, 0, 0);
57
57
  return this.FromPointDirection(p, d);
58
58
  }
59
- static getPointAtDistance(line, distance) {
59
+ static GetPointAtDistance(line, distance) {
60
60
  const x = line.x0 + line.a * distance;
61
61
  const y = line.y0 + line.b * distance;
62
62
  const z = line.z0 + line.c * distance;
@@ -14,7 +14,7 @@ export declare class ParametricPlane {
14
14
  static XY(): ParametricPlane;
15
15
  static ZX(): ParametricPlane;
16
16
  static YZ(): ParametricPlane;
17
- getParameters(): PlaneParameters;
17
+ GetParameters(): PlaneParameters;
18
18
  intersectLine(line: ParametricLine): Vector3 | undefined;
19
19
  constructor(point: Vector3, normal: Vector3);
20
20
  }
@@ -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.subtract(B, A);
17
- const AC = Vector3_1.Vector3.subtract(C, A);
18
- const normal = Vector3_1.Vector3.cross(AB, AC);
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.zero();
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.zero();
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.zero();
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
- getParameters() {
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.dot(this.point, this.normal);
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.getParameters();
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.getPointAtDistance(line, t);
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 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;
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 one() {
13
+ static One() {
14
14
  return new Vector2(1, 1);
15
15
  }
16
- static equal(a, b) {
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 add(a, b) {
23
+ static Add(a, b) {
24
24
  return new Vector2(a.x + b.x, a.y + b.y);
25
25
  }
26
- static subtract(a, b) {
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.close = (a, b, threshold = 0.01) => {
53
- const diff = Vector2.subtract(a, b);
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.rotate = (vec, angle) => {
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.scale = (vector, scale) => {
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.newVectorOfLength = (vector, length) => {
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.dot = (a, b) => {
76
+ Vector2.Dot = (a, b) => {
77
77
  return a.x * b.x + a.y * b.y;
78
78
  };
79
- Vector2.angleBetween = (a, b) => {
80
- const dot = Vector2.dot(a, b);
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.fromRadians(angRadians);
83
+ return _1.Angle.FromRadians(angRadians);
84
84
  };
85
- Vector2.cross = (a, b) => {
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 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;
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 zero() {
10
+ static Zero() {
11
11
  return new Vector3(0, 0, 0);
12
12
  }
13
- static one() {
13
+ static One() {
14
14
  return new Vector3(1, 1, 1);
15
15
  }
16
- static right(length = 1) {
16
+ static Right(length = 1) {
17
17
  return new Vector3(length, 0, 0);
18
18
  }
19
- static left(length = 1) {
19
+ static Left(length = 1) {
20
20
  return new Vector3(-length, 0, 0);
21
21
  }
22
- static up(length = 1) {
22
+ static Up(length = 1) {
23
23
  return new Vector3(0, length, 0);
24
24
  }
25
- static down(length = 1) {
25
+ static Down(length = 1) {
26
26
  return new Vector3(0, -length, 0);
27
27
  }
28
- static forward(length = 1) {
28
+ static Forward(length = 1) {
29
29
  return new Vector3(0, 0, length);
30
30
  }
31
- static backward(length = 1) {
31
+ static Backward(length = 1) {
32
32
  return new Vector3(0, 0, -length);
33
33
  }
34
- static fromArray(values) {
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.zero();
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.add = (a, b) => {
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.subtract = (a, b) => {
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.equal = (a, b) => {
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.close = (a, b, tolerance = 0.01) => {
72
- const diff = Vector3.subtract(a, b);
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.cross = (a, b) => {
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.dot = (a, b) => {
85
+ Vector3.Dot = (a, b) => {
86
86
  return a.x * b.x + a.y * b.y + a.z * b.z;
87
87
  };
88
- Vector3.newVectorOfLength = (vec, length) => {
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vived/app",
3
- "version": "2.12.0",
3
+ "version": "2.15.2",
4
4
  "description": "Public package for the VIVED Learning App system",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",