@woosh/meep-engine 2.131.35 → 2.131.36
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/build/bundle-worker-image-decoder.js +1 -1
- package/package.json +1 -1
- package/src/core/binary/BinaryBuffer.d.ts +14 -0
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +27 -0
- package/src/core/binary/allocator/OffsetAllocator.d.ts +5 -0
- package/src/core/binary/allocator/OffsetAllocator.d.ts.map +1 -1
- package/src/core/binary/allocator/OffsetAllocator.js +6 -0
- package/src/core/geom/3d/aabb/AABB3.d.ts +14 -0
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +24 -0
- package/src/core/math/hash/computeHashFloatArray.d.ts +3 -2
- package/src/core/math/hash/computeHashFloatArray.d.ts.map +1 -1
- package/src/core/math/hash/computeHashFloatArray.js +2 -1
- package/src/core/process/undo/ActionProcessor.d.ts.map +1 -1
- package/src/core/process/undo/ActionProcessor.js +3 -1
- package/src/engine/animation/curve/actionProcessorOperations/applyActionChange.d.ts +34 -0
- package/src/engine/animation/curve/actionProcessorOperations/applyActionChange.d.ts.map +1 -0
- package/src/engine/animation/curve/actionProcessorOperations/applyActionChange.js +61 -0
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts +107 -0
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts.map +1 -0
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.js +202 -0
- package/src/engine/animation/curve/compression/prototypeCurveCompression.js +24 -3
- package/src/engine/animation/curve/draw/buildReadOnlyDisplay.d.ts +3 -0
- package/src/engine/animation/curve/draw/buildReadOnlyDisplay.d.ts.map +1 -0
- package/src/engine/animation/curve/draw/buildReadOnlyDisplay.js +14 -0
- package/src/engine/animation/curve/draw/build_tangent_editor.d.ts +6 -1
- package/src/engine/animation/curve/draw/build_tangent_editor.d.ts.map +1 -1
- package/src/engine/animation/curve/draw/build_tangent_editor.js +220 -51
- package/src/engine/animation/curve/draw/displayMousePos.d.ts +7 -0
- package/src/engine/animation/curve/draw/displayMousePos.d.ts.map +1 -0
- package/src/engine/animation/curve/draw/displayMousePos.js +41 -0
- package/src/engine/animation/curve/draw/isInjectedKeyframeInBounds.d.ts +26 -0
- package/src/engine/animation/curve/draw/isInjectedKeyframeInBounds.d.ts.map +1 -0
- package/src/engine/animation/curve/draw/isInjectedKeyframeInBounds.js +93 -0
- package/src/engine/animation/curve/draw/position_canvas_to_curve.d.ts +12 -0
- package/src/engine/animation/curve/draw/position_canvas_to_curve.d.ts.map +1 -0
- package/src/engine/animation/curve/draw/position_canvas_to_curve.js +24 -0
- package/src/engine/animation/curve/draw/position_curve_to_canvas.d.ts +12 -0
- package/src/engine/animation/curve/draw/position_curve_to_canvas.d.ts.map +1 -0
- package/src/engine/animation/curve/draw/position_curve_to_canvas.js +25 -0
- package/src/engine/animation/curve/editor/CurveEditorView.d.ts +22 -0
- package/src/engine/animation/curve/editor/CurveEditorView.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/CurveEditorView.js +337 -0
- package/src/engine/animation/curve/editor/DragHandler.d.ts +17 -0
- package/src/engine/animation/curve/editor/DragHandler.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/DragHandler.js +35 -0
- package/src/engine/animation/curve/editor/KeyframeStateManager.d.ts +33 -0
- package/src/engine/animation/curve/editor/KeyframeStateManager.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/KeyframeStateManager.js +39 -0
- package/src/engine/animation/curve/editor/OperationRouter.d.ts +18 -0
- package/src/engine/animation/curve/editor/OperationRouter.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/OperationRouter.js +44 -0
- package/src/engine/animation/curve/editor/canvas2dDrawWorldAxisLabels.d.ts +14 -0
- package/src/engine/animation/curve/editor/canvas2dDrawWorldAxisLabels.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/canvas2dDrawWorldAxisLabels.js +63 -0
- package/src/engine/animation/curve/editor/canvas2dDrawWorldGrid.d.ts +28 -0
- package/src/engine/animation/curve/editor/canvas2dDrawWorldGrid.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/canvas2dDrawWorldGrid.js +70 -0
- package/src/engine/animation/curve/editor/canvas2dPlotCurveLine.d.ts +13 -0
- package/src/engine/animation/curve/editor/canvas2dPlotCurveLine.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/canvas2dPlotCurveLine.js +116 -0
- package/src/engine/animation/curve/editor/canvas2dPlotCurvePoints.d.ts +11 -0
- package/src/engine/animation/curve/editor/canvas2dPlotCurvePoints.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/canvas2dPlotCurvePoints.js +69 -0
- package/src/engine/animation/curve/editor/createCurveUploader.d.ts +8 -0
- package/src/engine/animation/curve/editor/createCurveUploader.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/createCurveUploader.js +25 -0
- package/src/engine/animation/curve/editor/createKeyCoordinateLabelView.d.ts +3 -0
- package/src/engine/animation/curve/editor/createKeyCoordinateLabelView.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/createKeyCoordinateLabelView.js +15 -0
- package/src/engine/animation/curve/editor/createKeyframeDraggableAspect.d.ts +24 -0
- package/src/engine/animation/curve/editor/createKeyframeDraggableAspect.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/createKeyframeDraggableAspect.js +142 -0
- package/src/engine/animation/curve/editor/createKeyframeMarker.d.ts +2 -0
- package/src/engine/animation/curve/editor/createKeyframeMarker.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/createKeyframeMarker.js +42 -0
- package/src/engine/animation/curve/editor/createPanTool.d.ts +11 -0
- package/src/engine/animation/curve/editor/createPanTool.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/createPanTool.js +41 -0
- package/src/engine/animation/curve/editor/createSelectionBoxTool.d.ts +14 -0
- package/src/engine/animation/curve/editor/createSelectionBoxTool.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/createSelectionBoxTool.js +93 -0
- package/src/engine/animation/curve/editor/deleteKeyframeAndResetVars.d.ts +8 -0
- package/src/engine/animation/curve/editor/deleteKeyframeAndResetVars.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/deleteKeyframeAndResetVars.js +24 -0
- package/src/engine/animation/curve/editor/determineUnitSpacing.d.ts +8 -0
- package/src/engine/animation/curve/editor/determineUnitSpacing.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/determineUnitSpacing.js +33 -0
- package/src/engine/animation/curve/editor/formatTruncDecimal.d.ts +7 -0
- package/src/engine/animation/curve/editor/formatTruncDecimal.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/formatTruncDecimal.js +14 -0
- package/src/engine/animation/curve/editor/inputEventHandlers.d.ts +32 -0
- package/src/engine/animation/curve/editor/inputEventHandlers.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/inputEventHandlers.js +125 -0
- package/src/engine/animation/curve/editor/uiContext.d.ts +10 -0
- package/src/engine/animation/curve/editor/uiContext.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/uiContext.js +18 -0
- package/src/engine/animation/curve/editor/updateAxisRange.d.ts +11 -0
- package/src/engine/animation/curve/editor/updateAxisRange.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/updateAxisRange.js +23 -0
- package/src/engine/animation/curve/editor/updateKeyframePosition.d.ts +9 -0
- package/src/engine/animation/curve/editor/updateKeyframePosition.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/updateKeyframePosition.js +38 -0
- package/src/engine/animation/curve/editor/updateMarkerPosition.d.ts +2 -0
- package/src/engine/animation/curve/editor/updateMarkerPosition.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/updateMarkerPosition.js +12 -0
- package/src/engine/animation/curve/editor/updateMarkerVisual.d.ts +9 -0
- package/src/engine/animation/curve/editor/updateMarkerVisual.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/updateMarkerVisual.js +53 -0
- package/src/engine/animation/curve/editor/uploadViaElement.d.ts +7 -0
- package/src/engine/animation/curve/editor/uploadViaElement.d.ts.map +1 -0
- package/src/engine/animation/curve/editor/uploadViaElement.js +35 -0
- package/src/engine/animation/curve/draw/build_curve_editor.d.ts +0 -9
- package/src/engine/animation/curve/draw/build_curve_editor.d.ts.map +0 -1
- package/src/engine/animation/curve/draw/build_curve_editor.js +0 -362
|
@@ -2,7 +2,8 @@ import { computeHashFloat } from "../../primitives/numbers/computeHashFloat.js";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
|
-
* @param {number[]|Float32Array|Float64Array} values
|
|
5
|
+
* @param {number[]|Float32Array|Float64Array|ArrayLike<number>} values
|
|
6
|
+
* @returns {number}
|
|
6
7
|
*/
|
|
7
8
|
export function computeHashFloatArray(values) {
|
|
8
9
|
const dataLength = values.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionProcessor.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/undo/ActionProcessor.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH;IACI;;;;OAIG;IACH,0BA4DC;IA3DG;;;OAGG;IACH,SAFU,YAAY,CAEG;IAEzB;;;OAGG;IACH,aAAsB;IAEtB;;;OAGG;IACH,aAAe;IAEf;;OAEG;IACH,QAFU,MAAM,CAED;IAEf;;;OAGG;IACH,oBAFU,MAAM,CAEW;IAE3B;;;OAGG;IACH,kBAFU,MAAM,CAEa;IAE7B;;;OAGG;IACH,oBAFU,MAAM,CAEmB;IAEnC;;;OAGG;IACH,6GAA+B;IAE/B;;;OAGG;IACH,+GAAiC;IAEjC;;;;OAIG;IACH,uBAAuC;IAG3C;;;OAGG;IACH,gBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,GACJ,CAAC,CAWb;IAED;;OAEG;IACH,cAGC;IAED;;;;;;;;OAQG;IACH,wBAFW,MAAM,QAqChB;IAED;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"ActionProcessor.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/undo/ActionProcessor.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH;IACI;;;;OAIG;IACH,0BA4DC;IA3DG;;;OAGG;IACH,SAFU,YAAY,CAEG;IAEzB;;;OAGG;IACH,aAAsB;IAEtB;;;OAGG;IACH,aAAe;IAEf;;OAEG;IACH,QAFU,MAAM,CAED;IAEf;;;OAGG;IACH,oBAFU,MAAM,CAEW;IAE3B;;;OAGG;IACH,kBAFU,MAAM,CAEa;IAE7B;;;OAGG;IACH,oBAFU,MAAM,CAEmB;IAEnC;;;OAGG;IACH,6GAA+B;IAE/B;;;OAGG;IACH,+GAAiC;IAEjC;;;;OAIG;IACH,uBAAuC;IAG3C;;;OAGG;IACH,gBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,GACJ,CAAC,CAWb;IAED;;OAEG;IACH,cAGC;IAED;;;;;;;;OAQG;IACH,wBAFW,MAAM,QAqChB;IAED;;;OAGG;IACH,oCAiCC;IAED,uBA2BC;IAED;;;;;OAKG;IACH,2CAcC;IAED;;;;;OAKG;IACH,4BAJW,CAAC,GACC,OAAO,CAWnB;IAED;;;;;;OAMG;IACH,4BAyDC;IAED,sBAQC;IAED;;;;OAIG;IACH,sBAmCC;IAED;;OAEG;IACH,sBAQC;IAED;;;;OAIG;IACH,sBA0BC;IAED;;;OAGG;IACH,gBAFW,QAAQ,iBAuBlB;IAED;;;OAGG;IACH,kCAQC;IAED;;;;;OAKG;IACH,oBAgBC;IAED;;;;OAIG;IACH,kBAMC;CACJ;iBAzfgB,+BAA+B;qBAG3B,WAAW;mBAFb,+BAA+B"}
|
|
@@ -181,7 +181,9 @@ export class ActionProcessor {
|
|
|
181
181
|
|
|
182
182
|
const removed_marks = marks.splice(markIndexToKeep, numMarks - markIndexToKeep);
|
|
183
183
|
// dispatch signal
|
|
184
|
-
|
|
184
|
+
for( let mark of removed_marks){
|
|
185
|
+
this.onMarkRemoved.send1(mark);
|
|
186
|
+
}
|
|
185
187
|
}
|
|
186
188
|
}
|
|
187
189
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {KeyframeStateManager} keyframeStateManager
|
|
4
|
+
* @param {List} kfToDelete
|
|
5
|
+
* @param {ActionProcessor} actionProcessor
|
|
6
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
7
|
+
*/
|
|
8
|
+
export function applyActionRemove(keyframeStateManager: KeyframeStateManager, kfToDelete: List, actionProcessor: ActionProcessor, actionProcessorCTX: keyframesContext): void;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {D} actionLabel
|
|
12
|
+
* @param {KeyframeStateManager} keyframeStateManager
|
|
13
|
+
* @param {ActionProcessor} actionProcessor
|
|
14
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
15
|
+
*/
|
|
16
|
+
export function applyActionSelection(actionLabel: D, keyframeStateManager: KeyframeStateManager, actionProcessor: ActionProcessor, actionProcessorCTX: keyframesContext): void;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {D} actionLabel
|
|
20
|
+
* @param curveSet
|
|
21
|
+
* @param {ActionProcessor} actionProcessor
|
|
22
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
23
|
+
*/
|
|
24
|
+
export function applyActionMove(actionLabel: D, curveSet: any, actionProcessor: ActionProcessor, actionProcessorCTX: keyframesContext): void;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param {Boolean} isClickedOnGraph
|
|
28
|
+
* @param {Boolean} isSelectionKeyHeld
|
|
29
|
+
* @param {ActionProcessor} actionProcessor
|
|
30
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
31
|
+
* @param {KeyframeStateManager} keyframeStateManager
|
|
32
|
+
*/
|
|
33
|
+
export function applyGlobalKeyframeDeselection(isClickedOnGraph: boolean, isSelectionKeyHeld: boolean, actionProcessor: ActionProcessor, actionProcessorCTX: keyframesContext, keyframeStateManager: KeyframeStateManager): void;
|
|
34
|
+
//# sourceMappingURL=applyActionChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyActionChange.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/animation/curve/actionProcessorOperations/applyActionChange.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,8KAIC;AAED;;;;;;GAMG;AACH,+KAMC;AAED;;;;;;GAMG;AACH,6IAGC;AAGD;;;;;;;GAOG;AACH,iOASC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {MoveKeyframeAction, RemoveKeyframeAction, SelectionAction} from "./curveActions.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {KeyframeStateManager} keyframeStateManager
|
|
6
|
+
* @param {List} kfToDelete
|
|
7
|
+
* @param {ActionProcessor} actionProcessor
|
|
8
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
9
|
+
*/
|
|
10
|
+
export function applyActionRemove(keyframeStateManager, kfToDelete, actionProcessor, actionProcessorCTX) {
|
|
11
|
+
actionProcessor.mark('delete keyframe(s)');
|
|
12
|
+
actionProcessor.do(new SelectionAction(keyframeStateManager.selectedKeyframes, keyframeStateManager.curKeyframeList, keyframeStateManager.prevKeyframeList, actionProcessorCTX))
|
|
13
|
+
actionProcessor.do(new RemoveKeyframeAction(kfToDelete, keyframeStateManager.NULL_KEYFRAME, actionProcessorCTX));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param {D} actionLabel
|
|
19
|
+
* @param {KeyframeStateManager} keyframeStateManager
|
|
20
|
+
* @param {ActionProcessor} actionProcessor
|
|
21
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
22
|
+
*/
|
|
23
|
+
export function applyActionSelection(actionLabel, keyframeStateManager, actionProcessor, actionProcessorCTX) {
|
|
24
|
+
//Applies only is there is a change
|
|
25
|
+
if (!keyframeStateManager.selectedKeyframes.equals(keyframeStateManager.curKeyframeList)) { //Prevent action when no change to selection
|
|
26
|
+
actionProcessor.mark(actionLabel);
|
|
27
|
+
actionProcessor.do(new SelectionAction(keyframeStateManager.selectedKeyframes, keyframeStateManager.curKeyframeList, keyframeStateManager.prevKeyframeList, actionProcessorCTX))
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param {D} actionLabel
|
|
34
|
+
* @param curveSet
|
|
35
|
+
* @param {ActionProcessor} actionProcessor
|
|
36
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
37
|
+
*/
|
|
38
|
+
export function applyActionMove(actionLabel, curveSet, actionProcessor, actionProcessorCTX) {
|
|
39
|
+
actionProcessor.mark(actionLabel);
|
|
40
|
+
actionProcessor.do(new MoveKeyframeAction(curveSet.curveStartValues, curveSet.curveStartIndices, curveSet.curveEndValue, curveSet.curveEndIndices, actionProcessorCTX));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param {Boolean} isClickedOnGraph
|
|
47
|
+
* @param {Boolean} isSelectionKeyHeld
|
|
48
|
+
* @param {ActionProcessor} actionProcessor
|
|
49
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
50
|
+
* @param {KeyframeStateManager} keyframeStateManager
|
|
51
|
+
*/
|
|
52
|
+
export function applyGlobalKeyframeDeselection(isClickedOnGraph, isSelectionKeyHeld, actionProcessor, actionProcessorCTX, keyframeStateManager) {
|
|
53
|
+
if (isClickedOnGraph) {
|
|
54
|
+
keyframeStateManager.observedActiveKeyframe.set(keyframeStateManager.NULL_KEYFRAME);
|
|
55
|
+
if (!isSelectionKeyHeld) {
|
|
56
|
+
keyframeStateManager.prevKeyframeList.copy(keyframeStateManager.selectedKeyframes);
|
|
57
|
+
keyframeStateManager.curKeyframeList.reset();
|
|
58
|
+
applyActionSelection('Deselection', keyframeStateManager, actionProcessor, actionProcessorCTX);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export class keyframesContext {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {AnimationCurve} curve
|
|
5
|
+
* @param {function} removeKeyframe
|
|
6
|
+
* @param {function} addKeyframe
|
|
7
|
+
* @param {Map} keyframeViews
|
|
8
|
+
* @param {ObservedValue} activeKeyframe
|
|
9
|
+
* @param {List} selectedKeyframes
|
|
10
|
+
* @param {function} handleCurveUpdate
|
|
11
|
+
* @param {function} updateGraph
|
|
12
|
+
*/
|
|
13
|
+
constructor({ curve, removeKeyframe, addKeyframe, keyframeViews, activeKeyframe, selectedKeyframes, handleCurveUpdate, updateGraph }: AnimationCurve);
|
|
14
|
+
refCurve: any;
|
|
15
|
+
fnRemoveKeyframe: any;
|
|
16
|
+
fnAddKeyframe: any;
|
|
17
|
+
refKeyframeViews: any;
|
|
18
|
+
refActiveKeyframe: any;
|
|
19
|
+
refSelectionKeyframes: any;
|
|
20
|
+
fnHandleCurveUpdate: any;
|
|
21
|
+
fnUpdateGraph: any;
|
|
22
|
+
}
|
|
23
|
+
export class RemoveKeyframeAction extends Action<any> {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param {List} passKeyframes
|
|
27
|
+
* @param {Keyframe} passNullKeyframe
|
|
28
|
+
* @param {keyframesContext} context
|
|
29
|
+
*/
|
|
30
|
+
constructor(passKeyframes: List<any>, passNullKeyframe: Keyframe, context: keyframesContext);
|
|
31
|
+
copyKfToDelete: any;
|
|
32
|
+
refNullKeyframe: Keyframe;
|
|
33
|
+
actionContext: keyframesContext;
|
|
34
|
+
linkedActiveKeyframe: any;
|
|
35
|
+
linkedSelectionKeyframes: List<any>;
|
|
36
|
+
apply(context: any): Promise<void>;
|
|
37
|
+
revert(context: any): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export class AddKeyframeAction extends Action<any> {
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param {Keyframe} passKeyframe
|
|
43
|
+
* @param {keyframesContext} context
|
|
44
|
+
*/
|
|
45
|
+
constructor(passKeyframe: Keyframe, context: keyframesContext);
|
|
46
|
+
newKeyframeToAdd: Keyframe;
|
|
47
|
+
actionContext: keyframesContext;
|
|
48
|
+
apply(context: any): Promise<void>;
|
|
49
|
+
revert(context: any): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export class MoveKeyframeAction extends Action<any> {
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param {AnimationCurve} passCurveValueStart
|
|
55
|
+
* @param {AnimationCurve} passCurveRefStart
|
|
56
|
+
* @param {AnimationCurve} passCurveValueEnd
|
|
57
|
+
* @param {AnimationCurve} passCurveRefEnd
|
|
58
|
+
* @param {keyframesContext} context
|
|
59
|
+
*/
|
|
60
|
+
constructor(passCurveValueStart: AnimationCurve, passCurveRefStart: AnimationCurve, passCurveValueEnd: AnimationCurve, passCurveRefEnd: AnimationCurve, context: keyframesContext);
|
|
61
|
+
curveRefStart: AnimationCurve;
|
|
62
|
+
curveValueStart: AnimationCurve;
|
|
63
|
+
curveRefEnd: AnimationCurve;
|
|
64
|
+
curveValueEnd: AnimationCurve;
|
|
65
|
+
actionContext: keyframesContext;
|
|
66
|
+
apply(context: any): Promise<void>;
|
|
67
|
+
revert(context: any): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
export class TangentChangeAction extends Action<any> {
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @param {Keyframe} passKeyframe
|
|
73
|
+
* @param {Keyframe} passKeyframeValueStart
|
|
74
|
+
* @param {Keyframe} passKeyframeValueEnd
|
|
75
|
+
* @param {function} handleTangentUpdate
|
|
76
|
+
* @param {keyframesContext} context
|
|
77
|
+
*/
|
|
78
|
+
constructor(passKeyframe: Keyframe, passKeyframeValueStart: Keyframe, passKeyframeValueEnd: Keyframe, handleTangentUpdate: Function, context: keyframesContext);
|
|
79
|
+
refKeyframe: Keyframe;
|
|
80
|
+
keyframeValueStart: Keyframe;
|
|
81
|
+
keyframeValueEnd: Keyframe;
|
|
82
|
+
actionContext: keyframesContext;
|
|
83
|
+
fnHandleTangentUpdate: Function;
|
|
84
|
+
apply(context: any): Promise<void>;
|
|
85
|
+
revert(context: any): Promise<void>;
|
|
86
|
+
}
|
|
87
|
+
export class SelectionAction extends Action<any> {
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* @param {List} passSelectionKeyframe
|
|
91
|
+
* @param {List} passSelectionList
|
|
92
|
+
* @param {List} passPrevSelectionList
|
|
93
|
+
* @param {keyframesContext} context
|
|
94
|
+
*/
|
|
95
|
+
constructor(passSelectionKeyframe: List<any>, passSelectionList: List<any>, passPrevSelectionList: List<any>, context: keyframesContext);
|
|
96
|
+
refSelectionKeyframe: List<any>;
|
|
97
|
+
keyframeList: List<any>;
|
|
98
|
+
prevKeyframeList: List<any>;
|
|
99
|
+
actionContext: keyframesContext;
|
|
100
|
+
apply(context: any): Promise<void>;
|
|
101
|
+
revert(context: any): Promise<void>;
|
|
102
|
+
}
|
|
103
|
+
import { AnimationCurve } from "../AnimationCurve.js";
|
|
104
|
+
import { Action } from "../../../../core/process/undo/Action.js";
|
|
105
|
+
import { Keyframe } from "../Keyframe.js";
|
|
106
|
+
import List from "../../../../core/collection/list/List.js";
|
|
107
|
+
//# sourceMappingURL=curveActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curveActions.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/animation/curve/actionProcessorOperations/curveActions.js"],"names":[],"mappings":"AAKA;IACI;;;;;;;;;;OAUG;IACH,sIATW,cAAc,EAkBxB;IARG,cAAqB;IACrB,sBAAsC;IACtC,mBAAgC;IAChC,sBAAqC;IACrC,uBAAuC;IACvC,2BAA8C;IAC9C,yBAA4C;IAC5C,mBAAgC;CAEvC;AAED;IACI;;;;;OAKG;IACH,wDAHW,QAAQ,WACR,gBAAgB,EAc1B;IAVG,oBAA2C;IAC3C,0BAAuC;IAEvC,gCAA4B;IAE5B,0BAAsE;IACtE,oCAA0C;IAM9C,mCASC;IAED,oCAMC;CACJ;AAED;IACI;;;;OAIG;IACH,0BAHW,QAAQ,WACR,gBAAgB,EAO1B;IAHG,2BAA4C;IAE5C,gCAA4B;IAGhC,mCAIC;IAED,oCAKC;CACJ;AAED;IACI;;;;;;;OAOG;IACH,iCANW,cAAc,qBACd,cAAc,qBACd,cAAc,mBACd,cAAc,WACd,gBAAgB,EAW1B;IAPG,8BAAsC;IACtC,gCAAkD;IAElD,4BAAkC;IAClC,8BAA8C;IAE9C,gCAA4B;IAGhC,mCAMC;IAED,oCAMC;CACJ;AAED;IACI;;;;;;;OAOG;IACH,0BANW,QAAQ,0BACR,QAAQ,wBACR,QAAQ,0CAER,gBAAgB,EAU1B;IANG,sBAA+B;IAC/B,6BAAwD;IACxD,2BAAoD;IAEpD,gCAA4B;IAC5B,gCAAgD;IAGpD,mCAKC;IAED,oCAKC;CACJ;AAED;IACI;;;;;;OAMG;IACH,uHAFW,gBAAgB,EAU1B;IANG,gCAAiD;IACjD,wBAA8B;IAE9B,4BAAkC;IAElC,gCAA4B;IAGhC,mCAMC;IAED,oCAMC;CACJ;+BAxM4B,sBAAsB;uBAD9B,yCAAyC;yBAEvC,gBAAgB;iBACtB,0CAA0C"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import {Action} from "../../../../core/process/undo/Action.js";
|
|
2
|
+
import {AnimationCurve} from "../AnimationCurve.js";
|
|
3
|
+
import {Keyframe} from "../Keyframe.js";
|
|
4
|
+
import List from "../../../../core/collection/list/List.js";
|
|
5
|
+
|
|
6
|
+
export class keyframesContext{
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {AnimationCurve} curve
|
|
10
|
+
* @param {function} removeKeyframe
|
|
11
|
+
* @param {function} addKeyframe
|
|
12
|
+
* @param {Map} keyframeViews
|
|
13
|
+
* @param {ObservedValue} activeKeyframe
|
|
14
|
+
* @param {List} selectedKeyframes
|
|
15
|
+
* @param {function} handleCurveUpdate
|
|
16
|
+
* @param {function} updateGraph
|
|
17
|
+
*/
|
|
18
|
+
constructor({curve, removeKeyframe, addKeyframe, keyframeViews, activeKeyframe, selectedKeyframes, handleCurveUpdate, updateGraph}) {
|
|
19
|
+
this.refCurve = curve;
|
|
20
|
+
this.fnRemoveKeyframe = removeKeyframe;
|
|
21
|
+
this.fnAddKeyframe = addKeyframe;
|
|
22
|
+
this.refKeyframeViews = keyframeViews;
|
|
23
|
+
this.refActiveKeyframe = activeKeyframe;
|
|
24
|
+
this.refSelectionKeyframes = selectedKeyframes;
|
|
25
|
+
this.fnHandleCurveUpdate = handleCurveUpdate;
|
|
26
|
+
this.fnUpdateGraph = updateGraph;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class RemoveKeyframeAction extends Action {
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param {List} passKeyframes
|
|
34
|
+
* @param {Keyframe} passNullKeyframe
|
|
35
|
+
* @param {keyframesContext} context
|
|
36
|
+
*/
|
|
37
|
+
constructor(passKeyframes, passNullKeyframe, context) {
|
|
38
|
+
super();
|
|
39
|
+
this.copyKfToDelete = passKeyframes.clone();
|
|
40
|
+
this.refNullKeyframe = passNullKeyframe;
|
|
41
|
+
|
|
42
|
+
this.actionContext = context;
|
|
43
|
+
|
|
44
|
+
this.linkedActiveKeyframe = this.actionContext.refActiveKeyframe.get();
|
|
45
|
+
this.linkedSelectionKeyframes = new List();
|
|
46
|
+
this.actionContext.refSelectionKeyframes.forEach(keyframe => {
|
|
47
|
+
this.linkedSelectionKeyframes.add(keyframe);
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async apply(context){
|
|
52
|
+
this.copyKfToDelete.forEach((selKF) => {
|
|
53
|
+
this.actionContext.refCurve.remove(selKF);
|
|
54
|
+
this.actionContext.fnRemoveKeyframe(selKF);
|
|
55
|
+
});
|
|
56
|
+
this.actionContext.fnHandleCurveUpdate();
|
|
57
|
+
|
|
58
|
+
this.actionContext.refActiveKeyframe.set(this.refNullKeyframe);
|
|
59
|
+
this.actionContext.refSelectionKeyframes.reset();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async revert(context){
|
|
63
|
+
this.copyKfToDelete.forEach((selKF) => {
|
|
64
|
+
this.actionContext.refCurve.add(selKF);
|
|
65
|
+
this.actionContext.fnAddKeyframe(selKF);
|
|
66
|
+
});
|
|
67
|
+
this.actionContext.fnHandleCurveUpdate();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class AddKeyframeAction extends Action {
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param {Keyframe} passKeyframe
|
|
75
|
+
* @param {keyframesContext} context
|
|
76
|
+
*/
|
|
77
|
+
constructor(passKeyframe, context) {
|
|
78
|
+
super();
|
|
79
|
+
this.newKeyframeToAdd = passKeyframe.clone();
|
|
80
|
+
|
|
81
|
+
this.actionContext = context;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async apply(context){
|
|
85
|
+
this.actionContext.refCurve.add(this.newKeyframeToAdd);
|
|
86
|
+
this.actionContext.fnAddKeyframe(this.newKeyframeToAdd);
|
|
87
|
+
this.actionContext.fnHandleCurveUpdate();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async revert(context){
|
|
91
|
+
this.actionContext.refCurve.remove(this.newKeyframeToAdd);
|
|
92
|
+
this.actionContext.fnRemoveKeyframe(this.newKeyframeToAdd);
|
|
93
|
+
|
|
94
|
+
this.actionContext.fnHandleCurveUpdate();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export class MoveKeyframeAction extends Action {
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @param {AnimationCurve} passCurveValueStart
|
|
102
|
+
* @param {AnimationCurve} passCurveRefStart
|
|
103
|
+
* @param {AnimationCurve} passCurveValueEnd
|
|
104
|
+
* @param {AnimationCurve} passCurveRefEnd
|
|
105
|
+
* @param {keyframesContext} context
|
|
106
|
+
*/
|
|
107
|
+
constructor(passCurveValueStart, passCurveRefStart, passCurveValueEnd, passCurveRefEnd, context) {
|
|
108
|
+
super();
|
|
109
|
+
this.curveRefStart = passCurveRefStart;
|
|
110
|
+
this.curveValueStart = passCurveValueStart.clone();
|
|
111
|
+
|
|
112
|
+
this.curveRefEnd = passCurveRefEnd
|
|
113
|
+
this.curveValueEnd = passCurveValueEnd.clone();
|
|
114
|
+
|
|
115
|
+
this.actionContext = context;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async apply(context){
|
|
119
|
+
for (let i = 0; i < this.actionContext.refCurve.length; i++) {
|
|
120
|
+
this.actionContext.refCurve.keys[i] = this.curveRefEnd.keys[i];
|
|
121
|
+
this.actionContext.refCurve.keys[i].copy(this.curveValueEnd.keys[i]);
|
|
122
|
+
}
|
|
123
|
+
this.actionContext.fnHandleCurveUpdate();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async revert(context){
|
|
127
|
+
for (let i = 0; i < this.actionContext.refCurve.length; i++) {
|
|
128
|
+
this.actionContext.refCurve.keys[i] = this.curveRefStart.keys[i];
|
|
129
|
+
this.actionContext.refCurve.keys[i].copy(this.curveValueStart.keys[i]);
|
|
130
|
+
}
|
|
131
|
+
this.actionContext.fnHandleCurveUpdate();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export class TangentChangeAction extends Action {
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param {Keyframe} passKeyframe
|
|
139
|
+
* @param {Keyframe} passKeyframeValueStart
|
|
140
|
+
* @param {Keyframe} passKeyframeValueEnd
|
|
141
|
+
* @param {function} handleTangentUpdate
|
|
142
|
+
* @param {keyframesContext} context
|
|
143
|
+
*/
|
|
144
|
+
constructor(passKeyframe, passKeyframeValueStart, passKeyframeValueEnd, handleTangentUpdate, context) {
|
|
145
|
+
super();
|
|
146
|
+
this.refKeyframe = passKeyframe;
|
|
147
|
+
this.keyframeValueStart = passKeyframeValueStart.clone();
|
|
148
|
+
this.keyframeValueEnd = passKeyframeValueEnd.clone();
|
|
149
|
+
|
|
150
|
+
this.actionContext = context;
|
|
151
|
+
this.fnHandleTangentUpdate = handleTangentUpdate
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async apply(context){
|
|
155
|
+
this.refKeyframe.copy(this.keyframeValueEnd);
|
|
156
|
+
|
|
157
|
+
this.fnHandleTangentUpdate();
|
|
158
|
+
this.actionContext.fnHandleCurveUpdate();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async revert(context){
|
|
162
|
+
this.refKeyframe.copy(this.keyframeValueStart);
|
|
163
|
+
|
|
164
|
+
this.fnHandleTangentUpdate();
|
|
165
|
+
this.actionContext.fnHandleCurveUpdate();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export class SelectionAction extends Action {
|
|
170
|
+
/**
|
|
171
|
+
*
|
|
172
|
+
* @param {List} passSelectionKeyframe
|
|
173
|
+
* @param {List} passSelectionList
|
|
174
|
+
* @param {List} passPrevSelectionList
|
|
175
|
+
* @param {keyframesContext} context
|
|
176
|
+
*/
|
|
177
|
+
constructor(passSelectionKeyframe, passSelectionList, passPrevSelectionList, context) {
|
|
178
|
+
super();
|
|
179
|
+
this.refSelectionKeyframe = passSelectionKeyframe;
|
|
180
|
+
this.keyframeList = new List()
|
|
181
|
+
this.keyframeList.copy(passSelectionList)
|
|
182
|
+
this.prevKeyframeList = new List()
|
|
183
|
+
this.prevKeyframeList.copy(passPrevSelectionList)
|
|
184
|
+
this.actionContext = context;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
async apply(context){
|
|
188
|
+
this.refSelectionKeyframe.reset()
|
|
189
|
+
this.keyframeList.forEach(k => {
|
|
190
|
+
this.refSelectionKeyframe.add(k)
|
|
191
|
+
})
|
|
192
|
+
this.actionContext.fnUpdateGraph();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
async revert(context){
|
|
196
|
+
this.refSelectionKeyframe.reset()
|
|
197
|
+
this.prevKeyframeList.forEach(k => {
|
|
198
|
+
this.refSelectionKeyframe.add(k)
|
|
199
|
+
})
|
|
200
|
+
this.actionContext.fnUpdateGraph();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -6,12 +6,13 @@ import ViewportPositionSystem from "../../../ecs/gui/position/ViewportPositionSy
|
|
|
6
6
|
import { EngineConfiguration } from "../../../EngineConfiguration.js";
|
|
7
7
|
import { EngineHarness } from "../../../EngineHarness.js";
|
|
8
8
|
import { AnimationCurve } from "../AnimationCurve.js";
|
|
9
|
-
import { build_curve_editor } from "../draw/build_curve_editor.js";
|
|
10
9
|
import { build_plot_entity_from_array } from "../draw/build_plot_entity_from_array.js";
|
|
11
10
|
import { Keyframe } from "../Keyframe.js";
|
|
12
11
|
import { CURVE_EASE_IN_OUT } from "../preset/CURVE_EASE_IN_OUT.js";
|
|
13
12
|
import { downsample_float_array_curve_by_error } from "./downsample_float_array_curve_by_error.js";
|
|
14
13
|
import { sample_animation_curve_to_float_array } from "./sample_animation_curve_to_float_array.js";
|
|
14
|
+
import AABB2 from "../../../../core/geom/2d/aabb/AABB2.js";
|
|
15
|
+
import {CurveEditorView} from "../editor/CurveEditorView.js";
|
|
15
16
|
|
|
16
17
|
const eh = new EngineHarness();
|
|
17
18
|
|
|
@@ -154,7 +155,24 @@ async function main(engine) {
|
|
|
154
155
|
// curve.smoothAllTangents();
|
|
155
156
|
|
|
156
157
|
// const curve = sample_curve_5();
|
|
157
|
-
const curve = CURVE_EASE_IN_OUT;
|
|
158
|
+
// const curve = CURVE_EASE_IN_OUT;
|
|
159
|
+
|
|
160
|
+
const curve = new AnimationCurve();
|
|
161
|
+
|
|
162
|
+
// curve.add(Keyframe.from(0, 0, 0, 0));
|
|
163
|
+
// curve.add(Keyframe.from(0.4, 0.5, -1.4, 1));
|
|
164
|
+
// curve.add(Keyframe.from(0.5, 0.5, -1.4, 1));
|
|
165
|
+
// curve.add(Keyframe.from(0.6, 0.5, -1.4, 1));
|
|
166
|
+
// curve.add(Keyframe.from(0.7, 0.5, -1.4, 1));
|
|
167
|
+
// curve.add(Keyframe.from(1, 1, 0, 0));
|
|
168
|
+
|
|
169
|
+
curve.add(Keyframe.from(-0.2, 0, 0, 0));
|
|
170
|
+
curve.add(Keyframe.from(0.1, 1.5, -1.4, 1));
|
|
171
|
+
curve.add(Keyframe.from(0.5, 0.2, -1.4, 1));
|
|
172
|
+
curve.add(Keyframe.from(0.8, -0.5, -1.4, 1));
|
|
173
|
+
curve.add(Keyframe.from(1.0, 0.5, -1.4, 1));
|
|
174
|
+
curve.add(Keyframe.from(1.5, 1, 0, 0));
|
|
175
|
+
|
|
158
176
|
|
|
159
177
|
const ecd = engine.entityManager.dataset;
|
|
160
178
|
|
|
@@ -162,7 +180,10 @@ async function main(engine) {
|
|
|
162
180
|
|
|
163
181
|
console.log(curve);
|
|
164
182
|
|
|
165
|
-
const editor_view =
|
|
183
|
+
const editor_view = new CurveEditorView({
|
|
184
|
+
curve,
|
|
185
|
+
enableEdit:true
|
|
186
|
+
});
|
|
166
187
|
|
|
167
188
|
new Entity()
|
|
168
189
|
.add(ViewportPosition.fromJSON({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildReadOnlyDisplay.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/animation/curve/draw/buildReadOnlyDisplay.js"],"names":[],"mappings":"AAGA,kDAUC;sBAbqB,sCAAsC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import LabelView from "../../../../view/common/LabelView.js";
|
|
2
|
+
import {CSS_ABSOLUTE_POSITIONING} from "../../../../view/CSS_ABSOLUTE_POSITIONING.js";
|
|
3
|
+
|
|
4
|
+
export function buildReadOnlyDisplay() {
|
|
5
|
+
return new LabelView("Read Only Mode", {
|
|
6
|
+
css: {
|
|
7
|
+
background: `rgb(34, 34, 34)`,
|
|
8
|
+
...CSS_ABSOLUTE_POSITIONING,
|
|
9
|
+
padding: '4px 25px',
|
|
10
|
+
color: 'red',
|
|
11
|
+
font: '12px Tahoma, monospaced'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
* @param {Vector2} size
|
|
6
6
|
* @param {AABB2} frame
|
|
7
7
|
* @param {Vector2} margin
|
|
8
|
+
* @param {ObservedBoolean} enableTangentAlignment
|
|
9
|
+
* @param cbFnCurveUpdate
|
|
10
|
+
* @param {Signal} funcTrigger
|
|
11
|
+
* @param {ActionProcessor} actionProcessor
|
|
12
|
+
* @param {keyframesContext} actionProcessorCTX
|
|
8
13
|
*/
|
|
9
|
-
export function build_tangent_editor({ ctx, keyframe, size, frame, margin }: CanvasRenderingContext2D): EmptyView;
|
|
14
|
+
export function build_tangent_editor({ ctx, keyframe, size, frame, margin, enableTangentAlignment, cbFnCurveUpdate, funcTrigger, actionProcessor, actionProcessorCTX }: CanvasRenderingContext2D): EmptyView;
|
|
10
15
|
import EmptyView from "../../../../view/elements/EmptyView.js";
|
|
11
16
|
//# sourceMappingURL=build_tangent_editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_tangent_editor.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/animation/curve/draw/build_tangent_editor.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build_tangent_editor.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/animation/curve/draw/build_tangent_editor.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;GAYG;AACH,wKAXW,wBAAwB,aA2NlC;sBA3RqB,wCAAwC"}
|