[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33543] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: fix [#25088] Add spot lamp causing crash
Campbell Barton
ideasman42 at gmail.com
Wed Dec 8 01:58:15 CET 2010
Revision: 33543
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33543
Author: campbellbarton
Date: 2010-12-08 01:58:15 +0100 (Wed, 08 Dec 2010)
Log Message:
-----------
fix [#25088] Add spot lamp causing crash
this is actually an assert not a crash, when the lamp and view axis were aligned, the quat could not correctly be converted into a matrix.
Now fallback to the X axis in this case.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_view3d/drawobject.c
Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c 2010-12-07 22:17:58 UTC (rev 33542)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c 2010-12-08 00:58:15 UTC (rev 33543)
@@ -789,7 +789,9 @@
cross_v3_v3v3(temp,vvec,lvec); /* equation for a plane through vvec en lvec */
cross_v3_v3v3(plane,lvec,temp); /* a plane perpendicular to this, parrallel with lvec */
- normalize_v3(plane);
+ /* vectors are exactly aligned, use the X axis, this is arbitrary */
+ if(normalize_v3(plane) == 0.0f)
+ plane[1]= 1.0f;
/* now we've got two equations: one of a cone and one of a plane, but we have
three unknowns. We remove one unkown by rotating the plane to z=0 (the plane normal) */
More information about the Bf-blender-cvs
mailing list