[Bf-blender-cvs] [8c09fa3be2] blender2.8: OpenGL immediate mode: added gpuRotate3f to GPU_matrix

Clément Foucault noreply at git.blender.org
Tue Feb 14 00:54:00 CET 2017


Commit: 8c09fa3be2ab7ddd70f904923e3ad91e0636528b
Author: Clément Foucault
Date:   Sun Feb 12 19:23:08 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB8c09fa3be2ab7ddd70f904923e3ad91e0636528b

OpenGL immediate mode: added gpuRotate3f to GPU_matrix

===================================================================

M	source/blender/gpu/GPU_matrix.h
M	source/blender/gpu/intern/gpu_matrix.c

===================================================================

diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h
index 43a03f8e4b..2bf52c954a 100644
--- a/source/blender/gpu/GPU_matrix.h
+++ b/source/blender/gpu/GPU_matrix.h
@@ -84,6 +84,7 @@ void gpuTranslate3f(float x, float y, float z);
 void gpuTranslate3fv(const float vec[3]);
 void gpuScale3f(float x, float y, float z);
 void gpuScale3fv(const float vec[3]);
+void gpuRotate3f(float deg, float x, float y, float z); /* axis of rotation should be a unit vector */
 void gpuRotate3fv(float deg, const float axis[3]); /* axis of rotation should be a unit vector */
 void gpuRotateAxis(float deg, char axis); /* TODO: enum for axis? */
 
diff --git a/source/blender/gpu/intern/gpu_matrix.c b/source/blender/gpu/intern/gpu_matrix.c
index 855ccaa499..2a77db6625 100644
--- a/source/blender/gpu/intern/gpu_matrix.c
+++ b/source/blender/gpu/intern/gpu_matrix.c
@@ -294,6 +294,12 @@ void gpuMultMatrix2D(const float m[3][3])
 	state.dirty = true;
 }
 
+void gpuRotate3f(float deg, float x, float y, float z)
+{
+	const float axis[3] = {x, y, z};
+	gpuRotate3fv(deg, axis);
+}
+
 void gpuRotate3fv(float deg, const float axis[3])
 {
 	Mat4 m;




More information about the Bf-blender-cvs mailing list