From 819e43ab7939e69583b8db5acc78ffef6d88eb09 Mon Sep 17 00:00:00 2001 From: Chris Carmichael Date: Fri, 10 May 2024 16:04:39 -0300 Subject: [PATCH] add functions to set graph translation and scale by reference --- src/graph/Graph.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/graph/Graph.ts b/src/graph/Graph.ts index d6261e9..4cf00e9 100755 --- a/src/graph/Graph.ts +++ b/src/graph/Graph.ts @@ -46,7 +46,7 @@ export class Graph extends EventEmitter.mixin(GraphPoints) implements Renderable return this._rotation; } - private readonly _translation: vec3; + private _translation: vec3; public get translation(): vec3 { return this._translation; } @@ -54,7 +54,11 @@ export class Graph extends EventEmitter.mixin(GraphPoints) implements Renderable vec3.set(this._translation, value[0], value[1], value[2]); } - private readonly _scale: vec3; + public setTranslationByRef(other: vec3): void { + this._translation = other; + } + + private _scale: vec3; public get scale(): number { return this._scale[0]; } @@ -62,6 +66,14 @@ export class Graph extends EventEmitter.mixin(GraphPoints) implements Renderable vec3.set(this._scale, value, value, value); } + public get scaleVec3() : vec3 { + return this._scale; + } + + public setScaleByRef(other: vec3): void { + this._scale = other; + } + constructor(context: App, data: PointData[]); constructor(context: App, data: unknown[], mappings: Partial); constructor(context: App, data: unknown[], mappings: Partial = {}) {