@tolokoban/tgd
Version:
ToloGameDev library for WebGL2
41 lines • 1.29 kB
TypeScript
import { TgdContext, TgdContextOptions } from "../../context";
import { TgdEvent } from "../../event";
import { TgdQuat } from "../../math";
export interface TgdCanvasGizmoOptions extends TgdContextOptions {
canvas?: HTMLCanvasElement;
}
/**
* The Gizmo displays the orientation of an attached camera.
* You can click one of the axis to force the camera to face it.
*/
export declare class TgdCanvasGizmo {
private readonly options;
/**
* The user clicked a tip, so we dispatch the target orientation.
*/
eventTipClick: TgdEvent<{
from: Readonly<TgdQuat>;
to: Readonly<TgdQuat>;
}>;
private _canvas;
private context;
private contextExternal;
private readonly cameraInternal;
private orbiter;
private tipsPainter;
constructor(options?: TgdCanvasGizmoOptions);
/**
* Attach the camera we want to track and control.
*/
attachContext(context: TgdContext): void;
detach(): void;
private attach;
private readonly handleExternalPaint;
private readonly handleInternalToExternal;
get canvas(): HTMLCanvasElement | null;
set canvas(canvas: HTMLCanvasElement | null);
private readonly handleTap;
private findAxisX;
private findAxisY;
}
//# sourceMappingURL=gizmo.d.ts.map