@galacean/effects-core 2.5.1 → 2.6.0-alpha.0
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/dist/asset-loader.d.ts +0 -1
- package/dist/comp-vfx-item.d.ts +0 -1
- package/dist/components/animator.d.ts +15 -0
- package/dist/components/effect-component.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/composition.d.ts +14 -7
- package/dist/decorators.d.ts +1 -0
- package/dist/index.js +4114 -1688
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4081 -1688
- package/dist/index.mjs.map +1 -1
- package/dist/math/value-getters/color-curve.d.ts +1 -0
- package/dist/math/value-getters/vector-curves.d.ts +13 -1
- package/dist/plugins/animation-graph/animation-graph-asset.d.ts +13 -0
- package/dist/plugins/animation-graph/blender.d.ts +38 -0
- package/dist/plugins/animation-graph/graph-context.d.ts +20 -0
- package/dist/plugins/animation-graph/graph-data-set.d.ts +5 -0
- package/dist/plugins/animation-graph/graph-instance.d.ts +30 -0
- package/dist/plugins/animation-graph/graph-node.d.ts +70 -0
- package/dist/plugins/animation-graph/index.d.ts +6 -0
- package/dist/plugins/animation-graph/node-asset-type.d.ts +3 -0
- package/dist/plugins/animation-graph/nodes/animation-clip-node.d.ts +52 -0
- package/dist/plugins/animation-graph/nodes/apply-additive-node.d.ts +23 -0
- package/dist/plugins/animation-graph/nodes/blend-1d-node.d.ts +23 -0
- package/dist/plugins/animation-graph/nodes/bool-nodes.d.ts +39 -0
- package/dist/plugins/animation-graph/nodes/const-value-nodes.d.ts +21 -0
- package/dist/plugins/animation-graph/nodes/control-parameter-nodes.d.ts +32 -0
- package/dist/plugins/animation-graph/nodes/index.d.ts +10 -0
- package/dist/plugins/animation-graph/nodes/operator-nodes.d.ts +35 -0
- package/dist/plugins/animation-graph/nodes/state-machine-node.d.ts +35 -0
- package/dist/plugins/animation-graph/nodes/state-node.d.ts +30 -0
- package/dist/plugins/animation-graph/nodes/transition-node.d.ts +48 -0
- package/dist/plugins/animation-graph/pose-result.d.ts +6 -0
- package/dist/plugins/animation-graph/pose.d.ts +25 -0
- package/dist/plugins/animation-graph/skeleton.d.ts +38 -0
- package/dist/plugins/cal/calculate-vfx-item.d.ts +25 -22
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/particle/particle-system.d.ts +3 -1
- package/dist/plugins/sprite/sprite-item.d.ts +15 -2
- package/dist/plugins/text/text-item.d.ts +0 -11
- package/dist/vfx-item.d.ts +4 -0
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Vector2 } from '@galacean/effects-math/es/core/vector2';
|
|
2
|
+
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
2
3
|
import { Vector4 } from '@galacean/effects-math/es/core/vector4';
|
|
3
|
-
import { ValueGetter } from './value-getter';
|
|
4
4
|
import type * as spec from '@galacean/effects-specification';
|
|
5
|
+
import { ValueGetter } from './value-getter';
|
|
5
6
|
export declare class Vector4Curve extends ValueGetter<Vector4> {
|
|
6
7
|
private value;
|
|
7
8
|
private xCurve;
|
|
@@ -10,6 +11,16 @@ export declare class Vector4Curve extends ValueGetter<Vector4> {
|
|
|
10
11
|
private wCurve;
|
|
11
12
|
onCreate(arg: spec.Vector4CurveData): void;
|
|
12
13
|
getValue(t: number): Vector4;
|
|
14
|
+
getMaxTime(): number;
|
|
15
|
+
}
|
|
16
|
+
export declare class Vector3Curve extends ValueGetter<Vector3> {
|
|
17
|
+
private value;
|
|
18
|
+
private xCurve;
|
|
19
|
+
private yCurve;
|
|
20
|
+
private zCurve;
|
|
21
|
+
onCreate(arg: spec.Vector3CurveData): void;
|
|
22
|
+
getValue(t: number): Vector3;
|
|
23
|
+
getMaxTime(): number;
|
|
13
24
|
}
|
|
14
25
|
export declare class Vector2Curve extends ValueGetter<Vector2> {
|
|
15
26
|
private value;
|
|
@@ -17,4 +28,5 @@ export declare class Vector2Curve extends ValueGetter<Vector2> {
|
|
|
17
28
|
private yCurve;
|
|
18
29
|
onCreate(arg: spec.Vector2CurveData): void;
|
|
19
30
|
getValue(t: number): Vector2;
|
|
31
|
+
getMaxTime(): number;
|
|
20
32
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as spec from '@galacean/effects-specification';
|
|
2
|
+
import { EffectsObject } from '../../effects-object';
|
|
3
|
+
import { GraphDataSet } from './graph-data-set';
|
|
4
|
+
import { type GraphNodeData } from './graph-node';
|
|
5
|
+
export declare class AnimationGraphAsset extends EffectsObject {
|
|
6
|
+
nodeDatas: GraphNodeData[];
|
|
7
|
+
graphDataSet: GraphDataSet;
|
|
8
|
+
controlParameterIDs: string[];
|
|
9
|
+
parameterLookupMap: Map<string, number>;
|
|
10
|
+
rootNodeIndex: number;
|
|
11
|
+
static createNodeData(type: spec.NodeDataType): GraphNodeData;
|
|
12
|
+
fromData(data: spec.AnimationGraphAssetData): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Color, Vector3 } from '@galacean/effects-math/es/core';
|
|
2
|
+
import { Quaternion } from '@galacean/effects-math/es/core/quaternion';
|
|
3
|
+
import type { Pose } from './pose';
|
|
4
|
+
export declare abstract class BlendFunction {
|
|
5
|
+
abstract blendVector3(source: Vector3, target: Vector3, weight: number, result: Vector3): void;
|
|
6
|
+
abstract blendQuaternion(source: Quaternion, target: Quaternion, weight: number, result: Quaternion): void;
|
|
7
|
+
abstract blendEuler(source: Vector3, target: Vector3, weight: number, result: Vector3): void;
|
|
8
|
+
abstract blendColor(source: Color, target: Color, weight: number, result: Color): void;
|
|
9
|
+
abstract blendFloat(source: number, target: number, weight: number): number;
|
|
10
|
+
}
|
|
11
|
+
export declare class NormalBlend extends BlendFunction {
|
|
12
|
+
blendVector3(source: Vector3, target: Vector3, weight: number, result: Vector3): void;
|
|
13
|
+
blendQuaternion(source: Quaternion, target: Quaternion, weight: number, result: Quaternion): void;
|
|
14
|
+
blendEuler(source: Vector3, target: Vector3, weight: number, result: Vector3): void;
|
|
15
|
+
blendFloat(source: number, target: number, weight: number): number;
|
|
16
|
+
blendColor(source: Color, target: Color, weight: number, result: Color): void;
|
|
17
|
+
private lerpEuler;
|
|
18
|
+
private normalizeAngle;
|
|
19
|
+
/**
|
|
20
|
+
* 计算两个角度之间的最短路径差
|
|
21
|
+
*/
|
|
22
|
+
private shortestAngleDiff;
|
|
23
|
+
private lerpAngle;
|
|
24
|
+
}
|
|
25
|
+
export declare class AdditiveBlend extends BlendFunction {
|
|
26
|
+
blendVector3(source: Vector3, target: Vector3, weight: number, result: Vector3): void;
|
|
27
|
+
blendQuaternion(source: Quaternion, target: Quaternion, weight: number, result: Quaternion): void;
|
|
28
|
+
blendEuler(source: Vector3, target: Vector3, weight: number, result: Vector3): void;
|
|
29
|
+
blendFloat(source: number, target: number, weight: number): number;
|
|
30
|
+
blendColor(source: Color, target: Color, weight: number, result: Color): void;
|
|
31
|
+
}
|
|
32
|
+
export declare class Blender {
|
|
33
|
+
private static normalBlendFunction;
|
|
34
|
+
private static additiveBlendFunction;
|
|
35
|
+
static localBlend(sourcePose: Pose, targetPose: Pose, blendWeight: number, resultPose: Pose): void;
|
|
36
|
+
static additiveBlend(sourcePose: Pose, targetPose: Pose, blendWeight: number, resultPose: Pose): void;
|
|
37
|
+
private static localBlendInternal;
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { GraphDataSet } from './graph-data-set';
|
|
2
|
+
import type { GraphNode, GraphNodeData } from './graph-node';
|
|
3
|
+
import type { Skeleton } from './skeleton';
|
|
4
|
+
export declare enum BranchState {
|
|
5
|
+
Active = 0,
|
|
6
|
+
Inactive = 1
|
|
7
|
+
}
|
|
8
|
+
export declare class GraphContext {
|
|
9
|
+
deltaTime: number;
|
|
10
|
+
updateID: number;
|
|
11
|
+
skeleton: Skeleton;
|
|
12
|
+
branchState: BranchState;
|
|
13
|
+
update(deltaTime: number): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class InstantiationContext {
|
|
16
|
+
nodeDatas: GraphNodeData[];
|
|
17
|
+
nodes: GraphNode[];
|
|
18
|
+
dataSet: GraphDataSet;
|
|
19
|
+
getNode<T extends GraphNode>(index: number): T;
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { VFXItem } from '../../vfx-item';
|
|
2
|
+
import type { AnimationGraphAsset } from './animation-graph-asset';
|
|
3
|
+
import type { GraphNode, PoseNodeDebugInfo } from './graph-node';
|
|
4
|
+
import { PoseResult } from './pose-result';
|
|
5
|
+
import { Skeleton } from './skeleton';
|
|
6
|
+
export declare class GraphInstance {
|
|
7
|
+
private graphAsset;
|
|
8
|
+
nodes: GraphNode[];
|
|
9
|
+
skeleton: Skeleton;
|
|
10
|
+
private rootNode;
|
|
11
|
+
private context;
|
|
12
|
+
private result;
|
|
13
|
+
constructor(graphAsset: AnimationGraphAsset, rootBone: VFXItem);
|
|
14
|
+
evaluateGraph(deltaTime: number): PoseResult;
|
|
15
|
+
isInitialized(): boolean;
|
|
16
|
+
isNodeActive(nodeIdx: number): boolean;
|
|
17
|
+
resetGraphState(): void;
|
|
18
|
+
getNumControlParameters(): number;
|
|
19
|
+
getControlParameterIndex(parameterID: string): number;
|
|
20
|
+
getControlParameterID(parameterNodeIndex: number): string;
|
|
21
|
+
setBool(name: string, value: boolean): void;
|
|
22
|
+
setFloat(name: string, value: number): void;
|
|
23
|
+
setTrigger(name: string): void;
|
|
24
|
+
resetTrigger(name: string): void;
|
|
25
|
+
getPoseNodeDebugInfo(nodeIdx: number): PoseNodeDebugInfo;
|
|
26
|
+
getRuntimeNodeDebugValue<T>(nodeIdx: number): T;
|
|
27
|
+
getNodeDebugInstance(nodeIdx: number): GraphNode;
|
|
28
|
+
private isControlParameter;
|
|
29
|
+
private setControlParameterValue;
|
|
30
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { GraphContext, InstantiationContext } from './graph-context';
|
|
3
|
+
import type { PoseResult } from './pose-result';
|
|
4
|
+
export declare const InvalidIndex = -1;
|
|
5
|
+
export declare class GraphNode {
|
|
6
|
+
private initializationCount;
|
|
7
|
+
private lastUpdateID;
|
|
8
|
+
constructor();
|
|
9
|
+
getNodeData<T extends GraphNodeData>(): T;
|
|
10
|
+
isValid(): boolean;
|
|
11
|
+
isInitialized(): boolean;
|
|
12
|
+
initialize(context: GraphContext): void;
|
|
13
|
+
/**
|
|
14
|
+
* Shutdown this node
|
|
15
|
+
*/
|
|
16
|
+
shutdown(context: GraphContext): void;
|
|
17
|
+
isNodeActive(updateID: number): boolean;
|
|
18
|
+
isUpdated(context: GraphContext): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Mark this node as active for the current update
|
|
21
|
+
*/
|
|
22
|
+
markNodeActive(context: GraphContext): void;
|
|
23
|
+
/**
|
|
24
|
+
* Internal initialization logic
|
|
25
|
+
*/
|
|
26
|
+
protected initializeInternal(context: GraphContext): void;
|
|
27
|
+
/**
|
|
28
|
+
* Internal shutdown logic
|
|
29
|
+
*/
|
|
30
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
31
|
+
}
|
|
32
|
+
export declare abstract class GraphNodeData {
|
|
33
|
+
index: number;
|
|
34
|
+
abstract instantiate(context: InstantiationContext): void;
|
|
35
|
+
load(data: spec.GraphNodeData): void;
|
|
36
|
+
protected createNode<T extends GraphNode>(nodeType: new () => T, context: InstantiationContext): T;
|
|
37
|
+
}
|
|
38
|
+
export interface PoseNodeDebugInfo {
|
|
39
|
+
duration: number;
|
|
40
|
+
currentTime: number;
|
|
41
|
+
previousTime: number;
|
|
42
|
+
}
|
|
43
|
+
export declare abstract class PoseNode extends GraphNode {
|
|
44
|
+
protected duration: number;
|
|
45
|
+
protected previousTime: number;
|
|
46
|
+
protected currentTime: number;
|
|
47
|
+
/**
|
|
48
|
+
* Get current clamped percentage over the duration
|
|
49
|
+
*/
|
|
50
|
+
getCurrentTime(): number;
|
|
51
|
+
/**
|
|
52
|
+
* Get previous clamped percentage over the duration
|
|
53
|
+
*/
|
|
54
|
+
getPreviousTime(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Get node duration
|
|
57
|
+
*/
|
|
58
|
+
getDuration(): number;
|
|
59
|
+
getDebugInfo(): PoseNodeDebugInfo;
|
|
60
|
+
abstract evaluate(context: GraphContext, result: PoseResult): PoseResult;
|
|
61
|
+
protected initializeInternal(context: GraphContext): void;
|
|
62
|
+
}
|
|
63
|
+
export declare abstract class ValueNode extends GraphNode {
|
|
64
|
+
setValue<T>(value: T): void;
|
|
65
|
+
abstract getValue<T>(context: GraphContext): T;
|
|
66
|
+
}
|
|
67
|
+
export declare abstract class FloatValueNode extends ValueNode {
|
|
68
|
+
}
|
|
69
|
+
export declare abstract class BoolValueNode extends ValueNode {
|
|
70
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { AnimationClip, AnimationCurve, ColorAnimationCurve, FloatAnimationCurve } from '../../cal/calculate-vfx-item';
|
|
3
|
+
import type { GraphContext, InstantiationContext } from '../graph-context';
|
|
4
|
+
import { GraphNodeData, PoseNode } from '../graph-node';
|
|
5
|
+
import type { PoseResult } from '../pose-result';
|
|
6
|
+
import type { Skeleton } from '../skeleton';
|
|
7
|
+
import type { Pose } from '../pose';
|
|
8
|
+
export declare class AnimationClipNodeData extends GraphNodeData {
|
|
9
|
+
playRate: number;
|
|
10
|
+
loopAnimation: boolean;
|
|
11
|
+
dataSlotIndex: number;
|
|
12
|
+
instantiate(context: InstantiationContext): void;
|
|
13
|
+
load(data: spec.AnimationClipNodeData): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class AnimationClipNode extends PoseNode {
|
|
16
|
+
animation: AnimationClip | null;
|
|
17
|
+
private animatable;
|
|
18
|
+
evaluate(context: GraphContext, result: PoseResult): PoseResult;
|
|
19
|
+
protected initializeInternal(context: GraphContext): void;
|
|
20
|
+
}
|
|
21
|
+
declare enum TransformCurveType {
|
|
22
|
+
Position = 0,
|
|
23
|
+
Scale = 1,
|
|
24
|
+
Rotation = 2,
|
|
25
|
+
Euler = 3
|
|
26
|
+
}
|
|
27
|
+
export interface TransformCurveInfo {
|
|
28
|
+
type: TransformCurveType;
|
|
29
|
+
curve: AnimationCurve;
|
|
30
|
+
boneIndex: number;
|
|
31
|
+
}
|
|
32
|
+
export interface FloatCurveInfo {
|
|
33
|
+
curve: FloatAnimationCurve;
|
|
34
|
+
animatedObjectIndex: number;
|
|
35
|
+
}
|
|
36
|
+
export interface ColorCurveInfo {
|
|
37
|
+
curve: ColorAnimationCurve;
|
|
38
|
+
animatedObjectIndex: number;
|
|
39
|
+
}
|
|
40
|
+
export declare class Animatable {
|
|
41
|
+
private skeleton;
|
|
42
|
+
private animationClip;
|
|
43
|
+
private transformCurveInfos;
|
|
44
|
+
private floatCurveInfos;
|
|
45
|
+
private colorCurveInfos;
|
|
46
|
+
constructor(skeleton: Skeleton, animationClip: AnimationClip);
|
|
47
|
+
getPose(time: number, outPose: Pose): void;
|
|
48
|
+
private addTransformCurveInfo;
|
|
49
|
+
private addFloatCurveInfo;
|
|
50
|
+
private addColorCurveInfo;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { GraphContext, InstantiationContext } from '../graph-context';
|
|
3
|
+
import { PoseResult } from '../pose-result';
|
|
4
|
+
import type { FloatValueNode } from '../graph-node';
|
|
5
|
+
import { GraphNodeData, PoseNode } from '../graph-node';
|
|
6
|
+
export declare class ApplyAdditiveNodeData extends GraphNodeData {
|
|
7
|
+
baseNodeIndex: number;
|
|
8
|
+
additiveNodeIndex: number;
|
|
9
|
+
inputParameterValueNodeIndex: number;
|
|
10
|
+
instantiate(context: InstantiationContext): void;
|
|
11
|
+
load(data: spec.ApplyAdditiveNodeData): void;
|
|
12
|
+
}
|
|
13
|
+
export declare class ApplyAdditiveNode extends PoseNode {
|
|
14
|
+
baseNode: PoseNode | null;
|
|
15
|
+
additiveNode: PoseNode | null;
|
|
16
|
+
inputParameterValueNode: FloatValueNode | null;
|
|
17
|
+
baseNodeResult: PoseResult;
|
|
18
|
+
additiveNodeResult: PoseResult;
|
|
19
|
+
protected initializeInternal(context: GraphContext): void;
|
|
20
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
21
|
+
evaluate(context: GraphContext, result: PoseResult): PoseResult;
|
|
22
|
+
private applyAdditive;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { GraphContext, InstantiationContext } from '../graph-context';
|
|
3
|
+
import type { FloatValueNode } from '../graph-node';
|
|
4
|
+
import { GraphNodeData, PoseNode } from '../graph-node';
|
|
5
|
+
import { PoseResult } from '../pose-result';
|
|
6
|
+
export declare class BlendNodeData extends GraphNodeData {
|
|
7
|
+
sourceNodeIndex0: number;
|
|
8
|
+
sourceNodeIndex1: number;
|
|
9
|
+
inputParameterValueNodeIndex: number;
|
|
10
|
+
instantiate(context: InstantiationContext): void;
|
|
11
|
+
load(data: spec.BlendNodeData): void;
|
|
12
|
+
}
|
|
13
|
+
export declare class BlendNode extends PoseNode {
|
|
14
|
+
source0: PoseNode | null;
|
|
15
|
+
source1: PoseNode | null;
|
|
16
|
+
inputParameterValueNode: FloatValueNode | null;
|
|
17
|
+
source0Result: PoseResult;
|
|
18
|
+
source1Result: PoseResult;
|
|
19
|
+
protected initializeInternal(context: GraphContext): void;
|
|
20
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
21
|
+
evaluate(context: GraphContext, result: PoseResult): PoseResult;
|
|
22
|
+
private localBlend;
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { InstantiationContext, GraphContext } from '../graph-context';
|
|
3
|
+
import { BoolValueNode, GraphNodeData } from '../graph-node';
|
|
4
|
+
export declare class AndNodeData extends GraphNodeData {
|
|
5
|
+
private conditionNodeIndices;
|
|
6
|
+
instantiate(context: InstantiationContext): void;
|
|
7
|
+
load(data: spec.AndNodeData): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class AndNode extends BoolValueNode {
|
|
10
|
+
conditionNodes: BoolValueNode[];
|
|
11
|
+
private result;
|
|
12
|
+
getValue<T>(context: GraphContext): T;
|
|
13
|
+
protected initializeInternal(context: GraphContext): void;
|
|
14
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
15
|
+
}
|
|
16
|
+
export declare class OrNodeData extends GraphNodeData {
|
|
17
|
+
private conditionNodeIndices;
|
|
18
|
+
instantiate(context: InstantiationContext): void;
|
|
19
|
+
load(data: spec.OrNodeData): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class OrNode extends BoolValueNode {
|
|
22
|
+
conditionNodes: BoolValueNode[];
|
|
23
|
+
private result;
|
|
24
|
+
getValue<T>(context: GraphContext): T;
|
|
25
|
+
protected initializeInternal(context: GraphContext): void;
|
|
26
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
27
|
+
}
|
|
28
|
+
export declare class NotNodeData extends GraphNodeData {
|
|
29
|
+
private inputValueNodeIndex;
|
|
30
|
+
instantiate(context: InstantiationContext): void;
|
|
31
|
+
load(data: spec.NotNodeData): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class NotNode extends BoolValueNode {
|
|
34
|
+
inputValueNode: BoolValueNode | null;
|
|
35
|
+
private result;
|
|
36
|
+
getValue<T>(context: GraphContext): T;
|
|
37
|
+
protected initializeInternal(context: GraphContext): void;
|
|
38
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { GraphContext, InstantiationContext } from '../graph-context';
|
|
3
|
+
import { BoolValueNode, FloatValueNode, GraphNodeData } from '../graph-node';
|
|
4
|
+
export declare class ConstFloatNodeData extends GraphNodeData {
|
|
5
|
+
value: number;
|
|
6
|
+
instantiate(context: InstantiationContext): void;
|
|
7
|
+
load(data: spec.ConstFloatNodeData): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class ConstFloatNode extends FloatValueNode {
|
|
10
|
+
value: number;
|
|
11
|
+
getValue<T>(context: GraphContext): T;
|
|
12
|
+
}
|
|
13
|
+
export declare class ConstBoolNodeData extends GraphNodeData {
|
|
14
|
+
value: boolean;
|
|
15
|
+
instantiate(context: InstantiationContext): void;
|
|
16
|
+
load(data: spec.ConstBoolNodeData): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class ConstBoolNode extends BoolValueNode {
|
|
19
|
+
value: boolean;
|
|
20
|
+
getValue<T>(context: GraphContext): T;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { GraphContext, InstantiationContext } from '../graph-context';
|
|
3
|
+
import { BoolValueNode, FloatValueNode, GraphNodeData } from '../graph-node';
|
|
4
|
+
export declare class ControlParameterFloatNodeData extends GraphNodeData {
|
|
5
|
+
value: number;
|
|
6
|
+
instantiate(context: InstantiationContext): void;
|
|
7
|
+
load(data: spec.ControlParameterFloatNodeData): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class ControlParameterFloatNode extends FloatValueNode {
|
|
10
|
+
private value;
|
|
11
|
+
getValue<T>(context: GraphContext): T;
|
|
12
|
+
setValue<T>(value: T): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class ControlParameterBoolNodeData extends GraphNodeData {
|
|
15
|
+
private value;
|
|
16
|
+
instantiate(context: InstantiationContext): void;
|
|
17
|
+
load(data: spec.ControlParameterBoolNodeData): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class ControlParameterBoolNode extends BoolValueNode {
|
|
20
|
+
private value;
|
|
21
|
+
getValue<T>(context: GraphContext): T;
|
|
22
|
+
setValue<T>(value: T): void;
|
|
23
|
+
}
|
|
24
|
+
export declare class ControlParameterTriggerNodeData extends GraphNodeData {
|
|
25
|
+
instantiate(context: InstantiationContext): void;
|
|
26
|
+
load(data: spec.ControlParameterTriggerNodeData): void;
|
|
27
|
+
}
|
|
28
|
+
export declare class ControlParameterTriggerNode extends BoolValueNode {
|
|
29
|
+
private value;
|
|
30
|
+
getValue<T>(context: GraphContext): T;
|
|
31
|
+
setValue<T>(value: T): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './animation-clip-node';
|
|
2
|
+
export * from './apply-additive-node';
|
|
3
|
+
export * from './blend-1d-node';
|
|
4
|
+
export * from './bool-nodes';
|
|
5
|
+
export * from './const-value-nodes';
|
|
6
|
+
export * from './control-parameter-nodes';
|
|
7
|
+
export * from './operator-nodes';
|
|
8
|
+
export * from './state-machine-node';
|
|
9
|
+
export * from './state-node';
|
|
10
|
+
export * from './transition-node';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { GraphContext, InstantiationContext } from '../graph-context';
|
|
3
|
+
import type { FloatValueNode } from '../graph-node';
|
|
4
|
+
import { BoolValueNode, GraphNodeData } from '../graph-node';
|
|
5
|
+
export declare class EqualNodeData extends GraphNodeData {
|
|
6
|
+
private inputValueNodeIndex;
|
|
7
|
+
private comparandValueNodeIndex;
|
|
8
|
+
instantiate(context: InstantiationContext): void;
|
|
9
|
+
load(data: spec.EqualNodeData): void;
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class FloatComparisonNodeData extends GraphNodeData {
|
|
12
|
+
protected inputValueNodeIndex: number;
|
|
13
|
+
protected comparandValueNodeIndex: number;
|
|
14
|
+
load(data: spec.FloatComparisonNodeData): void;
|
|
15
|
+
}
|
|
16
|
+
declare enum Comparison {
|
|
17
|
+
GreaterThan = 0,
|
|
18
|
+
LessThan = 1
|
|
19
|
+
}
|
|
20
|
+
export declare class FloatComparisonNode extends BoolValueNode {
|
|
21
|
+
inputValueNode: FloatValueNode | null;
|
|
22
|
+
comparandValueNode: FloatValueNode | null;
|
|
23
|
+
comparison: Comparison;
|
|
24
|
+
private result;
|
|
25
|
+
protected initializeInternal(context: GraphContext): void;
|
|
26
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
27
|
+
getValue<T>(context: GraphContext): T;
|
|
28
|
+
}
|
|
29
|
+
export declare class GreaterNodeData extends FloatComparisonNodeData {
|
|
30
|
+
instantiate(context: InstantiationContext): void;
|
|
31
|
+
}
|
|
32
|
+
export declare class LessNodeData extends FloatComparisonNodeData {
|
|
33
|
+
instantiate(context: InstantiationContext): void;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import { type GraphContext, type InstantiationContext } from '../graph-context';
|
|
3
|
+
import type { PoseResult } from '../pose-result';
|
|
4
|
+
import type { BoolValueNode } from '../graph-node';
|
|
5
|
+
import { GraphNodeData, PoseNode } from '../graph-node';
|
|
6
|
+
import type { StateNode } from './state-node';
|
|
7
|
+
import type { TransitionNode } from './transition-node';
|
|
8
|
+
export declare class StateMachineNodeData extends GraphNodeData {
|
|
9
|
+
stateDatas: spec.StateData[];
|
|
10
|
+
defaultStateIndex: number;
|
|
11
|
+
instantiate(context: InstantiationContext): void;
|
|
12
|
+
load(data: spec.StateMachineNodeData): void;
|
|
13
|
+
}
|
|
14
|
+
export interface TransitionInfo {
|
|
15
|
+
transitionNode: TransitionNode;
|
|
16
|
+
conditionNode: BoolValueNode;
|
|
17
|
+
targetStateIndex: number;
|
|
18
|
+
}
|
|
19
|
+
export interface StateInfo {
|
|
20
|
+
stateNode: StateNode;
|
|
21
|
+
transitions: TransitionInfo[];
|
|
22
|
+
}
|
|
23
|
+
export declare class StateMachineNode extends PoseNode {
|
|
24
|
+
states: StateInfo[];
|
|
25
|
+
defaultStateIndex: number;
|
|
26
|
+
private activeTransition;
|
|
27
|
+
private activeStateIndex;
|
|
28
|
+
evaluate(context: GraphContext, result: PoseResult): PoseResult;
|
|
29
|
+
private evaluateTransitions;
|
|
30
|
+
private selectDefaultState;
|
|
31
|
+
protected initializeInternal(context: GraphContext): void;
|
|
32
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
33
|
+
private initializeTransitionConditions;
|
|
34
|
+
private shutdownTransitionConditions;
|
|
35
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { GraphContext, InstantiationContext } from '../graph-context';
|
|
3
|
+
import type { PoseResult } from '../pose-result';
|
|
4
|
+
import { GraphNodeData, PoseNode } from '../graph-node';
|
|
5
|
+
export declare enum TransitionState {
|
|
6
|
+
None = 0,
|
|
7
|
+
TransitioningIn = 1,
|
|
8
|
+
TransitioningOut = 2
|
|
9
|
+
}
|
|
10
|
+
export declare class StateNodeData extends GraphNodeData {
|
|
11
|
+
childNodeIndex: number;
|
|
12
|
+
instantiate(context: InstantiationContext): void;
|
|
13
|
+
load(data: spec.StateNodeData): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class StateNode extends PoseNode {
|
|
16
|
+
childNode: PoseNode | null;
|
|
17
|
+
private transitionState;
|
|
18
|
+
private elapsedTimeInState;
|
|
19
|
+
private isFirstStateUpdate;
|
|
20
|
+
isTransitioning(): boolean;
|
|
21
|
+
isTransitioningIn(): boolean;
|
|
22
|
+
isTransitioningOut(): boolean;
|
|
23
|
+
startTransitionIn(context: GraphContext): void;
|
|
24
|
+
startTransitionOut(context: GraphContext): void;
|
|
25
|
+
setTransitioningState(newState: TransitionState): void;
|
|
26
|
+
getElapsedTimeInState(): number;
|
|
27
|
+
evaluate(context: GraphContext, result: PoseResult): PoseResult;
|
|
28
|
+
protected initializeInternal(context: GraphContext): void;
|
|
29
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { InstantiationContext, GraphContext } from '../graph-context';
|
|
3
|
+
import { PoseResult } from '../pose-result';
|
|
4
|
+
import { GraphNodeData, PoseNode } from '../graph-node';
|
|
5
|
+
import { type StateNode } from './state-node';
|
|
6
|
+
export declare enum SourceType {
|
|
7
|
+
State = 0,
|
|
8
|
+
Transition = 1,
|
|
9
|
+
CachedPose = 2
|
|
10
|
+
}
|
|
11
|
+
export declare class TransitionNodeData extends GraphNodeData {
|
|
12
|
+
duration: number;
|
|
13
|
+
hasExitTime: boolean;
|
|
14
|
+
exitTime: number;
|
|
15
|
+
targetStateNodeIndex: number;
|
|
16
|
+
instantiate(context: InstantiationContext): void;
|
|
17
|
+
load(data: spec.TransitionNodeData): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class TransitionNode extends PoseNode {
|
|
20
|
+
targetNode: StateNode;
|
|
21
|
+
hasExitTime: boolean;
|
|
22
|
+
exitTime: number;
|
|
23
|
+
private transitionLength;
|
|
24
|
+
private transitionProgress;
|
|
25
|
+
private blendWeight;
|
|
26
|
+
private sourceNode;
|
|
27
|
+
private sourceNodeResult;
|
|
28
|
+
private sourceType;
|
|
29
|
+
private targetNodeResult;
|
|
30
|
+
private blendedDuration;
|
|
31
|
+
evaluate(context: GraphContext, result: PoseResult): PoseResult;
|
|
32
|
+
isComplete(context: GraphContext): boolean;
|
|
33
|
+
getProgressPercentage(): number;
|
|
34
|
+
getSourceType(): SourceType;
|
|
35
|
+
isSourceATransition(): boolean;
|
|
36
|
+
isSourceAState(): boolean;
|
|
37
|
+
startTransitionFromState(context: GraphContext, sourceNodeResult: PoseResult, sourceState: StateNode, outResult: PoseResult): PoseResult;
|
|
38
|
+
startTransitionFromTransition(context: GraphContext, sourceNodeResult: PoseResult, sourceTransition: TransitionNode, outResult: PoseResult): PoseResult;
|
|
39
|
+
getSourceStateNode(): StateNode;
|
|
40
|
+
getSourceTransitionNode(): TransitionNode;
|
|
41
|
+
notifyNewTransitionStarting(context: GraphContext, targetStateNode: StateNode): void;
|
|
42
|
+
protected initializeInternal(context: GraphContext): void;
|
|
43
|
+
protected shutdownInternal(context: GraphContext): void;
|
|
44
|
+
private endSourceTransition;
|
|
45
|
+
private initializeTargetStateAndUpdateTransition;
|
|
46
|
+
private calculateBlendWeight;
|
|
47
|
+
private registerPoseTasksAndUpdateRootMotion;
|
|
48
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Quaternion } from '@galacean/effects-math/es/core/quaternion';
|
|
2
|
+
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
3
|
+
import type { Color } from '@galacean/effects-math/es/core/color';
|
|
4
|
+
import type { Skeleton } from './skeleton';
|
|
5
|
+
import type { Transform } from '../../transform';
|
|
6
|
+
export declare class NodeTransform {
|
|
7
|
+
position: Vector3;
|
|
8
|
+
rotation: Quaternion;
|
|
9
|
+
scale: Vector3;
|
|
10
|
+
euler: Vector3;
|
|
11
|
+
constructor(transform?: Transform);
|
|
12
|
+
copyFrom(transform: NodeTransform): this;
|
|
13
|
+
}
|
|
14
|
+
export declare class Pose {
|
|
15
|
+
skeleton: Skeleton;
|
|
16
|
+
parentSpaceTransforms: NodeTransform[];
|
|
17
|
+
floatPropertyValues: number[];
|
|
18
|
+
colorPropertyValues: Color[];
|
|
19
|
+
constructor(skeleton: Skeleton);
|
|
20
|
+
setPosition(path: string, position: Vector3): void;
|
|
21
|
+
setRotation(path: string, rotation: Quaternion): void;
|
|
22
|
+
setEuler(path: string, euler: Vector3): void;
|
|
23
|
+
setScale(path: string, scale: Vector3): void;
|
|
24
|
+
setFloat(path: string, value: number): void;
|
|
25
|
+
}
|