MCPcopy Create free account
hub / github.com/ThatOpen/engine_clay / constructor

Method constructor

packages/clay/src/utils/transform-controls.ts:15–33  ·  view source on GitHub ↗
(camera: THREE.Camera, element: HTMLCanvasElement)

Source from the content-addressed store, hash-verified

13 }
14
15 constructor(camera: THREE.Camera, element: HTMLCanvasElement) {
16 this.core = new TransformControls(camera, element);
17
18 this.helper = new THREE.Object3D();
19 let transform = new THREE.Matrix4();
20 this.core.attach(this.helper);
21
22 this.core.addEventListener("dragging-changed", () => {
23 this.controlsActivated.trigger();
24 });
25
26 this.core.addEventListener("change", () => {
27 this.helper.updateMatrix();
28 const temp = this.helper.matrix.clone();
29 temp.multiply(transform.invert());
30 this.transformed.trigger(temp);
31 transform = this.helper.matrix.clone();
32 });
33 }
34}

Callers

nothing calls this directly

Calls 1

multiplyMethod · 0.80

Tested by

no test coverage detected