This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| proposal or How I could use it: | |
| // hijack valeOf & toString of Array.prototype | |
| // create vector by numbers | |
| const pos = [5, 6, 7]; | |
| const dir = [1, 0, 0]; | |
| console.log(debug`pos:${pos}, dir: ${dir}`); | |
| // pos: { x: 5, y: 6, z: 7 } dir: { x: 1, y: 0, z: 0 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * https://github.com/jMonkeyEngine/jmonkeyengine/blob/d57c362ec3b510c1ba6356f719efa3b1576b95c6/jme3-core/src/main/java/com/jme3/math/Transform.java#L237 | |
| */ | |
| transformVector(in, store){ | |
| // multiply with scale first, then rotate, finally translate (cf. | |
| // Eberly) | |
| return rot.mult(store.set(in).multLocal(scale), store).addLocal(translation); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2D | 3D | Mutable | Immutable | ||
|---|---|---|---|---|---|
| Vector | ✅ | ✅ |