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

Campbell Barton ideasman42 at gmail.com
Fri Jul 4 12:32:52 CEST 2008


Revision: 15426
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15426
Author:   campbellbarton
Date:     2008-07-04 12:31:21 +0200 (Fri, 04 Jul 2008)

Log Message:
-----------
svn  merge  -r15399:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender/
manually merged source/gameengine

Modified Paths:
--------------
    branches/apricot/projectfiles_vc7/blender/render/BRE_render.vcproj
    branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
    branches/apricot/release/windows/installer/00.sconsblender.nsi
    branches/apricot/source/blender/blenkernel/BKE_cloth.h
    branches/apricot/source/blender/blenkernel/intern/cloth.c
    branches/apricot/source/blender/blenkernel/intern/collision.c
    branches/apricot/source/blender/blenkernel/intern/implicit.c
    branches/apricot/source/blender/blenkernel/intern/object.c
    branches/apricot/source/blender/blenkernel/intern/sca.c
    branches/apricot/source/blender/blenlib/BLI_arithb.h
    branches/apricot/source/blender/blenlib/intern/arithb.c
    branches/apricot/source/blender/blenloader/intern/readfile.c
    branches/apricot/source/blender/blenloader/intern/writefile.c
    branches/apricot/source/blender/makesdna/DNA_actuator_types.h
    branches/apricot/source/blender/makesdna/DNA_lamp_types.h
    branches/apricot/source/blender/makesdna/DNA_sensor_types.h
    branches/apricot/source/blender/python/BPY_interface.c
    branches/apricot/source/blender/render/intern/include/pixelshading.h
    branches/apricot/source/blender/render/intern/include/render_types.h
    branches/apricot/source/blender/render/intern/source/convertblender.c
    branches/apricot/source/blender/render/intern/source/pixelshading.c
    branches/apricot/source/blender/render/intern/source/rendercore.c
    branches/apricot/source/blender/src/buttons_logic.c
    branches/apricot/source/blender/src/buttons_shading.c
    branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp
    branches/apricot/source/gameengine/Converter/KX_ConvertSensors.cpp
    branches/apricot/source/gameengine/Expressions/PyObjectPlus.h
    branches/apricot/source/gameengine/GameLogic/SCA_EventManager.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_EventManager.h
    branches/apricot/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ILogicBrick.h
    branches/apricot/source/gameengine/GameLogic/SCA_IObject.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ISensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ISensor.h
    branches/apricot/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_LogicManager.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_MouseSensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_PropertySensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_PythonController.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_PythonController.h
    branches/apricot/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
    branches/apricot/source/gameengine/Ketsji/KX_ConstraintActuator.h
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.h
    branches/apricot/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
    branches/apricot/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
    branches/apricot/source/gameengine/Ketsji/KX_NearSensor.cpp
    branches/apricot/source/gameengine/Ketsji/KX_ObjectActuator.cpp
    branches/apricot/source/gameengine/Ketsji/KX_ObjectActuator.h
    branches/apricot/source/gameengine/Ketsji/KX_RaySensor.cpp
    branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp
    branches/apricot/source/gameengine/Ketsji/KX_TouchSensor.cpp
    branches/apricot/source/gameengine/PyDoc/KX_GameObject.py

Added Paths:
-----------
    branches/apricot/source/blender/render/intern/include/sunsky.h
    branches/apricot/source/blender/render/intern/source/sunsky.c
    branches/apricot/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
    branches/apricot/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ActuatorSensor.h

Modified: branches/apricot/projectfiles_vc7/blender/render/BRE_render.vcproj
===================================================================
--- branches/apricot/projectfiles_vc7/blender/render/BRE_render.vcproj	2008-07-04 08:14:50 UTC (rev 15425)
+++ branches/apricot/projectfiles_vc7/blender/render/BRE_render.vcproj	2008-07-04 10:31:21 UTC (rev 15426)
@@ -74,7 +74,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\..\..\..\lib\windows\sdl\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\yafray;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel;..\..\..\source\kernel\gen_messaging"
-				PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR"
+				PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR;_USE_MATH_DEFINES"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
 				DefaultCharIsUnsigned="TRUE"
@@ -176,6 +176,9 @@
 				RelativePath="..\..\..\source\blender\render\intern\source\strand.c">
 			</File>
 			<File
+				RelativePath="..\..\..\source\blender\render\intern\source\sunsky.c">
+			</File>
+			<File
 				RelativePath="..\..\..\source\blender\render\intern\source\texture.c">
 			</File>
 			<File
@@ -246,6 +249,9 @@
 				RelativePath="..\..\..\source\blender\render\intern\include\strand.h">
 			</File>
 			<File
+				RelativePath="..\..\..\source\blender\render\intern\include\sunsky.h">
+			</File>
+			<File
 				RelativePath="..\..\..\source\blender\render\intern\include\texture.h">
 			</File>
 			<File

Modified: branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
===================================================================
--- branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj	2008-07-04 08:14:50 UTC (rev 15425)
+++ branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj	2008-07-04 10:31:21 UTC (rev 15426)
@@ -333,6 +333,12 @@
 				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_2DFilterActuator.cpp">
 			</File>
 			<File
+				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ActuatorEventManager.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ActuatorSensor.cpp">
+			</File>
+			<File
 				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_AlwaysEventManager.cpp">
 			</File>
 			<File
@@ -445,6 +451,12 @@
 				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_2DFilterActuator.h">
 			</File>
 			<File
+				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ActuatorEventManager.h">
+			</File>
+			<File
+				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ActuatorSensor.h">
+			</File>
+			<File
 				RelativePath="..\..\..\source\gameengine\GameLogic\SCA_AlwaysEventManager.h">
 			</File>
 			<File

Modified: branches/apricot/release/windows/installer/00.sconsblender.nsi
===================================================================
--- branches/apricot/release/windows/installer/00.sconsblender.nsi	2008-07-04 08:14:50 UTC (rev 15425)
+++ branches/apricot/release/windows/installer/00.sconsblender.nsi	2008-07-04 10:31:21 UTC (rev 15426)
@@ -353,6 +353,7 @@
   SetOutPath $INSTDIR
   ; Write the installation path into the registry
   WriteRegStr HKLM SOFTWARE\BlenderFoundation "Install_Dir" "$INSTDIR"
+  WriteRegStr HKLM SOFTWARE\BlenderFoundation "Home_Dir" "$BLENDERHOME"
   ; Write the uninstall keys for Windows
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender (remove only)"
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
@@ -406,28 +407,32 @@
 UninstallText "This will uninstall Blender VERSION. Hit next to continue."
 
 Section "Uninstall"
+  Delete $INSTDIR\uninstall.exe
+  
+  ReadRegStr $BLENDERHOME HKLM "SOFTWARE\BlenderFoundation" "Home_Dir"
+  
   ; remove registry keys
   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender"
   DeleteRegKey HKLM SOFTWARE\BlenderFoundation
   ; remove files
   [DELROOTDIRCONTS]
   
-  Delete $INSTDIR\.blender\.bfont.ttf
-  Delete $INSTDIR\.blender\.Blanguages
+  Delete $BLENDERHOME\.blender\.bfont.ttf
+  Delete $BLENDERHOME\.blender\.Blanguages
   ; remove shortcuts, if any.
   Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*"
   Delete "$DESKTOP\Blender.lnk"
   ; remove directories used.
-  RMDir /r $INSTDIR\.blender\locale
+  RMDir /r $BLENDERHOME\.blender\locale
   MessageBox MB_YESNO "Erase .blender\scripts folder? (ALL contents will be erased!)" IDNO Next
-  RMDir /r $INSTDIR\.blender\scripts
-  RMDir /r $INSTDIR\.blender\scripts\bpymodules
-  RMDir /r $INSTDIR\.blender\scripts\bpydata
-  RMDir /r $INSTDIR\.blender\scripts\bpydata\config
+  RMDir /r $BLENDERHOME\.blender\scripts
+  RMDir /r $BLENDERHOME\.blender\scripts\bpymodules
+  RMDir /r $BLENDERHOME\.blender\scripts\bpydata
+  RMDir /r $BLENDERHOME\.blender\scripts\bpydata\config
 Next:
-  RMDir /r $INSTDIR\plugins\include
-  RMDir /r $INSTDIR\plugins
-  RMDir $INSTDIR\.blender
+  RMDir /r $BLENDERHOME\plugins\include
+  RMDir /r $BLENDERHOME\plugins
+  RMDir $BLENDERHOME\.blender
   RMDir "$SMPROGRAMS\Blender Foundation\Blender"
   RMDir "$SMPROGRAMS\Blender Foundation"
   RMDir "$INSTDIR"

Modified: branches/apricot/source/blender/blenkernel/BKE_cloth.h
===================================================================
--- branches/apricot/source/blender/blenkernel/BKE_cloth.h	2008-07-04 08:14:50 UTC (rev 15425)
+++ branches/apricot/source/blender/blenkernel/BKE_cloth.h	2008-07-04 10:31:21 UTC (rev 15426)
@@ -208,7 +208,7 @@
 ////////////////////////////////////////////////
 
 // needed for implicit.c
-int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt );
+int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, float dt );
 
 ////////////////////////////////////////////////
 

Modified: branches/apricot/source/blender/blenkernel/intern/cloth.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/cloth.c	2008-07-04 08:14:50 UTC (rev 15425)
+++ branches/apricot/source/blender/blenkernel/intern/cloth.c	2008-07-04 10:31:21 UTC (rev 15426)
@@ -132,7 +132,7 @@
 	
 	clmd->coll_parms->self_friction = 5.0;
 	clmd->coll_parms->friction = 5.0;
-	clmd->coll_parms->loop_count = 3;
+	clmd->coll_parms->loop_count = 2;
 	clmd->coll_parms->epsilon = 0.015f;
 	clmd->coll_parms->flags = CLOTH_COLLSETTINGS_FLAG_ENABLED;
 	clmd->coll_parms->collision_list = NULL;
@@ -471,7 +471,7 @@
 
 	tend();
 
-	/* printf ( "Cloth simulation time: %f\n", ( float ) tval() ); */
+	// printf ( "%f\n", ( float ) tval() );
 	
 	return ret;
 }

Modified: branches/apricot/source/blender/blenkernel/intern/collision.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/collision.c	2008-07-04 08:14:50 UTC (rev 15425)
+++ branches/apricot/source/blender/blenkernel/intern/collision.c	2008-07-04 10:31:21 UTC (rev 15426)
@@ -541,7 +541,7 @@
 			{
 				Normalize ( vrel_t_pre );
 
-				impulse = 2.0 * magtangent / ( 1.0 + w1*w1 + w2*w2 + w3*w3 );
+				impulse = magtangent / ( 1.0 + w1*w1 + w2*w2 + w3*w3 ); // 2.0 * 
 				VECADDMUL ( cloth1->verts[collpair->ap1].impulse, vrel_t_pre, w1 * impulse );
 				VECADDMUL ( cloth1->verts[collpair->ap2].impulse, vrel_t_pre, w2 * impulse );
 				VECADDMUL ( cloth1->verts[collpair->ap3].impulse, vrel_t_pre, w3 * impulse );
@@ -1291,52 +1291,223 @@
 	return 1;
 }
 
-int cloth_bvh_objcollisions_do ( ClothModifierData * clmd, CollisionModifierData *collmd, float step, float dt )
-{
+int cloth_do_selfcollisions(ClothModifierData * clmd)
+{	
+	int ret2 = 0, l;
 	Cloth *cloth = clmd->clothObject;
-	BVHTree *cloth_bvh= ( BVHTree * ) cloth->bvhtree;
-	long i=0, j = 0, numfaces = 0, numverts = 0;
-	ClothVertex *verts = NULL;
-	CollPair *collisions = NULL, *collisions_index = NULL;
-	int ret = 0;
-	int result = 0;
-	float tnull[3] = {0,0,0};
-	BVHTreeOverlap *overlap = NULL;
+	
+	if ( clmd->clothObject->bvhselftree )
+	{
+		for(l = 0; l < clmd->coll_parms->self_loop_count; l++)
+		{
+			BVHTreeOverlap *overlap = NULL;
+			ClothVertex *verts = clmd->clothObject->verts; // needed for openMP
+			int k;
+			int ret = 0, result = 0;
+			
+			// search for overlapping collision pairs 
+			overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result );
+	
+// #pragma omp parallel for private(k, i, j) schedule(static)
+			for ( k = 0; k < result; k++ )
+			{
+				float temp[3];
+				float length = 0;
+				float mindistance;
+				int i, j;
+	
+				i = overlap[k].indexA;
+				j = overlap[k].indexB;
+	
+				mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len );
+	
+				if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )
+				{
+					if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
+					&& ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) )
+					{
+						continue;
+					}
+				}
+	
+				VECSUB ( temp, verts[i].tx, verts[j].tx );
+	
+				if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue;
+	
+				// check for adjacent points (i must be smaller j)
+				if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) )
+				{
+					continue;
+				}
+	
+				length = Normalize ( temp );
+	
+				if ( length < mindistance )
+				{
+					float correction = mindistance - length;
+	
+					if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
+					{
+						VecMulf ( temp, -correction );
+						VECADD ( verts[j].tx, verts[j].tx, temp );
+					}
+					else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED )
+					{
+						VecMulf ( temp, correction );
+						VECADD ( verts[i].tx, verts[i].tx, temp );
+					}
+					else
+					{
+						VecMulf ( temp, -correction*0.5 );

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list