(
name,
rotation = { x: 0, y: 0, z: 0 },
dampener = 1,
lerpAmount = 0.3
)
| 75 | |
| 76 | // Animate Rotation Helper function |
| 77 | const rigRotation = ( |
| 78 | name, |
| 79 | rotation = { x: 0, y: 0, z: 0 }, |
| 80 | dampener = 1, |
| 81 | lerpAmount = 0.3 |
| 82 | ) => { |
| 83 | if (!currentVrm) {return} |
| 84 | const Part = currentVrm.humanoid.getBoneNode( |
| 85 | THREE.VRMSchema.HumanoidBoneName[name] |
| 86 | ); |
| 87 | if (!Part) {return} |
| 88 | |
| 89 | let euler = new THREE.Euler( |
| 90 | rotation.x * dampener, |
| 91 | rotation.y * dampener, |
| 92 | rotation.z * dampener |
| 93 | ); |
| 94 | let quaternion = new THREE.Quaternion().setFromEuler(euler); |
| 95 | Part.quaternion.slerp(quaternion, lerpAmount); // interpolate |
| 96 | }; |
| 97 | |
| 98 | // Animate Position Helper Function |
| 99 | const rigPosition = ( |
no outgoing calls
no test coverage detected