Skip to content

Commit 208cf13

Browse files
author
dhsu
committed
updated cgtmath
1 parent 99c90b9 commit 208cf13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pose.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extern crate cgt_math;
2-
use cgt_math::{Plane, Quaternion, Vector3, Axis};
2+
use cgt_math::{Plane, Quaternion, Vector3};
33

44
/// Calculates limb fk chain, hip, shoulder and face rotation.
55
/// May uses hip center as pivot.
@@ -57,9 +57,9 @@ fn torso_rotation(data: &[Vector3; 36], rotation_data: &mut [Quaternion; 36]) {
5757
fn shoulder_rotation(data: &[Vector3; 36], rotation_data: &mut [Quaternion; 36]) {
5858
// As the torso rotation usually is used to rotate the rig,
5959
// the torso rotation got to be substracted from the hip rotation
60-
let shoulder_rot = Quaternion::rotate_towards((data[12]-data[34]).normalize(), Axis::Z, Axis::Y);
60+
let shoulder_rot = Quaternion::rotate_towards((data[12]-data[34]).normalize(), Vector3::Z, Vector3::Y);
6161
// Quaternion::from_vec_to_track_quat((data[12] - data[34]).normalize().neg(), 2, 1); // rotation from center to right shoulder
62-
let hip_rot = Quaternion::rotate_towards((data[24] - data[33]).normalize(), Axis::Z, Axis::Y); // rotation from center to right hip
62+
let hip_rot = Quaternion::rotate_towards((data[24] - data[33]).normalize(), Vector3::Z, Vector3::Y); // rotation from center to right hip
6363
// let hip_rot = Quaternion::from_vec_to_track_quat((data[24] - data[33]).normalize().neg(), 2, 1); // rotation from center to right hip
6464
rotation_data[34] = shoulder_rot - hip_rot;
6565
}
@@ -69,7 +69,7 @@ fn calc_limb_chain_rotations(data: &[Vector3; 4]) -> [Quaternion; 3] {
6969
let mut arr: [Quaternion; 3] = [Quaternion::IDENTITY; 3];
7070
for i in 1..4 {
7171
arr[i - 1] =
72-
Quaternion::rotate_towards((data[i-1]-data[i]).normalize().neg(), Axis::X, Axis::Z);
72+
Quaternion::rotate_towards((data[i-1]-data[i]).normalize().neg(), Vector3::X, Vector3::Z);
7373
// Quaternion::from_vec_to_track_quat((data[i - 1] - data[i]).normalize().neg(), 4, 2);
7474
}
7575
return arr;

0 commit comments

Comments
 (0)