[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16142] branches/apricot: svn merge -r16106:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender

Campbell Barton ideasman42 at gmail.com
Sun Aug 17 03:24:41 CEST 2008


Revision: 16142
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16142
Author:   campbellbarton
Date:     2008-08-17 03:24:40 +0200 (Sun, 17 Aug 2008)

Log Message:
-----------
svn merge -r16106:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/apricot/CMakeLists.txt
    branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
    branches/apricot/source/blender/blenkernel/intern/ipo.c
    branches/apricot/source/blender/blenkernel/intern/particle_system.c
    branches/apricot/source/blender/blenkernel/intern/sca.c
    branches/apricot/source/blender/blenloader/intern/writefile.c
    branches/apricot/source/blender/makesdna/DNA_ipo_types.h
    branches/apricot/source/blender/makesdna/DNA_sensor_types.h
    branches/apricot/source/blender/src/buttons_logic.c
    branches/apricot/source/blender/src/editipo_lib.c
    branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    branches/apricot/source/gameengine/Converter/KX_ConvertSensors.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ISensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ISensor.h
    branches/apricot/source/gameengine/GameLogic/SCA_PythonController.cpp
    branches/apricot/source/gameengine/PyDoc/GameLogic.py
    branches/apricot/source/gameengine/PyDoc/SCA_ISensor.py

Added Paths:
-----------
    branches/apricot/source/gameengine/GameLogic/SCA_DelaySensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_DelaySensor.h
    branches/apricot/source/gameengine/PyDoc/SCA_DelaySensor.py

Modified: branches/apricot/CMakeLists.txt
===================================================================
--- branches/apricot/CMakeLists.txt	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/CMakeLists.txt	2008-08-17 01:24:40 UTC (rev 16142)
@@ -63,7 +63,6 @@
 OPTION(WITH_OPENEXR		"Enable OpenEXR Support (http://www.openexr.com)"	ON)
 OPTION(WITH_FFMPEG		"Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"	OFF)
 OPTION(WITH_OPENAL		"Enable OpenAL Support (http://www.openal.org)"		ON)
-OPTION(YESIAMSTUPID		"Enable execution on 64-bit platforms"			OFF)
 OPTION(WITH_OPENMP		"Enable OpenMP (has to be supported by the compiler)"	OFF)
 
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)

Modified: branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
===================================================================
--- branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj	2008-08-17 01:24:40 UTC (rev 16142)
@@ -348,6 +348,9 @@
 				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ANDController.cpp">
 			</File>
 			<File
+				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_DelaySensor.cpp">
+			</File>
+			<File
 				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_EventManager.cpp">
 			</File>
 			<File
@@ -466,6 +469,9 @@
 				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ANDController.h">
 			</File>
 			<File
+				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_DelaySensor.h">
+			</File>
+			<File
 				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_EventManager.h">
 			</File>
 			<File

Modified: branches/apricot/source/blender/blenkernel/intern/ipo.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/ipo.c	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/source/blender/blenkernel/intern/ipo.c	2008-08-17 01:24:40 UTC (rev 16142)
@@ -182,7 +182,7 @@
 	PART_EMIT_FREQ, PART_EMIT_LIFE, PART_EMIT_VEL, PART_EMIT_AVE, PART_EMIT_SIZE,
 	PART_AVE, PART_SIZE, PART_DRAG, PART_BROWN, PART_DAMP, PART_LENGTH, PART_CLUMP,
     PART_GRAV_X, PART_GRAV_Y, PART_GRAV_Z, PART_KINK_AMP, PART_KINK_FREQ, PART_KINK_SHAPE,
-	PART_BB_TILT
+	PART_BB_TILT, PART_PD_FSTR, PART_PD_FFALL, PART_PD_FMAXD
 };
 
 
@@ -1631,6 +1631,12 @@
 			poin= &(part->kink_shape); break;
 		case PART_BB_TILT:
 			poin= &(part->bb_tilt); break;
+		case PART_PD_FSTR:
+			poin= (part->pd?(&(part->pd->f_strength)):NULL); break;
+		case PART_PD_FFALL:
+			poin= (part->pd?(&(part->pd->f_power)):NULL); break;
+		case PART_PD_FMAXD:
+			poin= (part->pd?(&(part->pd->maxdist)):NULL); break;
 		}
 	}
 

Modified: branches/apricot/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/particle_system.c	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/source/blender/blenkernel/intern/particle_system.c	2008-08-17 01:24:40 UTC (rev 16142)
@@ -3748,10 +3748,10 @@
 
 										distance = Normalize(dvec);
 
-										if(part->flag & PART_DIE_ON_COL && distance < (epsys->particles+ptn2[p].index)->size){
-											*pa_die=1;
-											pa->dietime=cfra;
-											i=BOID_TOT_RULES;
+										if(part->flag & PART_DIE_ON_COL && distance < (epsys->particles+ptn2[p].index)->size){
+											*pa_die=1;
+											pa->dietime=cfra;
+											i=BOID_TOT_RULES;
 											break;
 										}
 
@@ -3948,27 +3948,44 @@
 	bvf->Addf(dvec,dvec,bvec);
 	bvf->Addf(state->co,state->co,dvec);
 	
-	/* air speed from wind effectors */
-	if(psys->effectors.first){
+	/* air speed from wind and vortex effectors */
+	if(psys->effectors.first) {
 		ParticleEffectorCache *ec;
-		for(ec=psys->effectors.first; ec; ec=ec->next){
-			if(ec->type & PSYS_EC_EFFECTOR){
+		for(ec=psys->effectors.first; ec; ec=ec->next) {
+			if(ec->type & PSYS_EC_EFFECTOR) {
 				Object *eob = ec->ob;
 				PartDeflect *pd = eob->pd;
+				float direction[3], vec_to_part[3];
+				float falloff;
 
-				if(pd->forcefield==PFIELD_WIND && pd->f_strength!=0.0){
-					float distance, wind[3];
-					VecCopyf(wind,eob->obmat[2]);
-					distance=VecLenf(state->co,eob->obmat[3]);
+				if(pd->f_strength != 0.0f) {
+					VecCopyf(direction, eob->obmat[2]);
+					VecSubf(vec_to_part, state->co, eob->obmat[3]);
 
-					if (distance < 0.001) distance = 0.001f;
+					falloff=effector_falloff(pd, direction, vec_to_part);
 
-					if(pd->flag&PFIELD_USEMAX && distance > pd->maxdist)
-						;
-					else{
-						Normalize(wind);
-						VecMulf(wind,pd->f_strength/(float)pow((double)distance,(double)pd->f_power));
-						bvf->Addf(state->co,state->co,wind);
+					switch(pd->forcefield) {
+						case PFIELD_WIND:
+							if(falloff <= 0.0f)
+								;	/* don't do anything */
+							else {
+								Normalize(direction);
+								VecMulf(direction, pd->f_strength * falloff);
+								bvf->Addf(state->co, state->co, direction);
+							}
+							break;
+						case PFIELD_VORTEX:
+						{
+							float distance, mag_vec[3];
+							Crossf(mag_vec, direction, vec_to_part);
+							Normalize(mag_vec);
+
+							distance = VecLength(vec_to_part);
+
+							VecMulf(mag_vec, pd->f_strength * distance * falloff);
+							bvf->Addf(state->co, state->co, mag_vec);
+							break;
+						}
 					}
 				}
 			}

Modified: branches/apricot/source/blender/blenkernel/intern/sca.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/sca.c	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/source/blender/blenkernel/intern/sca.c	2008-08-17 01:24:40 UTC (rev 16142)
@@ -153,6 +153,9 @@
 	case SENS_ACTUATOR:
 		sens->data= MEM_callocN(sizeof(bActuatorSensor), "actsens");
 		break;
+	case SENS_DELAY:
+		sens->data= MEM_callocN(sizeof(bDelaySensor), "delaysens");
+		break;
 	case SENS_MOUSE:
 		ms=sens->data= MEM_callocN(sizeof(bMouseSensor), "mousesens");
 		ms->type= LEFTMOUSE;

Modified: branches/apricot/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/apricot/source/blender/blenloader/intern/writefile.c	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/source/blender/blenloader/intern/writefile.c	2008-08-17 01:24:40 UTC (rev 16142)
@@ -608,6 +608,9 @@
 		case SENS_ACTUATOR:
 			writestruct(wd, DATA, "bActuatorSensor", 1, sens->data);
 			break;
+		case SENS_DELAY:
+			writestruct(wd, DATA, "bDelaySensor", 1, sens->data);
+			break;
 		case SENS_COLLISION:
 			writestruct(wd, DATA, "bCollisionSensor", 1, sens->data);
 			break;

Modified: branches/apricot/source/blender/makesdna/DNA_ipo_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_ipo_types.h	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/source/blender/makesdna/DNA_ipo_types.h	2008-08-17 01:24:40 UTC (rev 16142)
@@ -362,8 +362,8 @@
 
 /* ******************** */
 /* particle ipos */
-#define PART_TOTIPO		19
-#define PART_TOTNAM		19
+#define PART_TOTIPO		22
+#define PART_TOTNAM		22
 
 #define PART_EMIT_FREQ	1
 #define PART_EMIT_LIFE	2
@@ -389,7 +389,11 @@
 
 #define PART_BB_TILT	19
 
+#define PART_PD_FSTR	20
+#define PART_PD_FFALL	21
+#define PART_PD_FMAXD	22
 
+
 /* these are IpoCurve specific */
 /* **************** IPO ********************* */
 

Modified: branches/apricot/source/blender/makesdna/DNA_sensor_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_sensor_types.h	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/source/blender/makesdna/DNA_sensor_types.h	2008-08-17 01:24:40 UTC (rev 16142)
@@ -88,6 +88,13 @@
 	char name[32];
 } bActuatorSensor;
 
+typedef struct bDelaySensor {
+    short delay;
+	short duration;
+	short flag;
+	short pad;
+} bDelaySensor;
+
 typedef struct bCollisionSensor {
 	char name[32];          /* property name */
 	char materialName[32];  /* material      */
@@ -204,6 +211,7 @@
 #define SENS_MESSAGE   10
 #define SENS_JOYSTICK  11
 #define SENS_ACTUATOR  12
+#define SENS_DELAY     13
 /* sensor->flag */
 #define SENS_SHOW		1
 #define SENS_DEL		2
@@ -254,5 +262,7 @@
 #define SENS_JOY_HAT			2
 #define SENS_JOY_HAT_DIR		0
 
+#define SENS_DELAY_REPEAT		1
+
 #endif
 

Modified: branches/apricot/source/blender/src/buttons_logic.c
===================================================================
--- branches/apricot/source/blender/src/buttons_logic.c	2008-08-16 22:48:43 UTC (rev 16141)
+++ branches/apricot/source/blender/src/buttons_logic.c	2008-08-17 01:24:40 UTC (rev 16142)
@@ -683,6 +683,8 @@
 		return "Property";
 	case SENS_ACTUATOR:
 		return "Actuator";
+	case SENS_DELAY:
+		return "Delay";
 	case SENS_MOUSE:
 		return "Mouse";
 	case SENS_COLLISION:
@@ -704,7 +706,7 @@
 static char *sensor_pup(void)
 {
 	/* the number needs to match defines in game.h */
-	return "Sensors %t|Always %x0|Keyboard %x3|Mouse %x5|"
+	return "Sensors %t|Always %x0|Delay %x13|Keyboard %x3|Mouse %x5|"
 		"Touch %x1|Collision %x6|Near %x2|Radar %x7|"
 		"Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11|Actuator %x12";
 }
@@ -1000,6 +1002,7 @@
 {
 	switch(type) {
 	case SENS_ALWAYS:		return TH_BUT_ACTION;
+	case SENS_DELAY:		return TH_BUT_ACTION;
 	case SENS_TOUCH:		return TH_BUT_NEUTRAL;
 	case SENS_COLLISION:	return TH_BUT_SETTING;
 	case SENS_NEAR:			return TH_BUT_SETTING1; 
@@ -1070,8 +1073,8 @@
 	bRaySensor       *raySens      = NULL;
 	bMessageSensor   *mes          = NULL;
 	bJoystickSensor	 *joy		   = NULL;
-	bActuatorSensor  *as          = NULL;
-
+	bActuatorSensor  *as           = NULL;
+	bDelaySensor     *ds		   = NULL;
 	short ysize;
 	char *str;
 	
@@ -1297,6 +1300,27 @@
 			yco-= ysize;
 			break;
 		}
+	case SENS_DELAY:
+		{
+			ysize= 48;
+			
+			glRects(xco, yco-ysize, xco+width, yco);
+			uiEmboss((float)xco, (float)yco-ysize,
+				(float)xco+width, (float)yco, 1);
+			
+			draw_default_sensor_header(sens, block, xco, yco, width);
+			ds = sens->data;
+			
+			uiDefButS(block, NUM, 0, "Delay",(short)(10+xco),(short)(yco-44),(short)((width-22)*0.4+10), 19,
+				&ds->delay, 0.0, 5000.0, 0, 0, "Delay in number of frames before the positive trigger");
+			uiDefButS(block, NUM, 0, "Dur",(short)(10+xco+(width-22)*0.4+10),(short)(yco-44),(short)((width-22)*0.4-10), 19,

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list