diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-11-07 00:31:14 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-11-07 00:31:14 +0300 |
commit | 0b027b40971a48efa7486568922f8ed9afc53d75 (patch) | |
tree | 993eb823de30ccb6af74e3391fb5e285686cd4ef /source/blender/editors/transform/transform_orientations.c | |
parent | 5c3a365ac49dda3caf17985abb66fd2299920fcd (diff) |
Make orientation matrix access function public.
Fix bug in previous code: passing 3x3 matrix to a function expecting a 4x4 (warnings are for something)
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 8b4023a3352..0cb2515828d 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -515,9 +515,6 @@ void initTransformOrientation(bContext *C, TransInfo *t) View3D *v3d = CTX_wm_view3d(C); Object *ob = CTX_data_active_object(C); Object *obedit = CTX_data_active_object(C); - float normal[3]={0.0, 0.0, 0.0}; - float plane[3]={0.0, 0.0, 0.0}; - switch(t->current_orientation) { case V3D_MANIP_GLOBAL: @@ -532,7 +529,7 @@ void initTransformOrientation(bContext *C, TransInfo *t) case V3D_MANIP_NORMAL: if(obedit || (ob && ob->mode & OB_MODE_POSE)) { strcpy(t->spacename, "normal"); - getTransformOrientationMatrix(C, t->spacemtx, (v3d->around == V3D_ACTIVE)); + ED_getTransformOrientationMatrix(C, t->spacemtx, (v3d->around == V3D_ACTIVE)); break; } /* no break we define 'normal' as 'local' in Object mode */ @@ -927,12 +924,11 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], return result; } -void getTransformOrientationMatrix(const bContext *C, float twmat[][4], int activeOnly) +void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[][3], int activeOnly) { float normal[3]={0.0, 0.0, 0.0}; float plane[3]={0.0, 0.0, 0.0}; - float mat[3][3]; int type; type = getTransformOrientation(C, normal, plane, activeOnly); @@ -940,25 +936,25 @@ void getTransformOrientationMatrix(const bContext *C, float twmat[][4], int acti switch (type) { case ORIENTATION_NORMAL: - if (createSpaceNormalTangent(mat, normal, plane) == 0) + if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_VERT: - if (createSpaceNormal(mat, normal) == 0) + if (createSpaceNormal(orientation_mat, normal) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_EDGE: - if (createSpaceNormalTangent(mat, normal, plane) == 0) + if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_FACE: - if (createSpaceNormalTangent(mat, normal, plane) == 0) + if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } @@ -967,10 +963,6 @@ void getTransformOrientationMatrix(const bContext *C, float twmat[][4], int acti if (type == ORIENTATION_NONE) { - Mat4One(twmat); - } - else - { - Mat4CpyMat3(twmat, mat); + Mat3One(orientation_mat); } } |