@davi-ai/react-bodyengine-three 1.0.0

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.
@@ -0,0 +1,13 @@
1
+ import { CameraPositionData } from './types';
2
+ declare const visemeCodes: Map<number, string>;
3
+ declare const SPPASToIPA: Map<string, string>;
4
+ declare const IPAToViseme: Map<string, number>;
5
+ declare const presets: {
6
+ default: CameraPositionData;
7
+ head: CameraPositionData;
8
+ neck: CameraPositionData;
9
+ shoulders: CameraPositionData;
10
+ chest: CameraPositionData;
11
+ belly: CameraPositionData;
12
+ };
13
+ export { visemeCodes, SPPASToIPA, IPAToViseme, presets };
@@ -0,0 +1,65 @@
1
+ declare enum Positions {
2
+ eye = "eye",
3
+ mouth = "mouth",
4
+ neck = "neck",
5
+ clavicle = "clavicle",
6
+ torso = "torso",
7
+ belly = "belly",
8
+ lowerbelly = "lowerbelly",
9
+ hips = "hips",
10
+ higherthigh = "higherthigh",
11
+ thigh = "thigh",
12
+ knee = "knee",
13
+ leg = "leg",
14
+ feet = "feet"
15
+ }
16
+ declare enum Rotations {
17
+ face = 1,
18
+ eighthleft = 2,
19
+ thirdleft = 3,
20
+ quarterleft = 4,
21
+ halfleft = 5,
22
+ eighthright = 6,
23
+ thirdright = 7,
24
+ quarterright = 8,
25
+ halfright = 9
26
+ }
27
+ declare enum Distances {
28
+ veryclose = 1,
29
+ closer = 2,
30
+ close = 3,
31
+ midclose = 4,
32
+ medium = 5,
33
+ midfar = 6,
34
+ far = 7,
35
+ farther = 8,
36
+ veryfar = 9
37
+ }
38
+ declare enum BodyMesh {
39
+ cc3 = "CC_Base_Body",
40
+ rpm = "Wolf3D_Body",
41
+ avatarsdk = "AvatarBody",
42
+ avaturn = "Body_Mesh"
43
+ }
44
+ declare enum Emotions {
45
+ Jay = "joy",
46
+ Anger = "anger",
47
+ Contempt = "contempt",
48
+ Disgust = "disgust",
49
+ Dislike = "dislike",
50
+ Distress = "distress",
51
+ Fear = "fear",
52
+ Frustration = "frustration",
53
+ Guilt = "guilt",
54
+ Hope = "hope",
55
+ Love = "love",
56
+ Pride = "pride",
57
+ Regret = "regret",
58
+ Relief = "relief",
59
+ Sadness = "sadness",
60
+ Shame = "shame",
61
+ Smile = "smile",
62
+ Surprise = "surprise",
63
+ Neutral = "neutral"
64
+ }
65
+ export { Positions, Rotations, Distances, BodyMesh, Emotions };
@@ -0,0 +1,72 @@
1
+ import { Vector3 } from 'three';
2
+ import { CreationTool, AnimationWeight } from '../../node_modules/@davi-ai/bodyengine-three/dist';
3
+ import { Positions, Rotations, Distances, Emotions } from './enums';
4
+ interface SpeechSynthesisCredentials {
5
+ region?: string;
6
+ subscriptionKey?: string;
7
+ token?: string;
8
+ }
9
+ interface SpeechSynthesisOptions {
10
+ speechSynthesis?: {
11
+ credentials?: SpeechSynthesisCredentials;
12
+ voice?: SpeechSynthesisVoice;
13
+ };
14
+ }
15
+ interface CharacterProps extends SpeechSynthesisOptions {
16
+ url: string;
17
+ type: CreationTool;
18
+ animationsUrl?: string | Array<string>;
19
+ gender?: "male" | "female";
20
+ onLoadingCompleted?: () => void;
21
+ camera?: CameraPositionData;
22
+ autoLookAt?: boolean;
23
+ breathing?: boolean;
24
+ disableAnimations?: boolean;
25
+ debug?: boolean;
26
+ enableBml?: boolean;
27
+ animationWeights?: AnimationWeight;
28
+ license?: string;
29
+ detectGpuData?: any;
30
+ }
31
+ interface Position2D {
32
+ x: number;
33
+ y: number;
34
+ }
35
+ interface DefaultPositions {
36
+ eye: Vector3;
37
+ mouth: Vector3;
38
+ neck: Vector3;
39
+ clavicle: Vector3;
40
+ torso: Vector3;
41
+ belly: Vector3;
42
+ lowerbelly: Vector3;
43
+ hips: Vector3;
44
+ higherthigh: Vector3;
45
+ thigh: Vector3;
46
+ knee: Vector3;
47
+ leg: Vector3;
48
+ feet: Vector3;
49
+ }
50
+ interface DefaultDistances {
51
+ veryclose: number;
52
+ closer: number;
53
+ close: number;
54
+ midclose: number;
55
+ medium: number;
56
+ midfar: number;
57
+ far: number;
58
+ farther: number;
59
+ veryfar: number;
60
+ }
61
+ interface CameraPositionData {
62
+ position?: Positions;
63
+ rotation?: Rotations;
64
+ distance?: Distances;
65
+ lookAt?: Positions;
66
+ movable?: boolean;
67
+ }
68
+ interface EmotionData {
69
+ emotion: Emotions;
70
+ value: number;
71
+ }
72
+ export type { CharacterProps, SpeechSynthesisCredentials, Position2D, DefaultPositions, DefaultDistances, CameraPositionData, EmotionData };
@@ -0,0 +1,3 @@
1
+ import { CameraPositionData, DefaultDistances, DefaultPositions } from '../models/types';
2
+ import * as THREE from "three";
3
+ export declare const getCameraPositionVector: (data: CameraPositionData, defaultDistances: DefaultDistances, defaultPositions: DefaultPositions) => THREE.Vector3;
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@davi-ai/react-bodyengine-three",
3
+ "version": "1.0.0",
4
+ "description": "Reactjs layer to use animations in a threejs environment",
5
+ "author": "DAVI",
6
+ "licence": "MIT",
7
+ "repository": "none",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "type": "module",
12
+ "main": "dist/index.js",
13
+ "types": "dist/index.d.ts",
14
+ "source": "src/index.ts",
15
+ "targets": {
16
+ "default": {
17
+ "outputFormat": "esmodule"
18
+ }
19
+ },
20
+ "scripts": {
21
+ "start": "vite build --watch",
22
+ "build": "vite build",
23
+ "storybook": "storybook dev -p 6006",
24
+ "build-storybook": "storybook build"
25
+ },
26
+ "dependencies": {
27
+ "@davi-ai/bodyengine-three": "0.0.3",
28
+ "@davi-ai/web-speech-cognitive-services-davi": "2.0.9",
29
+ "@react-three/drei": "9.112.0",
30
+ "@react-three/fiber": "8.17.9",
31
+ "@react-three/postprocessing": "2.16.3",
32
+ "@types/three": "0.174.0",
33
+ "react": "18.3.1",
34
+ "react-dom": "18.3.1",
35
+ "three": "0.174.0",
36
+ "zustand": "^5.0.3"
37
+ },
38
+ "devDependencies": {
39
+ "@babel/preset-env": "^7.23.3",
40
+ "@babel/preset-react": "^7.23.3",
41
+ "@babel/preset-typescript": "^7.23.3",
42
+ "@parcel/packager-ts": "^2.10.3",
43
+ "@parcel/transformer-typescript-types": "^2.10.3",
44
+ "@types/node": "^20.10.0",
45
+ "@types/react": "^18.2.38",
46
+ "@types/react-dom": "^18.2.17",
47
+ "ajv": "^8.17.1",
48
+ "typescript": "^5.3.2",
49
+ "vite": "^5.4.8",
50
+ "vite-plugin-dts": "^4.2.3"
51
+ }
52
+ }