@thi.ng/scenegraph
Version:
Extensible 2D/3D scene graph with @thi.ng/hiccup-canvas support
27 lines • 1.11 kB
TypeScript
import type { Maybe, Nullable } from "@thi.ng/api";
import type { Mat } from "@thi.ng/matrices";
import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
import type { CommonNodeOpts, ISceneNode, NodeInfo } from "./api.js";
export declare abstract class ANode<T extends ISceneNode<any>> {
id: string;
parent: Nullable<T>;
children: T[];
body: any;
mat: Mat;
invMat: Mat;
enabled: boolean;
display: boolean;
constructor({ id, parent, body, enabled, display, }: CommonNodeOpts<T>);
appendChild(node: T): this;
insertChild(i: number, node: T): this;
deleteChild(node: number | T): boolean;
draw<T>(ctx: T): void;
childForPoint(p: ReadonlyVec): Maybe<NodeInfo<T>>;
containsLocalPoint(_: ReadonlyVec): boolean;
abstract update(): void;
abstract mapGlobalPoint(p: ReadonlyVec): Maybe<Vec>;
abstract mapLocalPointToGlobal(p: ReadonlyVec): Maybe<Vec>;
abstract mapLocalPointToNode(dest: T, p: ReadonlyVec): Maybe<Vec>;
abstract scaleWithReferencePoint(ref: ReadonlyVec, scale: ReadonlyVec | number): this;
}
//# sourceMappingURL=anode.d.ts.map