| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * $Id$ | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * ***** BEGIN GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  |  * as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  |  * of the License, or (at your option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software Foundation, | 
					
						
							|  |  |  |  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is: all of this file. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Contributor(s): none yet. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <math.h>			/* fabs */
 | 
					
						
							|  |  |  | #include <stdio.h>			/* for sprintf		*/
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "BKE_global.h"		/* for G			*/
 | 
					
						
							|  |  |  | #include "BKE_utildefines.h"	/* ABS */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "WM_types.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "transform.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* ************************** Functions *************************** */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* ************************** NUMINPUT **************************** */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void initNumInput(NumInput *n) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	n->flag		= | 
					
						
							|  |  |  | 	n->idx		= | 
					
						
							|  |  |  | 	n->idx_max	= | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 	n->inv[0]   = | 
					
						
							|  |  |  | 	n->inv[1]   = | 
					
						
							|  |  |  | 	n->inv[2]   = | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 	n->ctrl[0]	=  | 
					
						
							|  |  |  | 	n->ctrl[1]	=  | 
					
						
							|  |  |  | 	n->ctrl[2]	= 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	n->val[0]		=  | 
					
						
							|  |  |  | 	n->val[1]	=  | 
					
						
							|  |  |  | 	n->val[2]	= 0.0f; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void outputNumInput(NumInput *n, char *str) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	char cur; | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 	char inv[] = "1/"; | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 	short i, j; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for (j=0; j<=n->idx_max; j++) { | 
					
						
							|  |  |  | 		/* if AFFECTALL and no number typed and cursor not on number, use first number */ | 
					
						
							|  |  |  | 		if (n->flag & NUM_AFFECT_ALL && n->idx != j && n->ctrl[j] == 0) | 
					
						
							|  |  |  | 			i = 0; | 
					
						
							|  |  |  | 		else | 
					
						
							|  |  |  | 			i = j; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (n->idx != i) | 
					
						
							|  |  |  | 			cur = ' '; | 
					
						
							|  |  |  | 		else | 
					
						
							|  |  |  | 			cur = '|'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 		if (n->inv[i]) | 
					
						
							|  |  |  | 			inv[0] = '1'; | 
					
						
							|  |  |  | 		else | 
					
						
							|  |  |  | 			inv[0] = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 		if( n->val[i] > 1e10 || n->val[i] < -1e10 ) | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 			sprintf(&str[j*20], "%s%.4e%c", inv, n->val[i], cur); | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 		else | 
					
						
							|  |  |  | 			switch (n->ctrl[i]) { | 
					
						
							|  |  |  | 			case 0: | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 				sprintf(&str[j*20], "%sNONE%c", inv, cur); | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case 1: | 
					
						
							|  |  |  | 			case -1: | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 				sprintf(&str[j*20], "%s%.0f%c", inv, n->val[i], cur); | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case 10: | 
					
						
							|  |  |  | 			case -10: | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 				sprintf(&str[j*20], "%s%.f.%c", inv, n->val[i], cur); | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case 100: | 
					
						
							|  |  |  | 			case -100: | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 				sprintf(&str[j*20], "%s%.1f%c", inv, n->val[i], cur); | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case 1000: | 
					
						
							|  |  |  | 			case -1000: | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 				sprintf(&str[j*20], "%s%.2f%c", inv, n->val[i], cur); | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			case 10000: | 
					
						
							|  |  |  | 			case -10000: | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 				sprintf(&str[j*20], "%s%.3f%c", inv, n->val[i], cur); | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 			default: | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 				sprintf(&str[j*20], "%s%.4e%c", inv, n->val[i], cur); | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | short hasNumInput(NumInput *n) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	short i; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for (i=0; i<=n->idx_max; i++) { | 
					
						
							|  |  |  | 		if (n->ctrl[i]) | 
					
						
							|  |  |  | 			return 1; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void applyNumInput(NumInput *n, float *vec) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	short i, j; | 
					
						
							|  |  |  | 	float val[3]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (hasNumInput(n)) { | 
					
						
							|  |  |  | 		for (j=0; j<=n->idx_max; j++) { | 
					
						
							|  |  |  | 			/* if AFFECTALL and no number typed and cursor not on number, use first number */ | 
					
						
							|  |  |  | 			if (n->flag & NUM_AFFECT_ALL && n->idx != j && n->ctrl[j] == 0) | 
					
						
							|  |  |  | 				i = 0; | 
					
						
							|  |  |  | 			else | 
					
						
							|  |  |  | 				i = j; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			if (n->ctrl[i] == 0 && n->flag & NUM_NULL_ONE) { | 
					
						
							|  |  |  | 				vec[j] = 1.0f; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			else if (val[i] == 0.0f && n->flag & NUM_NO_ZERO) { | 
					
						
							|  |  |  | 				vec[j] = 0.0001f; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			else { | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 				if (n->inv[i]) | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					vec[j] = 1.0f / val[i]; | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				else | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					vec[j] = val[i]; | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | char handleNumInput(NumInput *n, wmEvent *event) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	float Val = 0; | 
					
						
							|  |  |  | 	short idx = n->idx, idx_max = n->idx_max; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	switch (event->type) { | 
					
						
							|  |  |  | 	case BACKSPACEKEY: | 
					
						
							|  |  |  | 		if (n->ctrl[idx] == 0) { | 
					
						
							|  |  |  | 			n->val[0]		=  | 
					
						
							|  |  |  | 				n->val[1]	=  | 
					
						
							|  |  |  | 				n->val[2]	= 0.0f; | 
					
						
							|  |  |  | 			n->ctrl[0]		=  | 
					
						
							|  |  |  | 				n->ctrl[1]	=  | 
					
						
							|  |  |  | 				n->ctrl[2]	= 0; | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 			n->inv[0]		=  | 
					
						
							|  |  |  | 				n->inv[1]	=  | 
					
						
							|  |  |  | 				n->inv[2]	= 0; | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		else { | 
					
						
							|  |  |  | 			n->val[idx] = 0.0f; | 
					
						
							|  |  |  | 			n->ctrl[idx] = 0; | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 			n->inv[idx] = 0; | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case PERIODKEY: | 
					
						
							|  |  |  | 	case PADPERIOD: | 
					
						
							|  |  |  | 		if (n->flag & NUM_NO_FRACTION) | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		switch (n->ctrl[idx]) | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 		case 0: | 
					
						
							|  |  |  | 		case 1: | 
					
						
							|  |  |  | 			n->ctrl[idx] = 10; | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 		case -1: | 
					
						
							|  |  |  | 			n->ctrl[idx] = -10; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case PADMINUS: | 
					
						
							|  |  |  | 		if(event->alt) | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 	case MINUSKEY: | 
					
						
							|  |  |  | 		if (n->flag & NUM_NO_NEGATIVE) | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (n->ctrl[idx]) { | 
					
						
							|  |  |  | 			n->ctrl[idx] *= -1; | 
					
						
							|  |  |  | 			n->val[idx] *= -1; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		else | 
					
						
							|  |  |  | 			n->ctrl[idx] = -1; | 
					
						
							| 
									
										
										
										
											2009-01-06 02:27:07 +00:00
										 |  |  | 		break; | 
					
						
							|  |  |  | 	case PADSLASHKEY: | 
					
						
							|  |  |  | 	case SLASHKEY: | 
					
						
							|  |  |  | 		n->inv[idx] = !n->inv[idx]; | 
					
						
							| 
									
										
										
											
												2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
											
										 
											2008-12-29 01:41:28 +00:00
										 |  |  | 		break; | 
					
						
							|  |  |  | 	case TABKEY: | 
					
						
							|  |  |  | 		idx++; | 
					
						
							|  |  |  | 		if (idx > idx_max) | 
					
						
							|  |  |  | 			idx = 0; | 
					
						
							|  |  |  | 		n->idx = idx; | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case PAD9: | 
					
						
							|  |  |  | 	case NINEKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD8: | 
					
						
							|  |  |  | 	case EIGHTKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD7: | 
					
						
							|  |  |  | 	case SEVENKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD6: | 
					
						
							|  |  |  | 	case SIXKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD5: | 
					
						
							|  |  |  | 	case FIVEKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD4: | 
					
						
							|  |  |  | 	case FOURKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD3: | 
					
						
							|  |  |  | 	case THREEKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD2: | 
					
						
							|  |  |  | 	case TWOKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD1: | 
					
						
							|  |  |  | 	case ONEKEY: | 
					
						
							|  |  |  | 		Val += 1.0f; | 
					
						
							|  |  |  | 	case PAD0: | 
					
						
							|  |  |  | 	case ZEROKEY: | 
					
						
							|  |  |  | 		if (!n->ctrl[idx]) | 
					
						
							|  |  |  | 			n->ctrl[idx] = 1; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (fabs(n->val[idx]) > 9999999.0f); | 
					
						
							|  |  |  | 		else if (n->ctrl[idx] == 1) { | 
					
						
							|  |  |  | 			n->val[idx] *= 10; | 
					
						
							|  |  |  | 			n->val[idx] += Val; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		else if (n->ctrl[idx] == -1) { | 
					
						
							|  |  |  | 			n->val[idx] *= 10; | 
					
						
							|  |  |  | 			n->val[idx] -= Val; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		else { | 
					
						
							|  |  |  | 			/* float resolution breaks when over six digits after comma */ | 
					
						
							|  |  |  | 			if( ABS(n->ctrl[idx]) < 10000000) { | 
					
						
							|  |  |  | 				n->val[idx] += Val / (float)n->ctrl[idx]; | 
					
						
							|  |  |  | 				n->ctrl[idx] *= 10; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	default: | 
					
						
							|  |  |  | 		return 0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	/* REDRAW SINCE NUMBERS HAVE CHANGED */ | 
					
						
							|  |  |  | 	return 1; | 
					
						
							|  |  |  | } |