shop-components 0.4.24 → 0.4.25
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/dev/src/amr.d.ts +16 -0
- package/dist/dev/src/controls/FreeTransformControls.d.ts +165 -0
- package/dist/dev/src/ik/CCDIKSolver.d.ts +109 -0
- package/dist/dev/src/ik/amr-ik.d.ts +72 -0
- package/dist/dev/src/mechanism/mechanism.d.ts +1 -0
- package/dist/dev/src/slot.d.ts +1 -0
- package/dist/shop-components.cjs +113 -113
- package/dist/shop-components.mjs +5267 -4149
- package/package.json +1 -1
package/dist/dev/src/amr.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { AMRAssembly } from './assembly';
|
|
|
7
7
|
import EventEmitter from 'eventemitter3';
|
|
8
8
|
import { GoodsBox } from './goods-box';
|
|
9
9
|
import { Logo } from './logo';
|
|
10
|
+
import { AmrIKController } from './ik/amr-ik';
|
|
10
11
|
export declare const textureLoader: TextureLoader;
|
|
11
12
|
export interface CropperConfigs {
|
|
12
13
|
canvasWidth: number;
|
|
@@ -53,6 +54,10 @@ export declare class Amr extends Object3D {
|
|
|
53
54
|
private _rollerBaffle;
|
|
54
55
|
private _liftBrackets;
|
|
55
56
|
private _rollerTop;
|
|
57
|
+
private _ikChains;
|
|
58
|
+
ikControllers: AmrIKController[];
|
|
59
|
+
private _ikDraggingControllers;
|
|
60
|
+
private _ikControllersTimer;
|
|
56
61
|
private _shelfSyncCache;
|
|
57
62
|
private _rollerPools;
|
|
58
63
|
private _videoCache;
|
|
@@ -114,6 +119,17 @@ export declare class Amr extends Object3D {
|
|
|
114
119
|
getShapeKeyTargets(key: string): Object3D<import("three").Object3DEventMap>[];
|
|
115
120
|
setShapeKey(key: string, value: number, useDebance?: boolean): void;
|
|
116
121
|
private _generateAmr;
|
|
122
|
+
private _syncIkDraggingState;
|
|
123
|
+
private _onIkDraggingChanged;
|
|
124
|
+
private _disposeIkControllers;
|
|
125
|
+
private _buildJointChain;
|
|
126
|
+
private _findIkChainByNode;
|
|
127
|
+
updateIkJointChainByTool(toolRoot: Object3D, action: 'install' | 'uninstall'): void;
|
|
128
|
+
private _buildIKChainParams;
|
|
129
|
+
private _fillInitialRotationValues;
|
|
130
|
+
private _axisFromLetter;
|
|
131
|
+
private _parseIkAxes;
|
|
132
|
+
private _parseIkOrientation;
|
|
117
133
|
setHeight(height: number): void;
|
|
118
134
|
setWeight(width: number): void;
|
|
119
135
|
setLength(length: number): void;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { EventDispatcher, Mesh, Object3D, Quaternion, Raycaster, Vector3 } from 'three';
|
|
2
|
+
type FreeMode = 'default' | 'translate' | 'rotate';
|
|
3
|
+
type FreeAxis = 'XYZ' | 'E' | null;
|
|
4
|
+
declare class FreeTransformControlsRoot extends Object3D {
|
|
5
|
+
controls: FreeTransformControls;
|
|
6
|
+
isTransformControlsRoot: boolean;
|
|
7
|
+
constructor(controls: FreeTransformControls);
|
|
8
|
+
updateMatrixWorld(force?: boolean): void;
|
|
9
|
+
dispose(): void;
|
|
10
|
+
}
|
|
11
|
+
declare class FreeTransformControlsGizmo extends Object3D {
|
|
12
|
+
controls: FreeTransformControls;
|
|
13
|
+
picker: Object3D<import("three").Object3DEventMap>;
|
|
14
|
+
gizmo: Object3D<import("three").Object3DEventMap>;
|
|
15
|
+
helper: Object3D<import("three").Object3DEventMap>;
|
|
16
|
+
private _matMove;
|
|
17
|
+
private _matRing;
|
|
18
|
+
private _matInvisible;
|
|
19
|
+
private _matHelper;
|
|
20
|
+
private _moveMesh;
|
|
21
|
+
private _ringMesh;
|
|
22
|
+
private _arcLine;
|
|
23
|
+
private _arcGeom;
|
|
24
|
+
private _arcSegments;
|
|
25
|
+
private _arcPositions;
|
|
26
|
+
private _arcStartAngleOffset;
|
|
27
|
+
private _moveColorDefault;
|
|
28
|
+
private _moveColorActive;
|
|
29
|
+
private _moveOpacityDefault;
|
|
30
|
+
private _moveOpacityRingActive;
|
|
31
|
+
private _ringColorDefault;
|
|
32
|
+
private _ringColorActive;
|
|
33
|
+
private _ringOpacityDefault;
|
|
34
|
+
private _ringOpacityActive;
|
|
35
|
+
private _ringScale;
|
|
36
|
+
private _ringTargetScale;
|
|
37
|
+
private _ringScaleTweening;
|
|
38
|
+
private _moveColorTween?;
|
|
39
|
+
private _ringColorTween?;
|
|
40
|
+
private _ringScaleTween?;
|
|
41
|
+
private _isMoveActive;
|
|
42
|
+
private _isRingActive;
|
|
43
|
+
private _isMoveHover;
|
|
44
|
+
private _isDragging;
|
|
45
|
+
private _startMarker;
|
|
46
|
+
private _endMarker;
|
|
47
|
+
private _deltaLine;
|
|
48
|
+
private _deltaGeom;
|
|
49
|
+
private static RING_RADIUS;
|
|
50
|
+
private static RING_TUBE;
|
|
51
|
+
private static PICKER_RING_TUBE;
|
|
52
|
+
private static MOVE_RADIUS;
|
|
53
|
+
private static PICKER_MOVE_RADIUS;
|
|
54
|
+
private _isExpanded;
|
|
55
|
+
get isExpanded(): boolean;
|
|
56
|
+
set isExpanded(value: boolean);
|
|
57
|
+
get isRingScaleTweening(): boolean;
|
|
58
|
+
constructor(controls: FreeTransformControls);
|
|
59
|
+
updateMatrixWorld(force?: boolean): void;
|
|
60
|
+
}
|
|
61
|
+
declare class FreeTransformControlsPlane extends Mesh {
|
|
62
|
+
isTransformControlsPlane: boolean;
|
|
63
|
+
constructor();
|
|
64
|
+
updateMatrixWorld(force?: boolean): void;
|
|
65
|
+
}
|
|
66
|
+
export declare class FreeTransformControls extends EventDispatcher<{
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
}> {
|
|
69
|
+
_root: FreeTransformControlsRoot;
|
|
70
|
+
_gizmo: FreeTransformControlsGizmo;
|
|
71
|
+
_plane: FreeTransformControlsPlane;
|
|
72
|
+
domElement: HTMLElement | null;
|
|
73
|
+
camera: any;
|
|
74
|
+
object: any;
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
axis: FreeAxis;
|
|
77
|
+
mode: FreeMode;
|
|
78
|
+
size: number;
|
|
79
|
+
dragging: boolean;
|
|
80
|
+
gizmoPriority: boolean;
|
|
81
|
+
worldPosition: Vector3;
|
|
82
|
+
worldPositionStart: Vector3;
|
|
83
|
+
worldQuaternion: Quaternion;
|
|
84
|
+
worldQuaternionStart: Quaternion;
|
|
85
|
+
cameraPosition: Vector3;
|
|
86
|
+
cameraQuaternion: Quaternion;
|
|
87
|
+
pointStart: Vector3;
|
|
88
|
+
pointEnd: Vector3;
|
|
89
|
+
rotationAxis: Vector3;
|
|
90
|
+
rotationAngle: number;
|
|
91
|
+
eye: Vector3;
|
|
92
|
+
_offset: Vector3;
|
|
93
|
+
_startNorm: Vector3;
|
|
94
|
+
_endNorm: Vector3;
|
|
95
|
+
_cameraScale: Vector3;
|
|
96
|
+
_parentPosition: Vector3;
|
|
97
|
+
_parentQuaternion: Quaternion;
|
|
98
|
+
_parentQuaternionInv: Quaternion;
|
|
99
|
+
_parentScale: Vector3;
|
|
100
|
+
_worldScaleStart: Vector3;
|
|
101
|
+
_worldQuaternionInv: Quaternion;
|
|
102
|
+
_worldScale: Vector3;
|
|
103
|
+
_positionStart: Vector3;
|
|
104
|
+
_quaternionStart: Quaternion;
|
|
105
|
+
_scaleStart: Vector3;
|
|
106
|
+
_getPointer: (event: PointerEvent) => {
|
|
107
|
+
x: number;
|
|
108
|
+
y: number;
|
|
109
|
+
button: number;
|
|
110
|
+
};
|
|
111
|
+
_onPointerDown: (event: PointerEvent) => void;
|
|
112
|
+
_onPointerHover: (event: PointerEvent) => void;
|
|
113
|
+
_onPointerMove: (event: PointerEvent) => void;
|
|
114
|
+
_onPointerUp: (event: PointerEvent) => void;
|
|
115
|
+
_onPointerDownCapture: (event: PointerEvent) => void;
|
|
116
|
+
_onPointerMoveCapture: (event: PointerEvent) => void;
|
|
117
|
+
_onPointerUpCapture: (event: PointerEvent) => void;
|
|
118
|
+
_onMouseMoveCapture: (event: MouseEvent) => void;
|
|
119
|
+
_capturePointerId: number | null;
|
|
120
|
+
_captureDocument: Document | null;
|
|
121
|
+
_hoverShieldActive: boolean;
|
|
122
|
+
constructor(camera: any, domElement?: HTMLElement | null);
|
|
123
|
+
connect(element: HTMLElement): void;
|
|
124
|
+
disconnect(): void;
|
|
125
|
+
getHelper(): FreeTransformControlsRoot;
|
|
126
|
+
dispose(): void;
|
|
127
|
+
attach(object: Object3D): this;
|
|
128
|
+
detach(): this;
|
|
129
|
+
getMode(): FreeMode;
|
|
130
|
+
setMode(mode: FreeMode): void;
|
|
131
|
+
setSize(size: number): void;
|
|
132
|
+
getRaycaster(): Raycaster;
|
|
133
|
+
private _handlePointerHover;
|
|
134
|
+
private _handlePointerDown;
|
|
135
|
+
private _handlePointerMove;
|
|
136
|
+
private _handlePointerUp;
|
|
137
|
+
private _setHoverShieldActive;
|
|
138
|
+
private _handlePointerDownCapture;
|
|
139
|
+
private _handlePointerMoveCapture;
|
|
140
|
+
private _handleMouseMoveCapture;
|
|
141
|
+
private _handlePointerUpCapture;
|
|
142
|
+
pointerHover(pointer: {
|
|
143
|
+
x: number;
|
|
144
|
+
y: number;
|
|
145
|
+
button: number;
|
|
146
|
+
} | null): void;
|
|
147
|
+
pointerDown(pointer: {
|
|
148
|
+
x: number;
|
|
149
|
+
y: number;
|
|
150
|
+
button: number;
|
|
151
|
+
} | null): void;
|
|
152
|
+
pointerMove(pointer: {
|
|
153
|
+
x: number;
|
|
154
|
+
y: number;
|
|
155
|
+
button: number;
|
|
156
|
+
} | null): void;
|
|
157
|
+
pointerUp(pointer: {
|
|
158
|
+
x: number;
|
|
159
|
+
y: number;
|
|
160
|
+
button: number;
|
|
161
|
+
} | null): void;
|
|
162
|
+
private _updateCursor;
|
|
163
|
+
private _isAxisAllowed;
|
|
164
|
+
}
|
|
165
|
+
export { FreeTransformControlsGizmo, FreeTransformControlsPlane };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Object3D, Vector3, Quaternion } from 'three';
|
|
2
|
+
export interface IKAxisConfig {
|
|
3
|
+
axis: Vector3;
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
value?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface IKLinkConfig {
|
|
9
|
+
object: Object3D;
|
|
10
|
+
ikTcp?: boolean;
|
|
11
|
+
weight?: number;
|
|
12
|
+
axes?: IKAxisConfig[];
|
|
13
|
+
}
|
|
14
|
+
interface JointState {
|
|
15
|
+
currentAngle: number;
|
|
16
|
+
prevAngle: number;
|
|
17
|
+
currentAngles?: number[];
|
|
18
|
+
prevAngles?: number[];
|
|
19
|
+
}
|
|
20
|
+
export interface IKContext {
|
|
21
|
+
iterations?: number;
|
|
22
|
+
minDistance?: number;
|
|
23
|
+
maxStep?: number;
|
|
24
|
+
damping?: number;
|
|
25
|
+
maxAngleDelta?: number;
|
|
26
|
+
orientation?: OrientationConstraintConfig;
|
|
27
|
+
weightProfile?: IKWeightProfile;
|
|
28
|
+
}
|
|
29
|
+
export interface IKWeightProfile {
|
|
30
|
+
root?: number;
|
|
31
|
+
middle?: number;
|
|
32
|
+
end?: number;
|
|
33
|
+
curve?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface OrientationConstraintConfig {
|
|
36
|
+
enabled?: boolean;
|
|
37
|
+
forwardAxis?: Vector3;
|
|
38
|
+
upAxis?: Vector3;
|
|
39
|
+
targetForwardAxis?: Vector3;
|
|
40
|
+
targetUpAxis?: Vector3;
|
|
41
|
+
forwardWeight?: number;
|
|
42
|
+
upWeight?: number;
|
|
43
|
+
minAngle?: number;
|
|
44
|
+
}
|
|
45
|
+
export declare class CCDIKSolver {
|
|
46
|
+
links: IKLinkConfig[];
|
|
47
|
+
target: Vector3;
|
|
48
|
+
targetQuaternion: Quaternion;
|
|
49
|
+
iterations: number;
|
|
50
|
+
minDistance: number;
|
|
51
|
+
maxStep: number;
|
|
52
|
+
damping: number;
|
|
53
|
+
maxAngleDelta: number;
|
|
54
|
+
orientation: OrientationConstraintConfig | undefined;
|
|
55
|
+
private _restQuaternions;
|
|
56
|
+
private _initialRestQuaternions;
|
|
57
|
+
private _axesLocal;
|
|
58
|
+
private _axisMins;
|
|
59
|
+
private _axisMaxs;
|
|
60
|
+
private _jointStates;
|
|
61
|
+
private _frameAppliedAbsDelta;
|
|
62
|
+
private _jointWeights;
|
|
63
|
+
private _stableFrameCount;
|
|
64
|
+
private _lastFramePosErrSq;
|
|
65
|
+
private _lastFrameOriErr;
|
|
66
|
+
private _tmpEffectorPos;
|
|
67
|
+
private _tmpTargetPos;
|
|
68
|
+
private _tmpLinkPos;
|
|
69
|
+
private _tmpAxisWorld;
|
|
70
|
+
private _tmpVToEff;
|
|
71
|
+
private _tmpVToTar;
|
|
72
|
+
private _tmpProjE;
|
|
73
|
+
private _tmpProjT;
|
|
74
|
+
private _tmpCross;
|
|
75
|
+
private _tmpEffWorldQ;
|
|
76
|
+
private _tmpTarWorldQ;
|
|
77
|
+
private _tmpDirCurP;
|
|
78
|
+
private _tmpDirTarP;
|
|
79
|
+
private _tmpDirCurS;
|
|
80
|
+
private _tmpDirTarS;
|
|
81
|
+
private _tmpAxisQ;
|
|
82
|
+
private _tmpParentWorldQ;
|
|
83
|
+
private _tmpLocalBeforeQ;
|
|
84
|
+
private _tmpWorldBeforeQ;
|
|
85
|
+
constructor(links: IKLinkConfig[], context?: IKContext);
|
|
86
|
+
private _buildJointWeights;
|
|
87
|
+
private _normalizeAxesForLink;
|
|
88
|
+
private _getAxisMinsForLink;
|
|
89
|
+
private _getAxisMaxsForLink;
|
|
90
|
+
private _applyLinkAngles;
|
|
91
|
+
private _getAxisWorld;
|
|
92
|
+
resetToInitialPose(): void;
|
|
93
|
+
get restQuaternions(): ReadonlyArray<Quaternion>;
|
|
94
|
+
private _isOrientationEnabled;
|
|
95
|
+
private _getEndIndices;
|
|
96
|
+
private _getOrientationDefaults;
|
|
97
|
+
private _orientationErrorAngle;
|
|
98
|
+
private _angleBetweenNormalized;
|
|
99
|
+
private _getOrientationChainStartIndex;
|
|
100
|
+
bindRestPose(): void;
|
|
101
|
+
updateJointStateFromCurrentPose(): void;
|
|
102
|
+
rebindRestPoseWithBase(restQuaternions: (Quaternion | undefined)[]): void;
|
|
103
|
+
private _updateLinkAnglesFromQuaternion;
|
|
104
|
+
get jointStates(): ReadonlyArray<JointState>;
|
|
105
|
+
private _clamp;
|
|
106
|
+
private _signedAngleAroundAxis;
|
|
107
|
+
update(): void;
|
|
108
|
+
}
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Object3D, Vector3, Camera } from 'three';
|
|
2
|
+
import { CCDIKSolver, IKContext, IKLinkConfig, OrientationConstraintConfig } from './CCDIKSolver';
|
|
3
|
+
import { FreeTransformControls } from '../controls/FreeTransformControls';
|
|
4
|
+
import EventEmitter from 'eventemitter3';
|
|
5
|
+
export type TransformControlMode = 'translate' | 'rotate';
|
|
6
|
+
export interface AmrIKConfig {
|
|
7
|
+
joints: IKLinkConfig[];
|
|
8
|
+
container: Object3D;
|
|
9
|
+
context?: IKContext;
|
|
10
|
+
resetHierarchy?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface GizmoContext {
|
|
13
|
+
camera: Camera;
|
|
14
|
+
domElement: HTMLElement;
|
|
15
|
+
}
|
|
16
|
+
export interface IKChainConfig {
|
|
17
|
+
name: string;
|
|
18
|
+
joints: IKLinkConfig[];
|
|
19
|
+
orientation?: OrientationConstraintConfig;
|
|
20
|
+
}
|
|
21
|
+
export declare class AmrIKController {
|
|
22
|
+
readonly isController = true;
|
|
23
|
+
solver: CCDIKSolver | undefined;
|
|
24
|
+
targetObject: Object3D;
|
|
25
|
+
transformControls: FreeTransformControls;
|
|
26
|
+
private _enabled;
|
|
27
|
+
private _effector;
|
|
28
|
+
private _container;
|
|
29
|
+
private _tmpQ;
|
|
30
|
+
private _tmpContainerQ;
|
|
31
|
+
private _tmpV;
|
|
32
|
+
private _context;
|
|
33
|
+
private _resetHierarchy;
|
|
34
|
+
private _defaultPoseQuats;
|
|
35
|
+
private _zeroPoseQuats;
|
|
36
|
+
private _emitter;
|
|
37
|
+
addListener: <T extends string | symbol>(event: T, fn: (...args: any[]) => void, context?: any) => EventEmitter<string | symbol, any>;
|
|
38
|
+
removeAllListeners: (event?: string | symbol | undefined) => EventEmitter<string | symbol, any>;
|
|
39
|
+
private _initialTargetPos;
|
|
40
|
+
private _initialTargetQuat;
|
|
41
|
+
get enabled(): boolean;
|
|
42
|
+
set enabled(v: boolean);
|
|
43
|
+
private _axesHelpers;
|
|
44
|
+
private _showAxes;
|
|
45
|
+
get showAxes(): boolean;
|
|
46
|
+
set showAxes(v: boolean);
|
|
47
|
+
constructor(config: AmrIKConfig, gizmoContext: GizmoContext);
|
|
48
|
+
private getEffectorLocalPos;
|
|
49
|
+
private getEffectorLocalQuat;
|
|
50
|
+
private setupHierarchy;
|
|
51
|
+
syncTargetToEffector(): void;
|
|
52
|
+
syncTargetToSolver(): void;
|
|
53
|
+
setControlMode(mode: TransformControlMode): void;
|
|
54
|
+
setOrientation(orientation: {
|
|
55
|
+
forwardAxis: Vector3;
|
|
56
|
+
upAxis: Vector3;
|
|
57
|
+
}): void;
|
|
58
|
+
updateJointChain(joints: IKLinkConfig[]): void;
|
|
59
|
+
update(): void;
|
|
60
|
+
toggleOrientation(enabled: boolean): void;
|
|
61
|
+
setSolverContext(context: {
|
|
62
|
+
iterations?: number;
|
|
63
|
+
damping?: number;
|
|
64
|
+
}): void;
|
|
65
|
+
reset(): void;
|
|
66
|
+
dispose(): void;
|
|
67
|
+
}
|
|
68
|
+
export interface CreateIkControllersOptions {
|
|
69
|
+
resetHierarchy?: boolean;
|
|
70
|
+
onDraggingChanged?: (controller: AmrIKController, value: boolean) => void;
|
|
71
|
+
}
|
|
72
|
+
export declare const createIkControllers: (chains: IKChainConfig[], container: Object3D, gizmoContext: GizmoContext, options?: CreateIkControllersOptions) => AmrIKController[];
|
package/dist/dev/src/slot.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export declare class Slot extends CSS2DObject {
|
|
|
63
63
|
mirrorTarget: Slot | undefined;
|
|
64
64
|
private _showSlot;
|
|
65
65
|
private _isMirror;
|
|
66
|
+
private _currentDeivceLoaded;
|
|
66
67
|
get isMirror(): boolean;
|
|
67
68
|
beforeInstall: ((info: DeviceInfo) => Promise<void>) | undefined;
|
|
68
69
|
constructor(props: SlotProps);
|