Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add functions to set graph translation and scale by reference #193

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/graph/Graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,34 @@ 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;
}
public set translation(value: vec3) {
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];
}
public set scale(value: number) {
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<PointDataMappings>);
constructor(context: App, data: unknown[], mappings: Partial<PointDataMappings> = {}) {
Expand Down
Loading