@woosh/meep-engine 2.48.4 → 2.48.6
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/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { array_copy } from "../../../collection/array/copyArray.js";
|
|
2
|
+
import { MATRIX_4_IDENTITY } from "./MATRIX_4_IDENTITY.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Create a 4x4 matrix that corresponds to translation transform
|
|
6
|
+
* @param {ArrayLike<number>} output
|
|
7
|
+
* @param {ArrayLike<number>} translation 3d vector
|
|
8
|
+
*/
|
|
9
|
+
export function m4_make_translation(output, translation) {
|
|
10
|
+
array_copy(MATRIX_4_IDENTITY, 0, output, 0, 16);
|
|
11
|
+
|
|
12
|
+
output[12] = translation[0];
|
|
13
|
+
output[13] = translation[1];
|
|
14
|
+
output[14] = translation[2];
|
|
15
|
+
}
|
|
@@ -319,6 +319,30 @@ export class NodeDescription {
|
|
|
319
319
|
return result;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
+
/**
|
|
323
|
+
*
|
|
324
|
+
* @param {string} name
|
|
325
|
+
* @param {PortDirection} direction
|
|
326
|
+
* @return {Port|undefined}
|
|
327
|
+
*/
|
|
328
|
+
findPortByNameAndDirection(name, direction) {
|
|
329
|
+
assert.isString(name, 'name');
|
|
330
|
+
assert.enum(direction, PortDirection, 'direction');
|
|
331
|
+
|
|
332
|
+
const ports = this.ports;
|
|
333
|
+
const port_count = ports.length;
|
|
334
|
+
|
|
335
|
+
for (let i = 0; i < port_count; i++) {
|
|
336
|
+
const port = ports[i];
|
|
337
|
+
|
|
338
|
+
if (port.name === name && port.direction === direction) {
|
|
339
|
+
return port;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return undefined;
|
|
344
|
+
}
|
|
345
|
+
|
|
322
346
|
/**
|
|
323
347
|
*
|
|
324
348
|
* @returns {Port[]}
|