@woosh/meep-engine 2.39.9 → 2.39.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.
@@ -23,6 +23,9 @@ export const ProjectionType = {
23
23
  Orthographic: "orthographic"
24
24
  };
25
25
 
26
+ /**
27
+ * @class
28
+ */
26
29
  export class Camera {
27
30
  constructor() {
28
31
  /**
@@ -176,7 +179,7 @@ export class Camera {
176
179
  // assert.ok(y >= -1, `Y(=${y}) must be greater than or equal to -1.0, not a clip-space coordinate`);
177
180
  // assert.ok(y <= 1, `Y(=${y}) must be less than or equal to 1.0, not a clip-space coordinate`);
178
181
 
179
- if (camera.isPerspectiveCamera) {
182
+ if (camera.isPerspectiveCamera || camera.isOrthographicCamera) {
180
183
  scratch_v3_1.setFromMatrixPosition(camera.matrixWorld.elements);
181
184
 
182
185
  scratch_v3_0.set(x, y, 0.5);
@@ -197,9 +200,7 @@ export class Camera {
197
200
  source.copy(scratch_v3_1);
198
201
  direction.copy(scratch_v3_0);
199
202
 
200
- } else if (camera.isOrthographicCamera) {
201
- throw new Error('Unsupported camera type: "Orthographic" ');
202
- } else {
203
+ } else {
203
204
  throw new Error('Unsupported camera type');
204
205
  }
205
206
  }
@@ -70,6 +70,7 @@ import { BasicMaterialDefinition } from "./tube/BasicMaterialDefinition.js";
70
70
  import '../../../../../../../css/game.scss';
71
71
  import { GizmoRenderingPlugin } from "../../render/gizmo/GizmoRenderingPlugin.js";
72
72
  import { PathNormalType } from "./tube/PathNormalType.js";
73
+ import { Camera, ProjectionType } from "../camera/Camera.js";
73
74
 
74
75
  const engineHarness = new EngineHarness();
75
76
 
@@ -427,6 +428,11 @@ function makePath({
427
428
  function main(engine) {
428
429
  EngineHarness.buildBasics({ engine });
429
430
 
431
+ const ecd = engine.entityManager.dataset;
432
+
433
+ const cam = ecd.getAnyComponent(Camera);
434
+ cam.component.projectionType.set(ProjectionType.Orthographic);
435
+
430
436
  makePath({
431
437
  points: [
432
438
  3, 1, 1,
@@ -437,7 +443,7 @@ function main(engine) {
437
443
  3, 1, 8
438
444
  ],
439
445
  interp: InterpolationType.Linear
440
- }).build(engine.entityManager.dataset);
446
+ }).build(ecd);
441
447
 
442
448
  makePath({
443
449
  points: [
@@ -447,7 +453,7 @@ function main(engine) {
447
453
  16.719999313354492, 3.130000114440918, -6.889999866485596
448
454
  ],
449
455
  interp: InterpolationType.Linear
450
- }).build(engine.entityManager.dataset);
456
+ }).build(ecd);
451
457
  }
452
458
 
453
459
  init(engineHarness);
@@ -116,6 +116,23 @@ export class TubePathStyle {
116
116
  return r;
117
117
  }
118
118
 
119
+ /**
120
+ *
121
+ * @param {string|{r:number,g:number,b:number}} color
122
+ * @param material_type
123
+ * @param material
124
+ * @param opacity
125
+ * @param width
126
+ * @param radial_resolution
127
+ * @param resolution
128
+ * @param cast_shadow
129
+ * @param receive_shadow
130
+ * @param path_mask
131
+ * @param cap_type
132
+ * @param shape
133
+ * @param path_normal
134
+ * @param path_normal_type
135
+ */
119
136
  fromJSON({
120
137
  color = DEFAULT_COLOR,
121
138
  material_type,
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.39.9",
8
+ "version": "2.39.10",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",