Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTom Musgrove <LetterRip@gmail.com>2006-10-01 20:49:41 +0400
committerTom Musgrove <LetterRip@gmail.com>2006-10-01 20:49:41 +0400
commita88807b6dd3d67c3706bf69a9811b30702bb531a (patch)
tree43fcc2fd162540cb89a8adf901b945c79643f56a /source
parent7e469efd43fa38113c09c1eb9f0d7a0301b1b73f (diff)
==Mat4ToEul==
a utility function to convert 4x4 matrices to a euler rotation, contributed by Joshua Lueng (aligorith)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/BLI_arithb.h6
-rw-r--r--source/blender/blenlib/intern/arithb.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h
index 1fab2c68458..bb2c7f0ec83 100644
--- a/source/blender/blenlib/BLI_arithb.h
+++ b/source/blender/blenlib/BLI_arithb.h
@@ -155,6 +155,12 @@ Mat3ToEul(
float *eul
);
+ void
+Mat4ToEul(
+ float tmat[][4],
+ float *eul
+);
+
void compatible_eul(float *eul, float *oldrot);
void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot);
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index 3f687a9f780..40cf72f4242 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -2215,6 +2215,15 @@ void Mat3ToEul(float tmat[][3], float *eul)
}
}
+void Mat4ToEul(float tmat[][4], float *eul)
+{
+ float tempMat[3][3];
+
+ Mat3CpyMat4 (tempMat, tmat);
+ Mat3Ortho(tempMat);
+ Mat3ToEul(tempMat, eul);
+}
+
void QuatToEul( float *quat, float *eul)
{
float mat[3][3];