diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-09-11 16:05:09 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-09-11 16:05:09 +0400 |
commit | d5009eb1423c3c0359cbc85c7346412c597b8663 (patch) | |
tree | c56d97bdd477682c5dacbf42f500c4e3eec79fef /source/blender/blenkernel/intern/armature.c | |
parent | 40576677b1dff5373d5b673b599ea9beb094b1ea (diff) |
2.5 Rotations: As a experiment, enabling Axis-Angle for Bones
The support for this is really quite hacky, and I might disable this later if we cannot get some parts to work nicely.
Some notes:
* This is currently stored in the same variable that quaternions are stored in, since they both have 4 components. However, in RNA, I've added 2 properties specially for this.
* There are some shearing issues using certain axes - i.e. (1,1,0) - that will need to be checked on.
* Transform code is really quite temporary for this. Just a quick demo of what can be done...
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 95c4c2966c6..0c18817f8be 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1986,11 +1986,15 @@ void chan_calc_mat(bPoseChannel *chan) /* get scaling matrix */ SizeToMat3(chan->size, smat); - /* rotations may either be quats or eulers (no rotation modes for now...) */ + /* rotations may either be quats, eulers (with various rotation orders), or axis-angle */ if (chan->rotmode > 0) { - /* euler rotations (will cause gimble lock... no rotation order to solve that yet) */ + /* euler rotations (will cause gimble lock, but this can be alleviated a bit with rotation orders) */ EulOToMat3(chan->eul, chan->rotmode, rmat); } + else if (chan->rotmode == PCHAN_ROT_AXISANGLE) { + /* axis-angle - stored in quaternion data, but not really that great for 3D-changing orientations */ + VecRotToMat3(&chan->quat[1], chan->quat[0], rmat); + } else { /* quats are normalised before use to eliminate scaling issues */ NormalQuat(chan->quat); |