@thi.ng/scenegraph 0.5.52 → 0.6.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-04-08T11:09:50Z
3
+ - **Last updated**: 2023-04-19T09:28:07Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ## [0.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/scenegraph@0.6.0) (2023-04-19)
13
+
14
+ #### 🚀 Features
15
+
16
+ - add ANode.mapLocalPointToGlobal(), update 2D/3D impls ([b1d30ef](https://github.com/thi-ng/umbrella/commit/b1d30ef))
17
+
12
18
  ## [0.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/scenegraph@0.5.0) (2021-11-17)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -57,7 +57,7 @@ For Node.js REPL:
57
57
  const scenegraph = await import("@thi.ng/scenegraph");
58
58
  ```
59
59
 
60
- Package sizes (brotli'd, pre-treeshake): ESM: 851 bytes
60
+ Package sizes (brotli'd, pre-treeshake): ESM: 858 bytes
61
61
 
62
62
  ## Dependencies
63
63
 
package/anode.d.ts CHANGED
@@ -35,6 +35,13 @@ export declare abstract class ANode<T extends ISceneNode<any>> {
35
35
  * @param p -
36
36
  */
37
37
  abstract mapGlobalPoint(p: ReadonlyVec): Vec | undefined;
38
+ /**
39
+ * Returns copy of node local space point `p`, transformed into the global
40
+ * worldspace.
41
+ *
42
+ * @param p
43
+ */
44
+ abstract mapLocalPointToGlobal(p: ReadonlyVec): Vec | undefined;
38
45
  /**
39
46
  * Returns copy of node local space point `p`, transformed into the
40
47
  * coordinate system of `dest` node.
package/node2.d.ts CHANGED
@@ -11,6 +11,7 @@ export declare class Node2D extends ANode<Node2D> implements ICopy<Node2D>, ISce
11
11
  deleteChild(node: number | Node2D): boolean;
12
12
  update(): void;
13
13
  mapGlobalPoint(p: ReadonlyVec): Vec;
14
+ mapLocalPointToGlobal(p: ReadonlyVec): Vec;
14
15
  mapLocalPointToNode(dest: Node2D, p: ReadonlyVec): Vec;
15
16
  /**
16
17
  * By implementing this method (`IToHiccup` interface), scene graph nodes
package/node2.js CHANGED
@@ -35,6 +35,9 @@ export class Node2D extends ANode {
35
35
  mapGlobalPoint(p) {
36
36
  return mulV23([], this.invMat, p);
37
37
  }
38
+ mapLocalPointToGlobal(p) {
39
+ return mulV23([], this.mat, p);
40
+ }
38
41
  mapLocalPointToNode(dest, p) {
39
42
  return mulV23(null, dest.invMat, mulV23([], this.mat, p));
40
43
  }
package/node3.d.ts CHANGED
@@ -11,6 +11,7 @@ export declare class Node3D extends ANode<Node3D> implements ICopy<Node3D>, ISce
11
11
  deleteChild(node: number | Node3D): boolean;
12
12
  update(): void;
13
13
  mapGlobalPoint(p: ReadonlyVec): Vec | undefined;
14
+ mapLocalPointToGlobal(p: ReadonlyVec): Vec | undefined;
14
15
  mapLocalPointToNode(dest: Node3D, p: ReadonlyVec): Vec | undefined;
15
16
  /**
16
17
  * Future support planned. No immediate users of this method in a 3D context
package/node3.js CHANGED
@@ -35,6 +35,9 @@ export class Node3D extends ANode {
35
35
  mapGlobalPoint(p) {
36
36
  return mulV344([], this.invMat, p);
37
37
  }
38
+ mapLocalPointToGlobal(p) {
39
+ return mulV344([], this.mat, p);
40
+ }
38
41
  mapLocalPointToNode(dest, p) {
39
42
  return mulV344(null, dest.invMat, mulV344([], this.mat, p));
40
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/scenegraph",
3
- "version": "0.5.52",
3
+ "version": "0.6.1",
4
4
  "description": "Extensible 2D/3D scene graph with @thi.ng/hiccup-canvas support",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,11 +34,11 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.7.6",
37
+ "@thi.ng/api": "^8.8.0",
38
38
  "@thi.ng/checks": "^3.3.12",
39
39
  "@thi.ng/errors": "^2.2.15",
40
- "@thi.ng/matrices": "^2.1.52",
41
- "@thi.ng/vectors": "^7.6.11"
40
+ "@thi.ng/matrices": "^2.1.54",
41
+ "@thi.ng/vectors": "^7.6.13"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@microsoft/api-extractor": "^7.34.4",
@@ -98,5 +98,5 @@
98
98
  ],
99
99
  "status": "alpha"
100
100
  },
101
- "gitHead": "abcedd9e4e06a4b631f363610eec572f79b571c1\n"
101
+ "gitHead": "ca22f02a137c0a4e3a38ef81e82e2bc7e3c43849\n"
102
102
  }