@staix/agent-console 0.0.0-stage → 0.1.1
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/CHANGELOG.md +49 -0
- package/LICENSE +21 -0
- package/README.md +354 -2
- package/bin/acon.js +8 -0
- package/package.json +38 -4
- package/shell/asset-viewer.css +5 -0
- package/shell/asset-viewer.html +11 -0
- package/shell/asset-viewer.js +23 -0
- package/shell/icon.svg +1 -0
- package/shell/index.html +53 -0
- package/shell/shell.css +534 -0
- package/shell/shell.js +2214 -0
- package/shell/space-view.js +164 -0
- package/shell/space.js +241 -0
- package/shell/space3d.js +364 -0
- package/shell/static.js +111 -0
- package/shell/vendor/BufferGeometryUtils.js +1523 -0
- package/shell/vendor/GLTFLoader.js +5006 -0
- package/shell/vendor/NOTICE +30 -0
- package/shell/vendor/SkeletonUtils.js +496 -0
- package/shell/vendor/manifest.json +42 -0
- package/shell/vendor/mermaid/NOTICE +25 -0
- package/shell/vendor/mermaid/manifest.json +19 -0
- package/shell/vendor/mermaid/mermaid.js +3580 -0
- package/shell/vendor/three.core.js +61162 -0
- package/shell/vendor/three.module.js +19537 -0
- package/shell/visual-frame.css +5 -0
- package/shell/visual-frame.html +14 -0
- package/shell/visual-frame.js +54 -0
- package/src/assets.ts +200 -0
- package/src/canonical.ts +16 -0
- package/src/cli.ts +246 -0
- package/src/conformance.ts +299 -0
- package/src/contract.ts +276 -0
- package/src/install.ts +248 -0
- package/src/pets.ts +63 -0
- package/src/plugins.ts +357 -0
- package/src/serve.ts +184 -0
- package/src/server.ts +462 -0
- package/src/setup.ts +74 -0
- package/src/space.ts +106 -0
- package/src/static.ts +102 -0
- package/test/fixtures/review/cases.json +726 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Three.js 0.187.0
|
|
2
|
+
Source: https://www.npmjs.com/package/three/v/0.187.0
|
|
3
|
+
Vendored modules:
|
|
4
|
+
- examples/jsm/utils/BufferGeometryUtils.js
|
|
5
|
+
- examples/jsm/loaders/GLTFLoader.js
|
|
6
|
+
- examples/jsm/utils/SkeletonUtils.js
|
|
7
|
+
- build/three.core.js
|
|
8
|
+
- build/three.module.js
|
|
9
|
+
|
|
10
|
+
The MIT License
|
|
11
|
+
|
|
12
|
+
Copyright © 2010-2026 three.js authors
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in
|
|
22
|
+
all copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
30
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AnimationClip,
|
|
3
|
+
AnimationMixer,
|
|
4
|
+
Matrix4,
|
|
5
|
+
Quaternion,
|
|
6
|
+
QuaternionKeyframeTrack,
|
|
7
|
+
SkeletonHelper,
|
|
8
|
+
Vector3,
|
|
9
|
+
VectorKeyframeTrack
|
|
10
|
+
} from './three.module.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @module SkeletonUtils
|
|
14
|
+
* @three_import import * as SkeletonUtils from 'three/addons/utils/SkeletonUtils.js';
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function getBoneName( bone, options ) {
|
|
18
|
+
|
|
19
|
+
if ( options.getBoneName !== undefined ) {
|
|
20
|
+
|
|
21
|
+
return options.getBoneName( bone );
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return options.names[ bone.name ];
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retargets the skeleton from the given source to the target.
|
|
31
|
+
*
|
|
32
|
+
* Both `target` and `source` can be a 3D object with a skeleton property (e.g. a skinned mesh)
|
|
33
|
+
* or a {@link Skeleton} directly.
|
|
34
|
+
*
|
|
35
|
+
* @param {Object3D|Skeleton} target - The target object.
|
|
36
|
+
* @param {Object3D|Skeleton} source - The source object.
|
|
37
|
+
* @param {module:SkeletonUtils~RetargetOptions} options - The options.
|
|
38
|
+
*/
|
|
39
|
+
function retarget( target, source, options = {} ) {
|
|
40
|
+
|
|
41
|
+
const quat = new Quaternion(),
|
|
42
|
+
scale = new Vector3(),
|
|
43
|
+
relativeMatrix = new Matrix4(),
|
|
44
|
+
globalMatrix = new Matrix4();
|
|
45
|
+
|
|
46
|
+
options.preserveBoneMatrix = options.preserveBoneMatrix !== undefined ? options.preserveBoneMatrix : true;
|
|
47
|
+
options.preserveBonePositions = options.preserveBonePositions !== undefined ? options.preserveBonePositions : true;
|
|
48
|
+
options.useTargetMatrix = options.useTargetMatrix !== undefined ? options.useTargetMatrix : false;
|
|
49
|
+
options.hip = options.hip !== undefined ? options.hip : 'hip';
|
|
50
|
+
options.hipInfluence = options.hipInfluence !== undefined ? options.hipInfluence : new Vector3( 1, 1, 1 );
|
|
51
|
+
options.scale = options.scale !== undefined ? options.scale : 1;
|
|
52
|
+
options.names = options.names || {};
|
|
53
|
+
|
|
54
|
+
const sourceBones = source.isObject3D ? source.skeleton.bones : getBones( source ),
|
|
55
|
+
bones = target.isObject3D ? target.skeleton.bones : getBones( target );
|
|
56
|
+
|
|
57
|
+
let bone, name, boneTo,
|
|
58
|
+
bonesPosition;
|
|
59
|
+
|
|
60
|
+
// reset bones
|
|
61
|
+
|
|
62
|
+
if ( target.isObject3D ) {
|
|
63
|
+
|
|
64
|
+
target.skeleton.pose();
|
|
65
|
+
|
|
66
|
+
} else {
|
|
67
|
+
|
|
68
|
+
options.useTargetMatrix = true;
|
|
69
|
+
options.preserveBoneMatrix = false;
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if ( options.preserveBonePositions ) {
|
|
74
|
+
|
|
75
|
+
bonesPosition = [];
|
|
76
|
+
|
|
77
|
+
for ( let i = 0; i < bones.length; i ++ ) {
|
|
78
|
+
|
|
79
|
+
bonesPosition.push( bones[ i ].position.clone() );
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if ( options.preserveBoneMatrix ) {
|
|
86
|
+
|
|
87
|
+
// reset matrix
|
|
88
|
+
|
|
89
|
+
target.updateMatrixWorld();
|
|
90
|
+
|
|
91
|
+
target.matrixWorld.identity();
|
|
92
|
+
|
|
93
|
+
// reset children matrix
|
|
94
|
+
|
|
95
|
+
for ( let i = 0; i < target.children.length; ++ i ) {
|
|
96
|
+
|
|
97
|
+
target.children[ i ].updateMatrixWorld( true );
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
for ( let i = 0; i < bones.length; ++ i ) {
|
|
104
|
+
|
|
105
|
+
bone = bones[ i ];
|
|
106
|
+
name = getBoneName( bone, options );
|
|
107
|
+
|
|
108
|
+
boneTo = getBoneByName( name, sourceBones );
|
|
109
|
+
|
|
110
|
+
globalMatrix.copy( bone.matrixWorld );
|
|
111
|
+
|
|
112
|
+
if ( boneTo ) {
|
|
113
|
+
|
|
114
|
+
boneTo.updateMatrixWorld();
|
|
115
|
+
|
|
116
|
+
if ( options.useTargetMatrix ) {
|
|
117
|
+
|
|
118
|
+
relativeMatrix.copy( boneTo.matrixWorld );
|
|
119
|
+
|
|
120
|
+
} else {
|
|
121
|
+
|
|
122
|
+
relativeMatrix.copy( target.matrixWorld ).invert();
|
|
123
|
+
relativeMatrix.multiply( boneTo.matrixWorld );
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ignore scale to extract rotation
|
|
128
|
+
|
|
129
|
+
scale.setFromMatrixScale( relativeMatrix );
|
|
130
|
+
relativeMatrix.scale( scale.set( 1 / scale.x, 1 / scale.y, 1 / scale.z ) );
|
|
131
|
+
|
|
132
|
+
// apply to global matrix
|
|
133
|
+
|
|
134
|
+
globalMatrix.makeRotationFromQuaternion( quat.setFromRotationMatrix( relativeMatrix ) );
|
|
135
|
+
|
|
136
|
+
if ( target.isObject3D ) {
|
|
137
|
+
|
|
138
|
+
if ( options.localOffsets ) {
|
|
139
|
+
|
|
140
|
+
if ( options.localOffsets[ bone.name ] ) {
|
|
141
|
+
|
|
142
|
+
globalMatrix.multiply( options.localOffsets[ bone.name ] );
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
globalMatrix.copyPosition( relativeMatrix );
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if ( name === options.hip ) {
|
|
155
|
+
|
|
156
|
+
globalMatrix.elements[ 12 ] *= options.scale * options.hipInfluence.x;
|
|
157
|
+
globalMatrix.elements[ 13 ] *= options.scale * options.hipInfluence.y;
|
|
158
|
+
globalMatrix.elements[ 14 ] *= options.scale * options.hipInfluence.z;
|
|
159
|
+
|
|
160
|
+
if ( options.hipPosition !== undefined ) {
|
|
161
|
+
|
|
162
|
+
globalMatrix.elements[ 12 ] += options.hipPosition.x * options.scale;
|
|
163
|
+
globalMatrix.elements[ 13 ] += options.hipPosition.y * options.scale;
|
|
164
|
+
globalMatrix.elements[ 14 ] += options.hipPosition.z * options.scale;
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if ( bone.parent ) {
|
|
171
|
+
|
|
172
|
+
bone.matrix.copy( bone.parent.matrixWorld ).invert();
|
|
173
|
+
bone.matrix.multiply( globalMatrix );
|
|
174
|
+
|
|
175
|
+
} else {
|
|
176
|
+
|
|
177
|
+
bone.matrix.copy( globalMatrix );
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
bone.matrix.decompose( bone.position, bone.quaternion, bone.scale );
|
|
182
|
+
|
|
183
|
+
bone.updateMatrixWorld();
|
|
184
|
+
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if ( options.preserveBonePositions ) {
|
|
188
|
+
|
|
189
|
+
for ( let i = 0; i < bones.length; ++ i ) {
|
|
190
|
+
|
|
191
|
+
bone = bones[ i ];
|
|
192
|
+
name = getBoneName( bone, options ) || bone.name;
|
|
193
|
+
|
|
194
|
+
if ( name !== options.hip ) {
|
|
195
|
+
|
|
196
|
+
bone.position.copy( bonesPosition[ i ] );
|
|
197
|
+
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if ( options.preserveBoneMatrix ) {
|
|
205
|
+
|
|
206
|
+
// restore matrix
|
|
207
|
+
|
|
208
|
+
target.updateMatrixWorld( true );
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Retargets the animation clip of the source to the target 3D object.
|
|
216
|
+
*
|
|
217
|
+
* The `source` can be a 3D object with a skeleton property (e.g. a skinned mesh)
|
|
218
|
+
* or a {@link Skeleton} directly.
|
|
219
|
+
*
|
|
220
|
+
* @param {Object3D} target - The target 3D object. Must have a `skeleton` property.
|
|
221
|
+
* @param {Object3D|Skeleton} source - The source object.
|
|
222
|
+
* @param {AnimationClip} clip - The animation clip.
|
|
223
|
+
* @param {module:SkeletonUtils~RetargetOptions} options - The options.
|
|
224
|
+
* @return {AnimationClip} The retargeted animation clip.
|
|
225
|
+
*/
|
|
226
|
+
function retargetClip( target, source, clip, options = {} ) {
|
|
227
|
+
|
|
228
|
+
options.useFirstFramePosition = options.useFirstFramePosition !== undefined ? options.useFirstFramePosition : false;
|
|
229
|
+
|
|
230
|
+
// Calculate the fps from the source clip based on the track with the most frames, unless fps is already provided.
|
|
231
|
+
options.fps = options.fps !== undefined ? options.fps : ( Math.max( ...clip.tracks.map( track => track.times.length ) ) / clip.duration );
|
|
232
|
+
options.names = options.names || [];
|
|
233
|
+
|
|
234
|
+
if ( ! source.isObject3D ) {
|
|
235
|
+
|
|
236
|
+
source = getHelperFromSkeleton( source );
|
|
237
|
+
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const numFrames = Math.round( clip.duration * ( options.fps / 1000 ) * 1000 ),
|
|
241
|
+
delta = clip.duration / ( numFrames - 1 ),
|
|
242
|
+
convertedTracks = [],
|
|
243
|
+
mixer = new AnimationMixer( source ),
|
|
244
|
+
bones = getBones( target.skeleton ),
|
|
245
|
+
boneDatas = [];
|
|
246
|
+
|
|
247
|
+
let positionOffset,
|
|
248
|
+
bone, boneTo, boneData,
|
|
249
|
+
name;
|
|
250
|
+
|
|
251
|
+
mixer.clipAction( clip ).play();
|
|
252
|
+
|
|
253
|
+
// trim
|
|
254
|
+
|
|
255
|
+
let start = 0, end = numFrames;
|
|
256
|
+
|
|
257
|
+
if ( options.trim !== undefined ) {
|
|
258
|
+
|
|
259
|
+
start = Math.round( options.trim[ 0 ] * options.fps );
|
|
260
|
+
end = Math.min( Math.round( options.trim[ 1 ] * options.fps ), numFrames ) - start;
|
|
261
|
+
|
|
262
|
+
mixer.update( options.trim[ 0 ] );
|
|
263
|
+
|
|
264
|
+
} else {
|
|
265
|
+
|
|
266
|
+
mixer.update( 0 );
|
|
267
|
+
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
source.updateMatrixWorld();
|
|
271
|
+
|
|
272
|
+
//
|
|
273
|
+
|
|
274
|
+
for ( let frame = 0; frame < end; ++ frame ) {
|
|
275
|
+
|
|
276
|
+
const time = frame * delta;
|
|
277
|
+
|
|
278
|
+
retarget( target, source, options );
|
|
279
|
+
|
|
280
|
+
for ( let j = 0; j < bones.length; ++ j ) {
|
|
281
|
+
|
|
282
|
+
bone = bones[ j ];
|
|
283
|
+
name = getBoneName( bone, options ) || bone.name;
|
|
284
|
+
boneTo = getBoneByName( name, source.skeleton );
|
|
285
|
+
|
|
286
|
+
if ( boneTo ) {
|
|
287
|
+
|
|
288
|
+
boneData = boneDatas[ j ] = boneDatas[ j ] || { bone: bone };
|
|
289
|
+
|
|
290
|
+
if ( options.hip === name ) {
|
|
291
|
+
|
|
292
|
+
if ( ! boneData.pos ) {
|
|
293
|
+
|
|
294
|
+
boneData.pos = {
|
|
295
|
+
times: new Float32Array( end ),
|
|
296
|
+
values: new Float32Array( end * 3 )
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if ( options.useFirstFramePosition ) {
|
|
302
|
+
|
|
303
|
+
if ( frame === 0 ) {
|
|
304
|
+
|
|
305
|
+
positionOffset = bone.position.clone();
|
|
306
|
+
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
bone.position.sub( positionOffset );
|
|
310
|
+
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
boneData.pos.times[ frame ] = time;
|
|
314
|
+
|
|
315
|
+
bone.position.toArray( boneData.pos.values, frame * 3 );
|
|
316
|
+
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if ( ! boneData.quat ) {
|
|
320
|
+
|
|
321
|
+
boneData.quat = {
|
|
322
|
+
times: new Float32Array( end ),
|
|
323
|
+
values: new Float32Array( end * 4 )
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
boneData.quat.times[ frame ] = time;
|
|
329
|
+
|
|
330
|
+
bone.quaternion.toArray( boneData.quat.values, frame * 4 );
|
|
331
|
+
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if ( frame === end - 2 ) {
|
|
337
|
+
|
|
338
|
+
// last mixer update before final loop iteration
|
|
339
|
+
// make sure we do not go over or equal to clip duration
|
|
340
|
+
mixer.update( delta - 0.0000001 );
|
|
341
|
+
|
|
342
|
+
} else {
|
|
343
|
+
|
|
344
|
+
mixer.update( delta );
|
|
345
|
+
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
source.updateMatrixWorld();
|
|
349
|
+
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
for ( let i = 0; i < boneDatas.length; ++ i ) {
|
|
353
|
+
|
|
354
|
+
boneData = boneDatas[ i ];
|
|
355
|
+
|
|
356
|
+
if ( boneData ) {
|
|
357
|
+
|
|
358
|
+
if ( boneData.pos ) {
|
|
359
|
+
|
|
360
|
+
convertedTracks.push( new VectorKeyframeTrack(
|
|
361
|
+
'.bones[' + boneData.bone.name + '].position',
|
|
362
|
+
boneData.pos.times,
|
|
363
|
+
boneData.pos.values
|
|
364
|
+
) );
|
|
365
|
+
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
convertedTracks.push( new QuaternionKeyframeTrack(
|
|
369
|
+
'.bones[' + boneData.bone.name + '].quaternion',
|
|
370
|
+
boneData.quat.times,
|
|
371
|
+
boneData.quat.values
|
|
372
|
+
) );
|
|
373
|
+
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
mixer.uncacheAction( clip );
|
|
379
|
+
|
|
380
|
+
return new AnimationClip( clip.name, - 1, convertedTracks );
|
|
381
|
+
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Clones the given 3D object and its descendants, ensuring that any `SkinnedMesh` instances are
|
|
386
|
+
* correctly associated with their bones. Bones are also cloned, and must be descendants of the
|
|
387
|
+
* object passed to this method. Other data, like geometries and materials, are reused by reference.
|
|
388
|
+
*
|
|
389
|
+
* @param {Object3D} source - The 3D object to clone.
|
|
390
|
+
* @return {Object3D} The cloned 3D object.
|
|
391
|
+
*/
|
|
392
|
+
function clone( source ) {
|
|
393
|
+
|
|
394
|
+
const sourceLookup = new Map();
|
|
395
|
+
const cloneLookup = new Map();
|
|
396
|
+
|
|
397
|
+
const clone = source.clone();
|
|
398
|
+
|
|
399
|
+
parallelTraverse( source, clone, function ( sourceNode, clonedNode ) {
|
|
400
|
+
|
|
401
|
+
sourceLookup.set( clonedNode, sourceNode );
|
|
402
|
+
cloneLookup.set( sourceNode, clonedNode );
|
|
403
|
+
|
|
404
|
+
} );
|
|
405
|
+
|
|
406
|
+
clone.traverse( function ( node ) {
|
|
407
|
+
|
|
408
|
+
if ( ! node.isSkinnedMesh ) return;
|
|
409
|
+
|
|
410
|
+
const clonedMesh = node;
|
|
411
|
+
const sourceMesh = sourceLookup.get( node );
|
|
412
|
+
const sourceBones = sourceMesh.skeleton.bones;
|
|
413
|
+
|
|
414
|
+
clonedMesh.skeleton = sourceMesh.skeleton.clone();
|
|
415
|
+
clonedMesh.bindMatrix.copy( sourceMesh.bindMatrix );
|
|
416
|
+
|
|
417
|
+
clonedMesh.skeleton.bones = sourceBones.map( function ( bone ) {
|
|
418
|
+
|
|
419
|
+
return cloneLookup.get( bone );
|
|
420
|
+
|
|
421
|
+
} );
|
|
422
|
+
|
|
423
|
+
clonedMesh.bind( clonedMesh.skeleton, clonedMesh.bindMatrix );
|
|
424
|
+
|
|
425
|
+
} );
|
|
426
|
+
|
|
427
|
+
return clone;
|
|
428
|
+
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// internal helper
|
|
432
|
+
|
|
433
|
+
function getBoneByName( name, skeleton ) {
|
|
434
|
+
|
|
435
|
+
for ( let i = 0, bones = getBones( skeleton ); i < bones.length; i ++ ) {
|
|
436
|
+
|
|
437
|
+
if ( name === bones[ i ].name )
|
|
438
|
+
|
|
439
|
+
return bones[ i ];
|
|
440
|
+
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function getBones( skeleton ) {
|
|
446
|
+
|
|
447
|
+
return Array.isArray( skeleton ) ? skeleton : skeleton.bones;
|
|
448
|
+
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
function getHelperFromSkeleton( skeleton ) {
|
|
453
|
+
|
|
454
|
+
const source = new SkeletonHelper( skeleton.bones[ 0 ] );
|
|
455
|
+
source.skeleton = skeleton;
|
|
456
|
+
|
|
457
|
+
return source;
|
|
458
|
+
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function parallelTraverse( a, b, callback ) {
|
|
462
|
+
|
|
463
|
+
callback( a, b );
|
|
464
|
+
|
|
465
|
+
for ( let i = 0; i < a.children.length; i ++ ) {
|
|
466
|
+
|
|
467
|
+
parallelTraverse( a.children[ i ], b.children[ i ], callback );
|
|
468
|
+
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Retarget options of `SkeletonUtils`.
|
|
475
|
+
*
|
|
476
|
+
* @typedef {Object} module:SkeletonUtils~RetargetOptions
|
|
477
|
+
* @property {boolean} [useFirstFramePosition=false] - Whether to use the position of the first frame or not.
|
|
478
|
+
* @property {number} [fps] - The FPS of the clip.
|
|
479
|
+
* @property {Object<string,string>} [names] - A dictionary for mapping target to source bone names.
|
|
480
|
+
* @property {function(string):string} [getBoneName] - A function for mapping bone names. Alternative to `names`.
|
|
481
|
+
* @property {Array<number>} [trim] - Whether to trim the clip or not. If set the array should hold two values for the start and end.
|
|
482
|
+
* @property {boolean} [preserveBoneMatrix=true] - Whether to preserve bone matrices or not.
|
|
483
|
+
* @property {boolean} [preserveBonePositions=true] - Whether to preserve bone positions or not.
|
|
484
|
+
* @property {boolean} [useTargetMatrix=false] - Whether to use the target matrix or not.
|
|
485
|
+
* @property {string} [hip='hip'] - The name of the source's hip bone.
|
|
486
|
+
* @property {Vector3} [hipInfluence=(1,1,1)] - The hip influence.
|
|
487
|
+
* @property {number} [scale=1] - The scale.
|
|
488
|
+
* @property {Object<string,Matrix4>} [localOffsets] - Per-bone local offset matrices, keyed by bone name.
|
|
489
|
+
* @property {Vector3} [hipPosition] - An additional position offset applied to the hip bone.
|
|
490
|
+
**/
|
|
491
|
+
|
|
492
|
+
export {
|
|
493
|
+
retarget,
|
|
494
|
+
retargetClip,
|
|
495
|
+
clone,
|
|
496
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"name": "three",
|
|
4
|
+
"version": "0.187.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"entries": [
|
|
7
|
+
"three.module.js",
|
|
8
|
+
"GLTFLoader.js"
|
|
9
|
+
],
|
|
10
|
+
"files": {
|
|
11
|
+
"BufferGeometryUtils.js": {
|
|
12
|
+
"source": "examples/jsm/utils/BufferGeometryUtils.js",
|
|
13
|
+
"bytes": 39165,
|
|
14
|
+
"sha256": "319782169ed48af21fcaa251d839ecb8e58f14174aacbf68b74a437f3d6a3a98"
|
|
15
|
+
},
|
|
16
|
+
"GLTFLoader.js": {
|
|
17
|
+
"source": "examples/jsm/loaders/GLTFLoader.js",
|
|
18
|
+
"bytes": 119859,
|
|
19
|
+
"sha256": "7bbda9f3af9b5acbd89a33cfc0aeb020f34d2d31a72829c79c0b354f9502c8e5"
|
|
20
|
+
},
|
|
21
|
+
"SkeletonUtils.js": {
|
|
22
|
+
"source": "examples/jsm/utils/SkeletonUtils.js",
|
|
23
|
+
"bytes": 11547,
|
|
24
|
+
"sha256": "eedd768765d6553f8082953ab3882e2c86dacc2eb7d180a312d1d52e86bb35c5"
|
|
25
|
+
},
|
|
26
|
+
"three.core.js": {
|
|
27
|
+
"source": "build/three.core.js",
|
|
28
|
+
"bytes": 1474799,
|
|
29
|
+
"sha256": "613e370f76638fdef83926642bf256dc9615684922de1ce1f63a8583e5d78578"
|
|
30
|
+
},
|
|
31
|
+
"three.module.js": {
|
|
32
|
+
"source": "build/three.module.js",
|
|
33
|
+
"bytes": 658900,
|
|
34
|
+
"sha256": "104f56145899722094556490d787aae0617cc2fc3382f31df02d724ea1aee341"
|
|
35
|
+
},
|
|
36
|
+
"NOTICE": {
|
|
37
|
+
"source": "LICENSE",
|
|
38
|
+
"bytes": 1336,
|
|
39
|
+
"sha256": "c770e734cedbccb910baeba499630cc34ada04aecbefdc604e1a701a9dd4aa9a"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@mermaid-js/tiny 12.2.0 (Mermaid)
|
|
2
|
+
Source: https://www.npmjs.com/package/@mermaid-js/tiny/v/12.2.0
|
|
3
|
+
Vendored file: dist/mermaid.tiny.js as mermaid.js
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2014 - 2022 Knut Sveidqvist
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"name": "@mermaid-js/tiny",
|
|
4
|
+
"version": "12.2.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"entry": "mermaid.js",
|
|
7
|
+
"files": {
|
|
8
|
+
"mermaid.js": {
|
|
9
|
+
"source": "dist/mermaid.tiny.js",
|
|
10
|
+
"bytes": 2811424,
|
|
11
|
+
"sha256": "ea0cdf04eb31907eb20d956a34fe300095365c876887b54ffa29f1f847f56d00"
|
|
12
|
+
},
|
|
13
|
+
"NOTICE": {
|
|
14
|
+
"source": "LICENSE",
|
|
15
|
+
"bytes": 1238,
|
|
16
|
+
"sha256": "67bc269bfd16f2eca37e893dc270a6e1abff146909c2a98937f962b05812565a"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|