/
RecordFlyCameraControllerService.re
executable file
·77 lines (75 loc) · 3.13 KB
/
RecordFlyCameraControllerService.re
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
open StateDataMainType;
let create = () => {
index: 0,
pointDragStartEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
pointDragDropEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
pointDragOverEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
pointScaleEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
keyupEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
keydownEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
moveSpeedMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
wheelSpeedMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
rotateSpeedMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
eulerAngleDiffMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
translationDiffMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
directionArrayMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
gameObjectMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
disposedIndexArray: WonderCommonlib.ArrayService.createEmpty(),
};
let deepCopyForRestore =
(
{
index,
pointDragStartEventHandleFuncListMap,
pointDragDropEventHandleFuncListMap,
pointDragOverEventHandleFuncListMap,
pointScaleEventHandleFuncListMap,
keyupEventHandleFuncListMap,
keydownEventHandleFuncListMap,
moveSpeedMap,
wheelSpeedMap,
rotateSpeedMap,
eulerAngleDiffMap,
translationDiffMap,
gameObjectMap,
disposedIndexArray,
directionArrayMap,
}: flyCameraControllerRecord,
) => {
index,
pointDragStartEventHandleFuncListMap:
pointDragStartEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
pointDragDropEventHandleFuncListMap:
pointDragDropEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
pointDragOverEventHandleFuncListMap:
pointDragOverEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
pointScaleEventHandleFuncListMap:
pointScaleEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
keydownEventHandleFuncListMap:
keydownEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
keyupEventHandleFuncListMap:
keyupEventHandleFuncListMap |> WonderCommonlib.MutableSparseMapService.copy,
moveSpeedMap: moveSpeedMap |> WonderCommonlib.MutableSparseMapService.copy,
wheelSpeedMap: wheelSpeedMap |> WonderCommonlib.MutableSparseMapService.copy,
rotateSpeedMap:
rotateSpeedMap |> WonderCommonlib.MutableSparseMapService.copy,
eulerAngleDiffMap:
eulerAngleDiffMap |> WonderCommonlib.MutableSparseMapService.copy,
translationDiffMap:
translationDiffMap |> WonderCommonlib.MutableSparseMapService.copy,
directionArrayMap:
directionArrayMap |> WonderCommonlib.MutableSparseMapService.copy,
gameObjectMap: gameObjectMap |> WonderCommonlib.MutableSparseMapService.copy,
disposedIndexArray: disposedIndexArray |> Js.Array.copy,
};