[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55388] trunk/blender/source/blender: Add capluse bounds drawing

Sergej Reich sergej.reich at googlemail.com
Mon Mar 18 21:32:31 CET 2013


Revision: 55388
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55388
Author:   sergof
Date:     2013-03-18 20:32:30 +0000 (Mon, 18 Mar 2013)
Log Message:
-----------
Add capluse bounds drawing

Patch [#34566] by Alain Ducharme (phymec).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/makesrna/intern/rna_object.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2013-03-18 20:32:28 UTC (rev 55387)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2013-03-18 20:32:30 UTC (rev 55388)
@@ -5903,6 +5903,15 @@
 		glScalef(radius, radius, 2.0f * size[2]);
 		gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1);
 	}
+	else if (type == OB_BOUND_CAPSULE) {
+		float radius = size[0] > size[1] ? size[0] : size[1];
+		float length = size[2] > radius ? 2.0f * (size[2] - radius) : 0.0f;
+		glTranslatef(cent[0], cent[1], cent[2] - length * 0.5f);
+		gluCylinder(qobj, radius, radius, length, 8, 1);
+		gluSphere(qobj, radius, 8, 4);
+		glTranslatef(0.0, 0.0, length);
+		gluSphere(qobj, radius, 8, 4);
+	}
 	glPopMatrix();
 	
 	gluDeleteQuadric(qobj);

Modified: trunk/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object.c	2013-03-18 20:32:28 UTC (rev 55387)
+++ trunk/blender/source/blender/makesrna/intern/rna_object.c	2013-03-18 20:32:30 UTC (rev 55388)
@@ -2030,6 +2030,7 @@
 		{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"},
 		{OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"},
 		{OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"},
+		{OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", "Draw bounds as capsule"},
 		{0, NULL, 0, NULL, NULL}
 	};
 




More information about the Bf-blender-cvs mailing list