diff options
author | chai <chaifix@163.com> | 2020-07-11 00:29:49 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-07-11 00:29:49 +0800 |
commit | e849a07762a2feb3f124a08d50adeed52f085d5b (patch) | |
tree | 69207f80cf3372c6d5801d006966888f219e2a19 /src/extend/transform.c | |
parent | 44e6647ab365a9261c904be839e356c06a545907 (diff) |
*鍔爄nternal鍓嶇紑
Diffstat (limited to 'src/extend/transform.c')
-rw-r--r-- | src/extend/transform.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/extend/transform.c b/src/extend/transform.c index 6979e40..62776f7 100644 --- a/src/extend/transform.c +++ b/src/extend/transform.c @@ -6,11 +6,11 @@ void transform_getpositionandrotation(Transform* trans, Vec3* pos, Quat* rot) { Transform* cur = trans->parent; while (cur) { /*按照srt的顺序计算pos*/ - vec3_scale3(pos, &cur->localscale, pos); - quat_applytovec3(&cur->localrotation, pos, pos); - vec3_plus(pos, &cur->localposition, pos); + internal_vec3_scale3(pos, &cur->localscale, pos); + internal_quat_applytovec3(&cur->localrotation, pos, pos); + internal_vec3_plus(pos, &cur->localposition, pos); /*计算旋转*/ - quat_multiply(&cur->localrotation, rot, rot); + internal_quat_multiply(&cur->localrotation, rot, rot); cur = cur->parent; } @@ -19,18 +19,18 @@ void transform_getpositionandrotation(Transform* trans, Vec3* pos, Quat* rot) { void transform_getinvmatrixnoscale(Transform* trans, Mat4* worldToLocal) { Vec3 pos; Quat rot; transform_getpositionandrotation(trans, &pos, &rot); - quat_invert(&rot, &rot); + internal_quat_invert(&rot, &rot); /*(TR)^-1 = R^-1T^-1*/ - quat_tomat4(&rot, worldToLocal); - vec3_scale(&pos, -1, &pos); - mat4_translate(worldToLocal, &pos, worldToLocal); + internal_quat_tomat4(&rot, worldToLocal); + internal_vec3_scale(&pos, -1, &pos); + internal_mat4_translate(worldToLocal, &pos, worldToLocal); } void transform_getrotation(Transform* trans, Quat* rot) { *rot = trans->localrotation; Transform* cur = trans->parent; while (cur) { - quat_multiply(&cur->localrotation, rot, rot); + internal_quat_multiply(&cur->localrotation, rot, rot); } } |