From 37a0863cc7ce723922c67feb9cca30cdb5d2a637 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Sat, 4 Apr 2026 13:43:20 +0200 Subject: [PATCH] SkeletonUtils: Improve JSDoc. --- examples/jsm/utils/SkeletonUtils.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/examples/jsm/utils/SkeletonUtils.js b/examples/jsm/utils/SkeletonUtils.js index e208c742286294..836c2e2bf2be3c 100644 --- a/examples/jsm/utils/SkeletonUtils.js +++ b/examples/jsm/utils/SkeletonUtils.js @@ -27,11 +27,13 @@ function getBoneName( bone, options ) { } /** - * Retargets the skeleton from the given source 3D object to the - * target 3D object. + * Retargets the skeleton from the given source to the target. * - * @param {Object3D} target - The target 3D object. - * @param {Object3D} source - The source 3D object. + * Both `target` and `source` can be a 3D object with a skeleton property (e.g. a skinned mesh) + * or a {@link Skeleton} directly. + * + * @param {Object3D|Skeleton} target - The target object. + * @param {Object3D|Skeleton} source - The source object. * @param {module:SkeletonUtils~RetargetOptions} options - The options. */ function retarget( target, source, options = {} ) { @@ -210,11 +212,13 @@ function retarget( target, source, options = {} ) { } /** - * Retargets the animation clip of the source object to the - * target 3D object. + * Retargets the animation clip of the source to the target 3D object. + * + * The `source` can be a 3D object with a skeleton property (e.g. a skinned mesh) + * or a {@link Skeleton} directly. * - * @param {Object3D} target - The target 3D object. - * @param {Object3D} source - The source 3D object. + * @param {Object3D} target - The target 3D object. Must have a `skeleton` property. + * @param {Object3D|Skeleton} source - The source object. * @param {AnimationClip} clip - The animation clip. * @param {module:SkeletonUtils~RetargetOptions} options - The options. * @return {AnimationClip} The retargeted animation clip. @@ -481,6 +485,8 @@ function parallelTraverse( a, b, callback ) { * @property {string} [hip='hip'] - The name of the source's hip bone. * @property {Vector3} [hipInfluence=(1,1,1)] - The hip influence. * @property {number} [scale=1] - The scale. + * @property {Object} [localOffsets] - Per-bone local offset matrices, keyed by bone name. + * @property {Vector3} [hipPosition] - An additional position offset applied to the hip bone. **/ export {