archgine 1.0.36 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/applications/app-cvs.d.ts +16 -0
- package/lib/applications/app-offscreen.d.ts +27 -8
- package/lib/applications/application.d.ts +27 -10
- package/lib/controls/interactive-controls.d.ts +2 -2
- package/lib/controls/orbit-controller.d.ts +4 -3
- package/lib/controls/orbit-controls.d.ts +8 -8
- package/lib/core/camera2.d.ts +4 -16
- package/lib/core/monitor.d.ts +13 -13
- package/lib/core/object2.d.ts +5 -5
- package/lib/core/ope-view.d.ts +24 -0
- package/lib/core/view.d.ts +16 -9
- package/lib/environment.worker.js +4 -2
- package/lib/extras/adapter.d.ts +62 -0
- package/lib/extras/chef.d.ts +3 -9
- package/lib/extras/interfaces.d.ts +2 -0
- package/lib/extras/svg-app.d.ts +2 -17
- package/lib/extras/svg-chef.d.ts +4 -5
- package/lib/geometries/circle-geo2.d.ts +14 -0
- package/lib/geometries/geo2.d.ts +22 -8
- package/lib/geometries/polygon-geo2.d.ts +5 -0
- package/lib/geometries/polyline-geo2.d.ts +21 -0
- package/lib/helpers/axes-helper.d.ts +2 -3
- package/lib/helpers/axes-helper2.d.ts +19 -0
- package/lib/helpers/canvas-helper.d.ts +5 -5
- package/lib/helpers/geo-helper.d.ts +12 -0
- package/lib/helpers/mat-helper.d.ts +10 -0
- package/lib/helpers/merge-helper.d.ts +7 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.mjs +7861 -6764
- package/lib/index.umd.js +31 -30
- package/lib/interfaces.d.ts +64 -120
- package/lib/materials/mat2.d.ts +2 -1
- package/lib/materials/text-mat2.d.ts +53 -0
- package/lib/math/box2.d.ts +1 -0
- package/lib/objects/shape2.d.ts +20 -7
- package/lib/renderer.worker.js +14066 -0
- package/lib/renderers/binding-states.d.ts +4 -4
- package/lib/renderers/buffer-renderer.d.ts +9 -3
- package/lib/renderers/cvs-renderer.d.ts +4 -2
- package/lib/renderers/render-lists.d.ts +4 -6
- package/lib/renderers/render-target.d.ts +2 -2
- package/lib/renderers/renderer.d.ts +1 -1
- package/lib/renders/render-target.d.ts +2 -2
- package/lib/scenes/loading-scene.d.ts +4 -5
- package/lib/{extras → scenes}/main-scene.d.ts +3 -3
- package/lib/scenes/scene.d.ts +0 -1
- package/lib/scenes/svg-scene.d.ts +3 -4
- package/lib/shapes2/arrow.d.ts +6 -0
- package/lib/shapes2/axes.d.ts +35 -0
- package/lib/shapes2/circle.d.ts +10 -0
- package/lib/shapes2/polygon.d.ts +9 -0
- package/lib/shapes2/text.d.ts +21 -0
- package/lib/textures/texture.d.ts +2 -2
- package/lib/utils/svg.d.ts +14 -0
- package/lib/workers/renderer.worker.d.ts +1 -0
- package/package.json +1 -1
- package/lib/geometries/path2.d.ts +0 -20
package/lib/geometries/geo2.d.ts
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import { IBox2, IPoint3 } from '../interfaces';
|
|
2
|
-
import { default as Matrix3 } from '../math/matrix3';
|
|
3
1
|
import { SVGPathData } from 'svg-pathdata';
|
|
2
|
+
import { default as Matrix3 } from '../math/matrix3';
|
|
3
|
+
import { IBox2, IContext2D, IGeo2, IMatrix3, IPath2Command, IPoint2 } from '../interfaces';
|
|
4
4
|
export interface IGeo2Config {
|
|
5
|
-
points?:
|
|
5
|
+
points?: IPoint2[];
|
|
6
|
+
commands?: string | IPath2Command[];
|
|
7
|
+
flipY?: boolean;
|
|
6
8
|
}
|
|
7
|
-
export declare class Geo2<Config extends IGeo2Config> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
matrix: Matrix3;
|
|
9
|
+
export declare class Geo2<Config extends IGeo2Config> extends SVGPathData implements IGeo2 {
|
|
10
|
+
name: string;
|
|
11
|
+
params: Config;
|
|
12
|
+
viewMatrix: Matrix3;
|
|
12
13
|
boundingBox: IBox2;
|
|
13
14
|
constructor(config?: Config);
|
|
15
|
+
_version: number;
|
|
16
|
+
get version(): number;
|
|
17
|
+
set version(v: number);
|
|
18
|
+
set needsUpdate(v: boolean);
|
|
19
|
+
static render(ctx: IContext2D, commands: IPath2Command[]): void;
|
|
20
|
+
setFromPoints(ps?: IPoint2[]): IGeo2;
|
|
21
|
+
recomputePath(): void;
|
|
22
|
+
computeBoundingBox(): IBox2;
|
|
23
|
+
render(ctx: IContext2D): void;
|
|
24
|
+
applyMatrix(m: IMatrix3): IGeo2;
|
|
25
|
+
getRenderCommands(m?: IMatrix3): IPath2Command[];
|
|
26
|
+
copy(source: IGeo2): IGeo2;
|
|
27
|
+
clone(): IGeo2;
|
|
14
28
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Geo2, IGeo2Config } from './geo2';
|
|
2
|
+
export interface IPolylineGeo2Options extends IGeo2Config {
|
|
3
|
+
stArrow?: boolean;
|
|
4
|
+
edArrow?: boolean;
|
|
5
|
+
arrowLength?: number;
|
|
6
|
+
arrowDeg?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class PolylineGeo2<Config extends IPolylineGeo2Options> extends Geo2<Config> {
|
|
9
|
+
arrowLength: number;
|
|
10
|
+
arrowDeg: number;
|
|
11
|
+
stArrow: boolean;
|
|
12
|
+
edArrow: boolean;
|
|
13
|
+
constructor(config?: Config);
|
|
14
|
+
recomputePath(): this;
|
|
15
|
+
/**
|
|
16
|
+
* v3 \
|
|
17
|
+
* vo ---- v2-v1
|
|
18
|
+
* v4 /
|
|
19
|
+
*/
|
|
20
|
+
addArrow(len?: number): this;
|
|
21
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Axes, IAxesConfig } from '../shapes/axes';
|
|
2
2
|
import { default as Vector2 } from '../math/vector2';
|
|
3
|
-
import { default as Camera2 } from '../core/camera2';
|
|
4
3
|
import { default as Box2 } from '../math/box2';
|
|
5
4
|
import { ICamera2 } from '../interfaces';
|
|
6
5
|
export interface IAxesHelperConfig extends IAxesConfig {
|
|
@@ -10,8 +9,8 @@ export declare class AxesHelper<Config extends IAxesHelperConfig = IAxesHelperCo
|
|
|
10
9
|
usedCache: boolean;
|
|
11
10
|
castShadow: boolean;
|
|
12
11
|
padding: Vector2;
|
|
13
|
-
camera:
|
|
14
|
-
constructor(config?: Config, camera?:
|
|
12
|
+
camera: ICamera2 | undefined;
|
|
13
|
+
constructor(config?: Config, camera?: ICamera2);
|
|
15
14
|
computeBoundingBox(): Box2;
|
|
16
15
|
/** @override */
|
|
17
16
|
updateModelViewMatrix(camera?: ICamera2): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Axes, IAxesConfig } from '../shapes2/axes';
|
|
2
|
+
import { default as Vector2 } from '../math/vector2';
|
|
3
|
+
import { default as Box2 } from '../math/box2';
|
|
4
|
+
import { ICamera2 } from '../interfaces';
|
|
5
|
+
export interface IAxesHelper2Config extends IAxesConfig {
|
|
6
|
+
gridEnabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class AxesHelper2<Config extends IAxesHelper2Config> extends Axes<Config> {
|
|
9
|
+
name: string;
|
|
10
|
+
usedCache: boolean;
|
|
11
|
+
castShadow: boolean;
|
|
12
|
+
padding: Vector2;
|
|
13
|
+
camera: ICamera2 | undefined;
|
|
14
|
+
constructor(config?: Config, camera?: ICamera2);
|
|
15
|
+
computeBoundingBox(): Box2;
|
|
16
|
+
/** @override */
|
|
17
|
+
updateModelViewMatrix(camera?: ICamera2): void;
|
|
18
|
+
computeAxes(camera?: ICamera2): void;
|
|
19
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICanvas, IContext2D, IShape2 } from '../interfaces';
|
|
2
2
|
import { default as Vector2 } from '../math/vector2';
|
|
3
3
|
interface ICanvasConfig {
|
|
4
4
|
containerId?: string;
|
|
@@ -17,14 +17,14 @@ export default class CanvasHelper {
|
|
|
17
17
|
/**
|
|
18
18
|
* @todo: cvs.getContext('bitmaprenderer') => ImageBitmapRenderingContext.transferFromImageBitmap()
|
|
19
19
|
*/
|
|
20
|
-
static getContext2D(cvs:
|
|
21
|
-
static resizeCanvas(cvs:
|
|
22
|
-
static getImageBitmapByCanvasAsync(cvs?:
|
|
20
|
+
static getContext2D(cvs: ICanvas, params?: any): IContext2D;
|
|
21
|
+
static resizeCanvas(cvs: ICanvas, w: number, h: number, r?: number): void;
|
|
22
|
+
static getImageBitmapByCanvasAsync(cvs?: ICanvas): Promise<ImageBitmap | undefined>;
|
|
23
23
|
static get(k: string, w: number, h: number, dpr?: number): OffscreenCanvas;
|
|
24
24
|
static set(k: string, v: OffscreenCanvas): Map<string, OffscreenCanvas>;
|
|
25
25
|
static remove(k: string): void;
|
|
26
26
|
static create(w: number, h: number, dpr?: number): OffscreenCanvas;
|
|
27
27
|
static createHtmlCanvas(w: number, h: number, dpr?: number): HTMLCanvasElement;
|
|
28
|
-
static measureText(text: string, obj:
|
|
28
|
+
static measureText(text: string, obj: IShape2, out?: Vector2): Vector2;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Geo2 } from '../geometries/geo2';
|
|
2
|
+
import { SVGCommand } from 'svg-pathdata/src/types';
|
|
3
|
+
import { IShape2Config } from '../objects/shape2';
|
|
4
|
+
export declare class GeoHelper {
|
|
5
|
+
params: IShape2Config;
|
|
6
|
+
constructor(config?: IShape2Config);
|
|
7
|
+
destroy(): void;
|
|
8
|
+
static getInstanceByElement(o: Element, flipY?: boolean): Geo2<any> | undefined;
|
|
9
|
+
static getInstanceByPath(o: Element, flipY?: boolean): Geo2<any> | undefined;
|
|
10
|
+
static getInstanceByCircle(o: Element, flipY?: boolean): Geo2<any> | undefined;
|
|
11
|
+
static getInstance(cmd: string | SVGCommand[], flipY?: boolean): Geo2<any> | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IMat2 } from '../interfaces';
|
|
2
|
+
import { IShape2Config } from '../objects/shape2';
|
|
3
|
+
export declare class MatHelper {
|
|
4
|
+
params: IShape2Config;
|
|
5
|
+
constructor(config?: IShape2Config);
|
|
6
|
+
destroy(): void;
|
|
7
|
+
static getInstance(config: IShape2Config): IMat2;
|
|
8
|
+
static setCache(config: IShape2Config, mtl: IMat2): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function getMatFeatureKey(o: any): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IShape2 } from '../interfaces';
|
|
2
|
+
import { IShape2Config } from '../objects/shape2';
|
|
3
|
+
import { ITextConfig } from '../shapes2/text';
|
|
4
|
+
export declare class MergeHelper {
|
|
5
|
+
static getShapeByElement(el: Element, config: IShape2Config, flipY?: boolean): IShape2;
|
|
6
|
+
static getText(config: ITextConfig): IShape2;
|
|
7
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as EnvironmentWorker } from './workers/environment.worker?worker';
|
|
2
|
+
import { default as RendererWorker } from './workers/renderer.worker?worker';
|
|
2
3
|
import { default as defaultConfig } from './env/default-config.js';
|
|
3
4
|
export { GLOB } from './core/global.js';
|
|
4
5
|
export { Color, ColorsEnum } from './math/color.js';
|
|
@@ -9,4 +10,5 @@ export { AssetTypeEnum, LayerTypeEnum } from './env/enums';
|
|
|
9
10
|
export type { ITree } from './interfaces';
|
|
10
11
|
export type { IApp, IDummyVo, IDummy } from './extras/interfaces';
|
|
11
12
|
export { AppEnum, SvgApp } from './extras/svg-app';
|
|
12
|
-
export {
|
|
13
|
+
export { AppOffscreen } from './applications/app-offscreen';
|
|
14
|
+
export { defaultConfig, EnvironmentWorker, RendererWorker, };
|