@pmndrs/viverse 0.2.19 → 0.2.20
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/model/index.d.ts +2 -1
- package/dist/model/index.js +4 -0
- package/package.json +1 -1
package/dist/model/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type VRMHumanBoneName } from '@pixiv/three-vrm';
|
|
1
2
|
import { AnimationAction, AnimationMixer, Object3D, Quaternion } from 'three';
|
|
2
3
|
import type { BoneMap } from '../utils.js';
|
|
3
|
-
import type { VRMHumanBoneName } from '@pixiv/three-vrm';
|
|
4
4
|
export { VRMHumanBoneName } from '@pixiv/three-vrm';
|
|
5
5
|
export * from './vrm.js';
|
|
6
6
|
export type CharacterModelOptions = {
|
|
@@ -33,3 +33,4 @@ export type CharacterModel = {
|
|
|
33
33
|
boneRotationOffset?: Quaternion;
|
|
34
34
|
};
|
|
35
35
|
export declare function loadCharacterModel(url?: string, type?: Exclude<CharacterModelOptions, boolean>['type'], boneRotationOffset?: Quaternion, castShadow?: boolean, receiveShadow?: boolean, boneMap?: BoneMap, useDraco?: boolean): Promise<CharacterModel>;
|
|
36
|
+
export declare function getBone(model: CharacterModel, name: VRMHumanBoneName): Object3D | undefined;
|
package/dist/model/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VRM } from '@pixiv/three-vrm';
|
|
1
2
|
import { AnimationMixer, Euler, Quaternion } from 'three';
|
|
2
3
|
import { loadGltfCharacterModel } from './gltf.js';
|
|
3
4
|
import { loadVrmCharacterModel } from './vrm.js';
|
|
@@ -61,3 +62,6 @@ export async function loadCharacterModel(url, type, boneRotationOffset, castShad
|
|
|
61
62
|
result.scene.add(restPose);
|
|
62
63
|
return Object.assign(result, { mixer: new AnimationMixer(result.scene), currentAnimations: new Map() });
|
|
63
64
|
}
|
|
65
|
+
export function getBone(model, name) {
|
|
66
|
+
return model instanceof VRM ? (model.humanoid.getRawBoneNode(name) ?? undefined) : model.scene.getObjectByName(name);
|
|
67
|
+
}
|