archgine 1.0.56 → 1.0.58
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/animations/animation-action.d.ts +52 -0
- package/lib/animations/animation-clip.d.ts +20 -0
- package/lib/animations/animation-mixer.d.ts +52 -0
- package/lib/animations/animation-utils.d.ts +7 -0
- package/lib/animations/keyframe-track.d.ts +33 -0
- package/lib/animations/property-binding.d.ts +68 -0
- package/lib/animations/property-mixer.d.ts +29 -0
- package/lib/animations/tracks/boolean-keyframe-track.d.ts +5 -0
- package/lib/animations/tracks/color-keyframe-track.d.ts +4 -0
- package/lib/animations/tracks/number-keyframe-track.d.ts +4 -0
- package/lib/animations/tracks/string-keyframe-track.d.ts +5 -0
- package/lib/animations/tracks/vector1-keyframe-track.d.ts +4 -0
- package/lib/animations/tracks/vector2-keyframe-track.d.ts +4 -0
- package/lib/applications/app-cvs.d.ts +25 -1
- package/lib/applications/app-director.d.ts +22 -0
- package/lib/applications/app-offscreen.d.ts +22 -2
- package/lib/applications/application.d.ts +12 -0
- package/lib/core/camera2.d.ts +2 -2
- package/lib/core/object2.d.ts +4 -3
- package/lib/core/ope-view.d.ts +23 -2
- package/lib/core/tic.d.ts +1 -0
- package/lib/core/view.d.ts +2 -1
- package/lib/effects/debounce-pass.d.ts +10 -0
- package/lib/effects/effect-director.d.ts +16 -0
- package/lib/effects/paper-pass.d.ts +13 -0
- package/lib/effects/pass.d.ts +1 -0
- package/lib/effects/render-cached-pass.d.ts +0 -2
- package/lib/effects/render-pass.d.ts +1 -1
- package/lib/environment.worker.js +3 -195
- package/lib/extras/adapter.d.ts +3 -0
- package/lib/extras/svg-app.d.ts +1 -2
- package/lib/geometries/circle-geo2.d.ts +1 -0
- package/lib/geometries/geo2.d.ts +6 -3
- package/lib/helpers/axes-helper2.d.ts +3 -1
- package/lib/helpers/mat-helper.d.ts +6 -5
- package/lib/helpers/merge-helper.d.ts +6 -2
- package/lib/helpers/sax-helper.d.ts +35 -0
- package/lib/helpers/svg-helper.d.ts +6 -0
- package/lib/index.mjs +4405 -4326
- package/lib/index.umd.js +28 -28
- package/lib/interfaces.d.ts +63 -11
- package/lib/loaders/loader.d.ts +1 -0
- package/lib/math/box2.d.ts +1 -0
- package/lib/math/cubic-interpolant.d.ts +11 -0
- package/lib/math/discrete-interpolant.d.ts +7 -0
- package/lib/math/improved-noise.d.ts +3 -0
- package/lib/math/interpolant.d.ts +17 -0
- package/lib/math/linear-interpolant.d.ts +7 -0
- package/lib/math/vector2.d.ts +2 -1
- package/lib/objects/group2.d.ts +5 -4
- package/lib/objects/mesh2.d.ts +2 -2
- package/lib/objects/shape.d.ts +1 -1
- package/lib/objects/shape2.d.ts +7 -3
- package/lib/renderer.worker.js +10658 -6587
- package/lib/renderers/buffer-renderer.d.ts +1 -2
- package/lib/renderers/cvs-renderer.d.ts +7 -9
- package/lib/renderers/renderer.d.ts +1 -2
- package/lib/renders/renderer2.d.ts +1 -1
- package/lib/renders/svg-renderer.d.ts +1 -1
- package/lib/scenes/animate-scene.d.ts +17 -0
- package/lib/scenes/loading-scene.d.ts +9 -2
- package/lib/scenes/loading-text-scene.d.ts +19 -0
- package/lib/scenes/main-scene.d.ts +19 -1
- package/lib/scenes/scene.d.ts +1 -3
- package/lib/shapes2/actor.d.ts +24 -0
- package/package.json +3 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IAnimationAction, IAnimationClip, IAnimationMixer, IInterpolant, IObject2, IPropertyMixer } from '../interfaces';
|
|
2
|
+
export declare const ZeroCurvatureEnding = 2400;
|
|
3
|
+
export declare const LoopRepeat = 2201;
|
|
4
|
+
export declare const LoopPingPong = 2202;
|
|
5
|
+
export declare const LoopOnce = 2200;
|
|
6
|
+
export declare const ZeroSlopeEnding = 2401;
|
|
7
|
+
export declare const WrapAroundEnding = 2402;
|
|
8
|
+
export declare class AnimationAction implements IAnimationAction {
|
|
9
|
+
blendMode: number;
|
|
10
|
+
loop: number;
|
|
11
|
+
time: number;
|
|
12
|
+
timeScale: number;
|
|
13
|
+
weight: number;
|
|
14
|
+
repetitions: number;
|
|
15
|
+
paused: boolean;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
clampWhenFinished: boolean;
|
|
18
|
+
zeroSlopeAtStart: boolean;
|
|
19
|
+
zeroSlopeAtEnd: boolean;
|
|
20
|
+
_mixer: IAnimationMixer;
|
|
21
|
+
_clip: IAnimationClip;
|
|
22
|
+
_localRoot: IObject2 | undefined;
|
|
23
|
+
_interpolantSettings: any;
|
|
24
|
+
_interpolants: IInterpolant[];
|
|
25
|
+
_propertyBindings: IPropertyMixer[];
|
|
26
|
+
_cacheIndex: number | undefined;
|
|
27
|
+
_byClipCacheIndex: number | undefined;
|
|
28
|
+
_timeScaleInterpolant: IInterpolant | undefined;
|
|
29
|
+
_weightInterpolant: IInterpolant | undefined;
|
|
30
|
+
_loopCount: number;
|
|
31
|
+
_startTime: number | undefined;
|
|
32
|
+
_effectiveTimeScale: number;
|
|
33
|
+
_effectiveWeight: number;
|
|
34
|
+
constructor(mixer: IAnimationMixer, clip: IAnimationClip, localRoot?: IObject2, blendMode?: number);
|
|
35
|
+
play(): this;
|
|
36
|
+
stop(): this;
|
|
37
|
+
reset(): this;
|
|
38
|
+
isRunning(): boolean;
|
|
39
|
+
isScheduled(): boolean;
|
|
40
|
+
startAt(time: number): this;
|
|
41
|
+
setLoop(mode: number, repetitions: number): this;
|
|
42
|
+
stopFading(): this;
|
|
43
|
+
stopWarping(): this;
|
|
44
|
+
getMixer(): IAnimationMixer;
|
|
45
|
+
getClip(): IAnimationClip;
|
|
46
|
+
getRoot(): IObject2 | undefined;
|
|
47
|
+
_update(time: number, deltaTime: number, timeDirection: number, accuIndex: number): void;
|
|
48
|
+
_updateWeight(time: number): number;
|
|
49
|
+
_updateTimeScale(time: number): number;
|
|
50
|
+
_updateTime(deltaTime: number): number;
|
|
51
|
+
_setEndings(atStart: boolean, atEnd: boolean, pingPong: boolean): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IAnimationClip, IClip, IKeyframeTrack, IObject2 } from '../interfaces';
|
|
2
|
+
export declare class AnimationClip implements IAnimationClip {
|
|
3
|
+
name: string;
|
|
4
|
+
duration: number;
|
|
5
|
+
tracks: IKeyframeTrack[];
|
|
6
|
+
blendMode: number;
|
|
7
|
+
uuid: string;
|
|
8
|
+
constructor(name: string, duration: number | undefined, tracks: IKeyframeTrack[], blendMode?: number);
|
|
9
|
+
static parse(json: any): AnimationClip;
|
|
10
|
+
static toJSON(clip: IAnimationClip): IClip;
|
|
11
|
+
static findByName(objectOrClipArray: IObject2 | Array<IAnimationClip>, name: string): IAnimationClip | undefined;
|
|
12
|
+
resetDuration(): this;
|
|
13
|
+
trim(): this;
|
|
14
|
+
validate(): boolean;
|
|
15
|
+
optimize(): this;
|
|
16
|
+
clone(): this;
|
|
17
|
+
toJSON(): IClip;
|
|
18
|
+
}
|
|
19
|
+
export declare const NormalAnimationBlendMode = 2500;
|
|
20
|
+
export declare const AdditiveAnimationBlendMode = 2501;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { default as EventDispatcher } from '../core/event-dispatcher';
|
|
2
|
+
import { IAnimationAction, IAnimationMixer, IAnimationMixerStats, IInterpolant, IObject2, IPropertyMixer, IActionsForClip, IAnimationClip } from '../interfaces';
|
|
3
|
+
export declare class AnimationMixer extends EventDispatcher implements IAnimationMixer {
|
|
4
|
+
stats: IAnimationMixerStats;
|
|
5
|
+
time: number;
|
|
6
|
+
timeScale: number;
|
|
7
|
+
_root?: IObject2;
|
|
8
|
+
_accuIndex: number;
|
|
9
|
+
_actions: IAnimationAction[];
|
|
10
|
+
_nActiveActions: number;
|
|
11
|
+
_actionsByClip: {
|
|
12
|
+
[p: string]: IActionsForClip;
|
|
13
|
+
};
|
|
14
|
+
_bindings: any[];
|
|
15
|
+
_nActiveBindings: number;
|
|
16
|
+
_bindingsByRootAndName: {
|
|
17
|
+
[p: string]: {
|
|
18
|
+
[k: string]: IPropertyMixer;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
_controlInterpolants: IInterpolant[];
|
|
22
|
+
_nActiveControlInterpolants: number;
|
|
23
|
+
constructor(root?: IObject2);
|
|
24
|
+
destroy(): void;
|
|
25
|
+
bind(root: IObject2): void;
|
|
26
|
+
_bindAction(action: IAnimationAction, prototypeAction?: IAnimationAction): void;
|
|
27
|
+
_activateAction(action: IAnimationAction): void;
|
|
28
|
+
_deactivateAction(action: IAnimationAction): void;
|
|
29
|
+
_initMemoryManager(): void;
|
|
30
|
+
_isActiveAction(action: IAnimationAction): boolean;
|
|
31
|
+
_addInactiveAction(action: IAnimationAction, clipUuid: string, rootUuid: string): void;
|
|
32
|
+
_removeInactiveAction(action: IAnimationAction): void;
|
|
33
|
+
_removeInactiveBindingsForAction(action: IAnimationAction): void;
|
|
34
|
+
_lendAction(action: IAnimationAction): void;
|
|
35
|
+
_takeBackAction(action: IAnimationAction): void;
|
|
36
|
+
_addInactiveBinding(binding: IPropertyMixer, rootUuid: string, trackName: string): void;
|
|
37
|
+
_removeInactiveBinding(binding: IPropertyMixer): void;
|
|
38
|
+
_lendBinding(binding: IPropertyMixer): void;
|
|
39
|
+
_takeBackBinding(binding: IPropertyMixer): void;
|
|
40
|
+
_lendControlInterpolant(): IInterpolant;
|
|
41
|
+
_takeBackControlInterpolant(interpolant: IInterpolant): void;
|
|
42
|
+
clipAction(clip: string | IAnimationClip, optionalRoot?: IObject2, blendMode?: number): IAnimationAction | undefined;
|
|
43
|
+
existingAction(clip: string | IAnimationClip, optionalRoot: IObject2): IAnimationAction | undefined;
|
|
44
|
+
removeAction(action?: IAnimationAction): void;
|
|
45
|
+
stopAllAction(): this;
|
|
46
|
+
update(deltaTime: number): this;
|
|
47
|
+
setTime(timeInSeconds: number): this;
|
|
48
|
+
getRoot(): IObject2 | undefined;
|
|
49
|
+
uncacheClip(clip: IAnimationClip): void;
|
|
50
|
+
uncacheRoot(root: IObject2): void;
|
|
51
|
+
uncacheAction(clip: IAnimationClip, optionalRoot: IObject2): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TKeyframeTrackValues } from '../interfaces';
|
|
2
|
+
export declare const isTypedArray: (object: any) => boolean;
|
|
3
|
+
export declare const arraySlice: <T extends TKeyframeTrackValues>(array: T, from?: number, to?: number) => T;
|
|
4
|
+
export declare const convertArray: <T extends TKeyframeTrackValues>(array: TKeyframeTrackValues, type: Float32ArrayConstructor | ArrayConstructor, forceClone?: boolean) => T;
|
|
5
|
+
export declare const getKeyframeOrder: (times: number[]) => number[];
|
|
6
|
+
export declare const sortedArray: (values: Array<number>, stride: number, orders: Array<number>) => Array<number>;
|
|
7
|
+
export declare const flattenJSON: (jsonKeys: any[], times: number[], values: number[], valuePropertyName: string) => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IInterpolant, IKeyframeTrack, ITrack, TKeyframeTrackValues } from '../interfaces';
|
|
2
|
+
export declare const InterpolateDiscrete = 2300;
|
|
3
|
+
export declare const InterpolateLinear = 2301;
|
|
4
|
+
export declare const InterpolateSmooth = 2302;
|
|
5
|
+
type InterpolantFactory = (this: KeyframeTrack, result: Float32Array) => (IInterpolant | undefined);
|
|
6
|
+
export declare abstract class KeyframeTrack implements IKeyframeTrack {
|
|
7
|
+
name: string;
|
|
8
|
+
times: Float32Array;
|
|
9
|
+
values: TKeyframeTrackValues;
|
|
10
|
+
ValueTypeName: string;
|
|
11
|
+
ValueBufferType: Float32ArrayConstructor | ArrayConstructor;
|
|
12
|
+
DefaultInterpolation: number;
|
|
13
|
+
createInterpolant: InterpolantFactory;
|
|
14
|
+
InterpolantFactoryMethodDiscrete: ((result?: Float32Array) => IInterpolant) | undefined;
|
|
15
|
+
InterpolantFactoryMethodLinear: ((result?: Float32Array) => IInterpolant) | undefined;
|
|
16
|
+
InterpolantFactoryMethodSmooth: ((result?: Float32Array) => IInterpolant) | undefined;
|
|
17
|
+
constructor(name: string, times: number[], values: any[], interpolation?: number);
|
|
18
|
+
static DefaultInterpolation: number;
|
|
19
|
+
static toJSON(track: IKeyframeTrack): ITrack;
|
|
20
|
+
_InterpolantFactoryMethodDiscrete(result?: Float32Array): IInterpolant;
|
|
21
|
+
_InterpolantFactoryMethodLinear(result?: Float32Array): IInterpolant;
|
|
22
|
+
_InterpolantFactoryMethodSmooth(result?: Float32Array): IInterpolant;
|
|
23
|
+
getValueSize(): number;
|
|
24
|
+
setInterpolation(interpolation: number): this;
|
|
25
|
+
getInterpolation(): number | undefined;
|
|
26
|
+
shift(timeOffset: number): this;
|
|
27
|
+
scale(timeScale: number): this;
|
|
28
|
+
trim(startTime: number, endTime: number): this;
|
|
29
|
+
validate(): boolean;
|
|
30
|
+
optimize(): this;
|
|
31
|
+
clone(): IKeyframeTrack;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { IAnimationObjectGroup, IObject2, IParsedTrack, IPropertyBinding, TKeyframeTrackValues } from '../interfaces';
|
|
2
|
+
export declare class PropertyBinding implements IPropertyBinding {
|
|
3
|
+
path: string;
|
|
4
|
+
parsedPath: IParsedTrack;
|
|
5
|
+
node: IObject2 | undefined;
|
|
6
|
+
rootNode: IObject2;
|
|
7
|
+
getValue: (targetArray: TKeyframeTrackValues, offset: number) => void;
|
|
8
|
+
setValue: (sourceArray: TKeyframeTrackValues, offset: number) => void;
|
|
9
|
+
targetObject: IObject2 | undefined;
|
|
10
|
+
propertyName: string | undefined;
|
|
11
|
+
resolvedProperty: any;
|
|
12
|
+
propertyIndex: number;
|
|
13
|
+
BindingType: IPropertyBindingType;
|
|
14
|
+
Versioning: IPropertyVersioning;
|
|
15
|
+
GetterByBindingType: ((buffer: TKeyframeTrackValues, offset: number) => void)[];
|
|
16
|
+
SetterByBindingTypeAndVersioning: ((buffer: TKeyframeTrackValues, offset: number) => void)[][];
|
|
17
|
+
constructor(rootNode: IObject2, path: string, parsedPath?: IParsedTrack);
|
|
18
|
+
static create(root: IObject2 | IAnimationObjectGroup, path: string, parsedPath?: IParsedTrack): IPropertyBinding;
|
|
19
|
+
/**
|
|
20
|
+
* Replaces spaces with underscores and removes unsupported characters from
|
|
21
|
+
* node names, to ensure compatibility with parseTrackName().
|
|
22
|
+
*
|
|
23
|
+
* @param {string} name Node name to be sanitized.
|
|
24
|
+
* @return {string}
|
|
25
|
+
*/
|
|
26
|
+
static sanitizeNodeName(name: string): string;
|
|
27
|
+
static parseTrackName(trackName: string): IParsedTrack;
|
|
28
|
+
static findNode(root: IObject2, nodeName: string | number): IObject2 | undefined;
|
|
29
|
+
_getValue_unavailable(): void;
|
|
30
|
+
_setValue_unavailable(): void;
|
|
31
|
+
_getValue_direct(buffer: TKeyframeTrackValues, offset: number): void;
|
|
32
|
+
_getValue_array(buffer: TKeyframeTrackValues, offset: number): void;
|
|
33
|
+
_getValue_arrayElement(buffer: TKeyframeTrackValues, offset: number): void;
|
|
34
|
+
_getValue_toArray(buffer: TKeyframeTrackValues, offset: number): void;
|
|
35
|
+
_getValue_color(buffer: TKeyframeTrackValues, offset: number): void;
|
|
36
|
+
_setValue_direct(buffer: TKeyframeTrackValues, offset: number): void;
|
|
37
|
+
_setValue_direct_setNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
38
|
+
_setValue_direct_setMatrixWorldNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
39
|
+
_setValue_array(buffer: TKeyframeTrackValues, offset: number): void;
|
|
40
|
+
_setValue_array_setNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
41
|
+
_setValue_array_setMatrixWorldNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
42
|
+
_setValue_arrayElement(buffer: TKeyframeTrackValues, offset: number): void;
|
|
43
|
+
_setValue_arrayElement_setNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
44
|
+
_setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
45
|
+
_setValue_fromArray(buffer: TKeyframeTrackValues, offset: number): void;
|
|
46
|
+
_setValue_fromArray_setNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
47
|
+
_setValue_fromArray_setMatrixWorldNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
48
|
+
_setValue_color(buffer: TKeyframeTrackValues, offset: number): void;
|
|
49
|
+
_setValue_color_setNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
50
|
+
_setValue_color_setMatrixWorldNeedsUpdate(buffer: TKeyframeTrackValues, offset: number): void;
|
|
51
|
+
_getValue_unbound(targetArray: TKeyframeTrackValues, offset: number): void;
|
|
52
|
+
_setValue_unbound(sourceArray: TKeyframeTrackValues, offset: number): void;
|
|
53
|
+
bind(): void;
|
|
54
|
+
unbind(): void;
|
|
55
|
+
}
|
|
56
|
+
interface IPropertyBindingType {
|
|
57
|
+
Direct: number;
|
|
58
|
+
EntireArray: number;
|
|
59
|
+
ArrayElement: number;
|
|
60
|
+
HasFromToArray: number;
|
|
61
|
+
ColorString: number;
|
|
62
|
+
}
|
|
63
|
+
interface IPropertyVersioning {
|
|
64
|
+
None: number;
|
|
65
|
+
NeedsUpdate: number;
|
|
66
|
+
MatrixWorldNeedsUpdate: number;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IPropertyBinding, IPropertyMixer, TKeyframeTrackValues } from '../interfaces';
|
|
2
|
+
export declare class PropertyMixer implements IPropertyMixer {
|
|
3
|
+
binding: IPropertyBinding;
|
|
4
|
+
valueSize: number;
|
|
5
|
+
buffer: TKeyframeTrackValues;
|
|
6
|
+
_workIndex: number;
|
|
7
|
+
_mixBufferRegion: Function;
|
|
8
|
+
_mixBufferRegionAdditive: Function;
|
|
9
|
+
_setIdentity: Function;
|
|
10
|
+
_origIndex: number;
|
|
11
|
+
_addIndex: number;
|
|
12
|
+
_cacheIndex: number | undefined;
|
|
13
|
+
cumulativeWeight: number;
|
|
14
|
+
cumulativeWeightAdditive: number;
|
|
15
|
+
useCount: number;
|
|
16
|
+
referenceCount: number;
|
|
17
|
+
constructor(binding: IPropertyBinding, typeName: string, valueSize: number);
|
|
18
|
+
accumulate(accuIndex: number, weight: number): void;
|
|
19
|
+
accumulateAdditive(weight: number): void;
|
|
20
|
+
apply(accuIndex: number): void;
|
|
21
|
+
saveOriginalState(): void;
|
|
22
|
+
restoreOriginalState(): void;
|
|
23
|
+
_setAdditiveIdentityNumeric(): void;
|
|
24
|
+
_setAdditiveIdentityQuaternion(): void;
|
|
25
|
+
_setAdditiveIdentityOther(): void;
|
|
26
|
+
_select(buffer: Float64Array, dstOffset: number, srcOffset: number, t: number, stride: number): void;
|
|
27
|
+
_lerp(buffer: Float64Array, dstOffset: number, srcOffset: number, t: number, stride: number): void;
|
|
28
|
+
_lerpAdditive(buffer: Float64Array, dstOffset: number, srcOffset: number, t: number, stride: number): void;
|
|
29
|
+
}
|
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
import { Application, IApplicationConfig } from './application';
|
|
2
2
|
import { MainScene } from '../scenes/main-scene';
|
|
3
|
-
import { IEvent, IObject2, ITree } from '../interfaces';
|
|
3
|
+
import { IBox2, IEvent, IObject2, ITree } from '../interfaces';
|
|
4
4
|
import { Adapter } from '../extras/adapter';
|
|
5
|
+
import { AnimateScene } from '../scenes/animate-scene';
|
|
6
|
+
import { AppDirector } from './app-director';
|
|
5
7
|
export declare class AppCvs<Config extends IApplicationConfig> extends Application<Config> {
|
|
6
8
|
params: Config;
|
|
7
9
|
adapter: Adapter;
|
|
8
10
|
private dynamicLoadedHandler;
|
|
9
11
|
private initializationCompleteHandler;
|
|
10
12
|
mainScene: MainScene<Config>;
|
|
13
|
+
animateScene: AnimateScene<Config>;
|
|
14
|
+
director: AppDirector<Config>;
|
|
11
15
|
private _url?;
|
|
12
16
|
private _layers?;
|
|
13
17
|
private _tic?;
|
|
14
18
|
private _t;
|
|
19
|
+
private rayCaster;
|
|
20
|
+
private intersects;
|
|
21
|
+
private readonly _cameraChangedHandler;
|
|
15
22
|
constructor(config?: Config);
|
|
16
23
|
destroy(): void;
|
|
24
|
+
bindEvents(): void;
|
|
25
|
+
unbindEvents(): void;
|
|
26
|
+
handleCameraChanged(): void;
|
|
17
27
|
trans2LoadingScene(): Promise<void>;
|
|
18
28
|
load(url?: string, layers?: string[]): Promise<void>;
|
|
19
29
|
pushResources2Scene(res?: IObject2[]): void;
|
|
20
30
|
reload(): Promise<void>;
|
|
21
31
|
/** overwrite */
|
|
32
|
+
assetTypeChanged(v?: string): void;
|
|
22
33
|
usedCacheChanged(v?: boolean): Promise<void>;
|
|
34
|
+
bgPassChanged(v?: boolean): Promise<void>;
|
|
23
35
|
getLayers(lv?: number): ITree[];
|
|
24
36
|
trans2MainScene(): void;
|
|
25
37
|
bindAdapterEvents(): void;
|
|
@@ -27,7 +39,19 @@ export declare class AppCvs<Config extends IApplicationConfig> extends Applicati
|
|
|
27
39
|
handleDynamicLoaded(e: IEvent): void;
|
|
28
40
|
handleInitializationComplete(e: IEvent): void;
|
|
29
41
|
fullScreen(): void;
|
|
42
|
+
handleViewTap(e: any, out?: IObject2[]): IObject2[];
|
|
30
43
|
updateLayersVisibility(ids: string | string[], visible?: boolean): void;
|
|
44
|
+
selectByIds(ids: string | string[]): void;
|
|
45
|
+
clearSelected(ids?: string | string[]): void;
|
|
46
|
+
multiSelectByRange(box: IBox2): void;
|
|
47
|
+
targetByIds(ids: string | string[]): Promise<void>;
|
|
48
|
+
getAssetIdsByType(assetType: string): string[] | undefined;
|
|
49
|
+
setFillByIds(ids: string[], c: string): void;
|
|
50
|
+
clearFill(): void;
|
|
51
|
+
setStrokeByIds(ids: string[], c: string): void;
|
|
52
|
+
clearStroke(): void;
|
|
53
|
+
fontZoomIn(v?: number): void;
|
|
54
|
+
fontZoomOut(v?: number): void;
|
|
31
55
|
/** overwrite */
|
|
32
56
|
running(time: DOMHighResTimeStamp): void;
|
|
33
57
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EffectDirector } from '../effects/effect-director';
|
|
2
|
+
import { IAnimationAction, IAnimationClip, IBox2, IObject2, IScene } from '../interfaces';
|
|
3
|
+
import { IApplicationConfig } from './application';
|
|
4
|
+
export declare class AppDirector<Config extends IApplicationConfig> extends EffectDirector {
|
|
5
|
+
name: string;
|
|
6
|
+
params: IApplicationConfig;
|
|
7
|
+
_selectedClip: IAnimationClip;
|
|
8
|
+
selectedAction?: IAnimationAction;
|
|
9
|
+
_selectedIds: string[];
|
|
10
|
+
constructor(config?: Config);
|
|
11
|
+
destroy(): void;
|
|
12
|
+
/** @override */
|
|
13
|
+
bind(oriScene?: IScene, desScene?: IScene): void;
|
|
14
|
+
hasSelected(id: string): boolean;
|
|
15
|
+
clearSelected(ids?: string | string[]): void;
|
|
16
|
+
selectByIds(ids: string | string[], toggle?: boolean): void;
|
|
17
|
+
toggleSelectByIds(ids: string | string[], toggle?: boolean): void;
|
|
18
|
+
multiSelectByRange(box: IBox2, toggle?: boolean): void;
|
|
19
|
+
/** @override */
|
|
20
|
+
update(): void;
|
|
21
|
+
updateGlobalSelectAnimate(o?: IObject2): void;
|
|
22
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IApplicationConfig } from './application';
|
|
2
2
|
import { OpeView } from '../core/ope-view';
|
|
3
|
-
import { APP_ENUM, ITree } from '../interfaces';
|
|
3
|
+
import { APP_ENUM, IEvent, ITree } from '../interfaces';
|
|
4
4
|
import { default as EventDispatcher } from '../core/event-dispatcher';
|
|
5
5
|
import { default as Box2 } from '../math/box2';
|
|
6
6
|
export declare class AppOffscreen<Config extends IApplicationConfig> extends EventDispatcher {
|
|
@@ -9,6 +9,8 @@ export declare class AppOffscreen<Config extends IApplicationConfig> extends Eve
|
|
|
9
9
|
worker: Worker;
|
|
10
10
|
view: OpeView<Config>;
|
|
11
11
|
boundingBox: Box2;
|
|
12
|
+
private readonly viewTapHandler;
|
|
13
|
+
private readonly multiSelectByRangeHandler;
|
|
12
14
|
readonly workerMessageHandler: (e: MessageEvent) => void;
|
|
13
15
|
readonly cameraHandler: (e: MessageEvent) => void;
|
|
14
16
|
readonly runningHandler: (time: DOMHighResTimeStamp) => void;
|
|
@@ -16,20 +18,38 @@ export declare class AppOffscreen<Config extends IApplicationConfig> extends Eve
|
|
|
16
18
|
destroy(): void;
|
|
17
19
|
bindEvents(): void;
|
|
18
20
|
unbindEvents(): void;
|
|
21
|
+
handleViewTap(e: IEvent): Promise<void>;
|
|
19
22
|
handleWorkerMessage(e: MessageEvent): void;
|
|
20
23
|
handleCameraChanged(e: MessageEvent): void;
|
|
21
|
-
promiseWorkerResponse<T>(task: APP_ENUM, data
|
|
24
|
+
promiseWorkerResponse<T>(task: APP_ENUM, data?: any): Promise<T>;
|
|
25
|
+
handleMultiSelectByRange(e: any): Promise<void>;
|
|
22
26
|
resize(): void;
|
|
23
27
|
load(url: string, layers?: string[]): Promise<void>;
|
|
24
28
|
getLayers(lv?: number): Promise<ITree[]>;
|
|
29
|
+
assetTypeChanged(v?: string): void;
|
|
25
30
|
usedCacheChanged(v?: boolean): void;
|
|
26
31
|
debounceCacheChanged(v?: boolean): void;
|
|
27
32
|
wireframeChanged(v?: boolean): void;
|
|
33
|
+
bgPassChanged(v?: boolean): void;
|
|
34
|
+
selectEnableChanged(v?: boolean): Promise<void>;
|
|
35
|
+
multiSelectEnableChanged(v?: boolean): Promise<void>;
|
|
36
|
+
zoomToSelectEnableChanged(v?: boolean): Promise<void>;
|
|
37
|
+
svgLoadingTypeChanged(v: number): Promise<void>;
|
|
28
38
|
fullscreen(): Promise<void>;
|
|
29
39
|
saveCameraPosition(id?: string): void;
|
|
30
40
|
restoreCameraPosition(id?: string): void;
|
|
31
41
|
clearCameraPosition(id?: string): void;
|
|
32
42
|
updateLayersVisibility(ids: string | string[], visible?: boolean): void;
|
|
43
|
+
clearSelected(ids?: string | string[]): Promise<void>;
|
|
44
|
+
selectByIds(ids: string | string[]): void;
|
|
45
|
+
targetByIds(ids: string | string[]): void;
|
|
46
|
+
getAssetIdsByType(assetType: string): Promise<string[] | undefined>;
|
|
47
|
+
setFillByIds(ids: string[], c: string): void;
|
|
48
|
+
clearFill(): void;
|
|
49
|
+
setStrokeByIds(ids: string[], c: string): void;
|
|
50
|
+
clearStroke(): void;
|
|
51
|
+
fontZoomIn(v?: number): Promise<void>;
|
|
52
|
+
fontZoomOut(v?: number): Promise<void>;
|
|
33
53
|
start(): void;
|
|
34
54
|
running(time: DOMHighResTimeStamp): void;
|
|
35
55
|
stop(): void;
|
|
@@ -8,6 +8,13 @@ export interface IApplicationConfig extends IRenderer2Config {
|
|
|
8
8
|
frameInterval?: number;
|
|
9
9
|
syncDelay?: number;
|
|
10
10
|
animateDuration?: number;
|
|
11
|
+
assetType: string;
|
|
12
|
+
svgLoadingType: number;
|
|
13
|
+
selectEnable?: boolean;
|
|
14
|
+
multiSelectEnable?: boolean;
|
|
15
|
+
zoomToSelectEnable?: boolean;
|
|
16
|
+
bgPass?: boolean;
|
|
17
|
+
axesHelper?: any;
|
|
11
18
|
defaultFill?: string;
|
|
12
19
|
defaultStroke?: string;
|
|
13
20
|
infoFill?: string;
|
|
@@ -42,7 +49,12 @@ export declare abstract class Application<Config extends IApplicationConfig> ext
|
|
|
42
49
|
get isLoadingScene(): boolean;
|
|
43
50
|
destroy(): void;
|
|
44
51
|
usedCacheChanged(v?: boolean): Promise<void>;
|
|
52
|
+
svgLoadingTypeChanged(v: number): void;
|
|
45
53
|
wireframeChanged(v?: boolean): void;
|
|
54
|
+
bgPassChanged(v?: boolean): void;
|
|
55
|
+
selectEnableChanged(v?: boolean): void;
|
|
56
|
+
multiSelectEnableChanged(v?: boolean): void;
|
|
57
|
+
zoomToSelectEnableChanged(v?: boolean): void;
|
|
46
58
|
trans2LoadingScene(): Promise<void>;
|
|
47
59
|
hasScene(scene: Scene): boolean;
|
|
48
60
|
pushScene(scene: Scene): void;
|
package/lib/core/camera2.d.ts
CHANGED
|
@@ -43,13 +43,13 @@ export default class Camera2<Config extends ICamera2Config> extends Object2 impl
|
|
|
43
43
|
updateMatrixWorld(force?: boolean): void;
|
|
44
44
|
updateProjectionMatrix(): void;
|
|
45
45
|
updateViewMatrix(): void;
|
|
46
|
-
update(): void;
|
|
46
|
+
update(dispatch?: boolean): void;
|
|
47
47
|
computeBoundingBox(): Box2;
|
|
48
48
|
updateBoundingBox(): void;
|
|
49
49
|
toJSON(): any;
|
|
50
50
|
fromJSON(o: any): void;
|
|
51
51
|
clone(): any;
|
|
52
|
-
copy(source: Camera2<Config>, recursive?: boolean): IObject2;
|
|
52
|
+
copy(source: Camera2<Config>, recursive?: boolean, deep?: boolean): IObject2;
|
|
53
53
|
}
|
|
54
54
|
export declare enum CAMERA_ENUM {
|
|
55
55
|
UPDATE = "update"
|
package/lib/core/object2.d.ts
CHANGED
|
@@ -93,11 +93,12 @@ export declare class Object2 extends EventDispatcher implements IObject2 {
|
|
|
93
93
|
traverse(callback: Function): void;
|
|
94
94
|
traverseVisible(callback: Function): void;
|
|
95
95
|
traverseAncestors(callback: Function): void;
|
|
96
|
-
onBeforeRender(renderer: any, scene: IObject2, camera?: ICamera2): void;
|
|
96
|
+
onBeforeRender(renderer: any, scene: IObject2, camera?: ICamera2, deltaTime?: number): void;
|
|
97
97
|
render(ctx: IContext2D): void;
|
|
98
98
|
onAfterRender(renderer: any, scene: IObject2, camera?: ICamera2): void;
|
|
99
99
|
setSelectable(v: boolean): void;
|
|
100
100
|
raycast(raycaster: IRaycaster, out?: IObject2[]): IObject2[];
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
getByRange(box: IBox2, recursive?: boolean, out?: IObject2[]): IObject2[];
|
|
102
|
+
clone(recursive?: boolean, deep?: boolean): IObject2;
|
|
103
|
+
copy(source: IObject2, recursive?: boolean, deep?: boolean): IObject2;
|
|
103
104
|
}
|
package/lib/core/ope-view.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICamera2Config, ICanvas, IEvent, IObject2, IRenderer2Config } from '../interfaces';
|
|
2
2
|
import { IOrbitControlsConfig } from '../controls/orbit-controls';
|
|
3
3
|
import { OrbitController } from '../controls/orbit-controller';
|
|
4
4
|
import { IAxesHelperConfig } from '../helpers/axes-helper';
|
|
5
5
|
import { View } from './view';
|
|
6
|
+
import { RayCaster } from './ray-caster';
|
|
7
|
+
import { DynamicDrawRect } from '../extras/dynamic-draw-rect';
|
|
6
8
|
export interface IViewConfig extends IRenderer2Config {
|
|
7
9
|
name?: string;
|
|
8
10
|
cvs?: ICanvas;
|
|
@@ -12,13 +14,32 @@ export interface IViewConfig extends IRenderer2Config {
|
|
|
12
14
|
alignStageCenter?: boolean;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
17
|
+
* Operate view
|
|
15
18
|
* @author Dio Zhu 2024.8.22
|
|
16
19
|
*/
|
|
17
20
|
export declare class OpeView<Config extends IViewConfig> extends View<Config> {
|
|
18
21
|
name: string;
|
|
19
22
|
controller: OrbitController;
|
|
23
|
+
container: HTMLElement;
|
|
24
|
+
graph: DynamicDrawRect;
|
|
25
|
+
zoomToSelectEnable?: boolean;
|
|
26
|
+
multiSelectEnable?: boolean;
|
|
27
|
+
rayCaster: RayCaster;
|
|
28
|
+
intersects: IObject2[];
|
|
29
|
+
private controllerPanStartHandler;
|
|
30
|
+
private controllerPanEndHandler;
|
|
31
|
+
private controllerPanMoveHandler;
|
|
32
|
+
private controllerPointerOverHandler;
|
|
20
33
|
constructor(config?: Config);
|
|
21
34
|
destroy(): void;
|
|
22
|
-
|
|
35
|
+
zoomToSelectEnableChanged(v?: boolean): void;
|
|
36
|
+
multiSelectEnableChanged(v?: boolean): void;
|
|
37
|
+
bindControllerEvents(): void;
|
|
38
|
+
unbindControllerEvents(): void;
|
|
39
|
+
handlePanStart(e: IEvent): void;
|
|
40
|
+
handlePanEnd(e: IEvent): Promise<void>;
|
|
41
|
+
handleControllerPanMove(e: IEvent): void;
|
|
42
|
+
handleControllerPointerOver(e: IEvent): void;
|
|
43
|
+
handleMultiSelectorSelected(e: IEvent): void;
|
|
23
44
|
handleCameraChanged(e: any): void;
|
|
24
45
|
}
|
package/lib/core/tic.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare class Tic {
|
|
|
2
2
|
duration: number;
|
|
3
3
|
generator?: Generator<undefined, void, unknown>;
|
|
4
4
|
t: number | null;
|
|
5
|
+
private stopped;
|
|
5
6
|
constructor(list: number | any[], callback: Function, duration?: number);
|
|
6
7
|
next(): void;
|
|
7
8
|
queue(len: number, callback: Function): Generator<undefined, void, unknown>;
|
package/lib/core/view.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { OrbitController } from '../controls/orbit-controller';
|
|
|
5
5
|
import { default as Box2 } from '../math/box2';
|
|
6
6
|
import { IAxesHelperConfig } from '../helpers/axes-helper';
|
|
7
7
|
import { Tween } from '@tweenjs/tween.js';
|
|
8
|
+
import { default as EventDispatcher } from './event-dispatcher';
|
|
8
9
|
export interface IViewConfig extends IRenderer2Config {
|
|
9
10
|
name?: string;
|
|
10
11
|
cvs?: ICanvas;
|
|
@@ -17,7 +18,7 @@ export interface IViewConfig extends IRenderer2Config {
|
|
|
17
18
|
/**
|
|
18
19
|
* @author Dio Zhu 2024.8.22
|
|
19
20
|
*/
|
|
20
|
-
export declare class View<Config extends IViewConfig> implements IView {
|
|
21
|
+
export declare class View<Config extends IViewConfig> extends EventDispatcher implements IView {
|
|
21
22
|
name: string;
|
|
22
23
|
params: Config;
|
|
23
24
|
visible: boolean;
|
|
@@ -6,8 +6,18 @@ export declare class DebouncePass extends Pass {
|
|
|
6
6
|
scene: Scene;
|
|
7
7
|
camera: ICamera2 | undefined;
|
|
8
8
|
fsQuad: FullScreenQuad;
|
|
9
|
+
debounceQuad: FullScreenQuad;
|
|
10
|
+
cacheQuad: FullScreenQuad;
|
|
9
11
|
version: number;
|
|
12
|
+
private debounceRenderHandler;
|
|
10
13
|
constructor(scene: Scene, camera?: ICamera2, clear?: boolean, needsSwap?: boolean);
|
|
14
|
+
destroy(): void;
|
|
11
15
|
get currentVersion(): number;
|
|
16
|
+
get isChanged(): boolean;
|
|
17
|
+
get isDebounceChanged(): boolean;
|
|
12
18
|
render(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
19
|
+
saveCache(org: FullScreenQuad, dst: FullScreenQuad): void;
|
|
20
|
+
renderCache(org: FullScreenQuad, dst: FullScreenQuad): void;
|
|
21
|
+
finalRender(org: FullScreenQuad, renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
22
|
+
debounceRender(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
13
23
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Clock } from '../core/clock';
|
|
2
|
+
import { AnimationMixer } from '../animations/animation-mixer';
|
|
3
|
+
import { IScene } from '../interfaces';
|
|
4
|
+
import { default as Box2 } from '../math/box2';
|
|
5
|
+
export declare class EffectDirector {
|
|
6
|
+
name: string;
|
|
7
|
+
clock: Clock;
|
|
8
|
+
oriScene?: IScene;
|
|
9
|
+
desScene?: IScene;
|
|
10
|
+
mixer?: AnimationMixer;
|
|
11
|
+
constructor();
|
|
12
|
+
destroy(): void;
|
|
13
|
+
bind(oriScene?: IScene, desScene?: IScene): void;
|
|
14
|
+
getBoundingBoxByIds(ids: string | string[], out?: Box2): Box2;
|
|
15
|
+
update(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ICamera2, IRenderer2, IRenderTarget } from '../interfaces';
|
|
2
|
+
import { FullScreenQuad, Pass } from './pass';
|
|
3
|
+
export declare class PaperPass extends Pass {
|
|
4
|
+
name: string;
|
|
5
|
+
fsQuad: FullScreenQuad;
|
|
6
|
+
ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
|
|
7
|
+
camera: ICamera2 | undefined;
|
|
8
|
+
version: number;
|
|
9
|
+
constructor(camera?: ICamera2);
|
|
10
|
+
destroy(): void;
|
|
11
|
+
get currentVersion(): number;
|
|
12
|
+
render(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
13
|
+
}
|
package/lib/effects/pass.d.ts
CHANGED
|
@@ -7,9 +7,7 @@ export declare class RenderCachedPass extends Pass {
|
|
|
7
7
|
camera: ICamera2 | undefined;
|
|
8
8
|
fsQuad: FullScreenQuad;
|
|
9
9
|
version: number;
|
|
10
|
-
private debounceRenderHandler;
|
|
11
10
|
constructor(scene: Scene, camera?: ICamera2, clear?: boolean, needsSwap?: boolean);
|
|
12
11
|
get currentVersion(): number;
|
|
13
12
|
render(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
14
|
-
handleDebounceRender(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
15
13
|
}
|