diff options
author | Joshua Leung <aligorith@gmail.com> | 2006-12-22 12:05:37 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2006-12-22 12:05:37 +0300 |
commit | fcd3ea7875d3a8bde7dc642b7c45d5ba806c94e2 (patch) | |
tree | e8bd81c202f5e98a0fdf77ac517776856d5ed207 /source/blender/blenlib | |
parent | e7d916b6e67dafc205c37f0df4eec82381e5e557 (diff) |
== Snap Bones To Location in PoseMode ==
Now the Snap To Location (Shift S) tools for bones in pose-mode
work correctly. Previously, only one of these tools was implemented,
but it only worked in some cases.
This fixes item #4874 in Todo Tracker. Was patch #5012.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_arithb.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 5453c87e35c..d11c04291b9 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -949,6 +949,7 @@ Normalise2( ); void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3]); +void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3]); void tubemap(float x, float y, float z, float *u, float *v); void spheremap(float x, float y, float z, float *u, float *v); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 102218d8b99..97d40fbb95b 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -3266,3 +3266,17 @@ void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3]) mat[3][1] = loc[1]; mat[3][2] = loc[2]; } + +/* make a 4x4 matrix out of 3 transform components */ +void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3]) +{ + float eul[3]; + + /* convert quaternion component to euler + * NOTE: not as good as using quat directly. Todo for later. + */ + QuatToEul(quat, eul); + + /* make into matrix using exisiting code */ + LocEulSizeToMat4(mat, loc, eul, size); +} |