[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25691] trunk/blender: Stickness factor for particle collisions, patch submitted by Raul Fernandez Hernandez (farsthary).

Janne Karhu jhkarh at utu.fi
Sun Jan 3 15:51:35 CET 2010


Revision: 25691
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25691
Author:   jhk
Date:     2010-01-03 15:51:34 +0100 (Sun, 03 Jan 2010)

Log Message:
-----------
Stickness factor for particle collisions, patch submitted by Raul Fernandez Hernandez (farsthary).

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_physics_field.py
    trunk/blender/source/blender/blenkernel/intern/particle_system.c
    trunk/blender/source/blender/makesdna/DNA_object_force.h
    trunk/blender/source/blender/makesrna/intern/rna_object_force.c

Modified: trunk/blender/release/scripts/ui/properties_physics_field.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_field.py	2010-01-03 13:17:12 UTC (rev 25690)
+++ trunk/blender/release/scripts/ui/properties_physics_field.py	2010-01-03 14:51:34 UTC (rev 25691)
@@ -217,6 +217,7 @@
             col = split.column()
             col.label(text="Particle:")
             col.prop(settings, "permeability", slider=True)
+            col.prop(settings, "stickness")
             col.prop(settings, "kill_particles")
             col.label(text="Particle Damping:")
             sub = col.column(align=True)

Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle_system.c	2010-01-03 13:17:12 UTC (rev 25690)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c	2010-01-03 14:51:34 UTC (rev 25691)
@@ -2895,7 +2895,9 @@
 				}
 				else {
 					VECCOPY(pa->state.co, col.co2);
-					VECCOPY(pa->state.vel, vel);
+					/* Stickness to surface */
+					normalize_v3(nor_vec);
+					VECADDFAC(pa->state.vel, vel, nor_vec, -pd->pdef_stickness);
 				}
 			}
 			deflections++;

Modified: trunk/blender/source/blender/makesdna/DNA_object_force.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_object_force.h	2010-01-03 13:17:12 UTC (rev 25690)
+++ trunk/blender/source/blender/makesdna/DNA_object_force.h	2010-01-03 14:51:34 UTC (rev 25691)
@@ -87,8 +87,9 @@
 	float pdef_perm;	/* Chance of particle passing through mesh      */
 	float pdef_frict;	/* Friction factor for particle deflection		*/
 	float pdef_rfrict;	/* Random element of friction for deflection	*/
+	float pdef_stickness;/* surface particle stickness					*/
 
-	float absorption, pad;	/* used for forces */
+	float absorption;	/* used for forces */
 	
 	/* softbody collisions */
 	float pdef_sbdamp;	/* Damping factor for softbody deflection       */

Modified: trunk/blender/source/blender/makesrna/intern/rna_object_force.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object_force.c	2010-01-03 13:17:12 UTC (rev 25690)
+++ trunk/blender/source/blender/makesrna/intern/rna_object_force.c	2010-01-03 14:51:34 UTC (rev 25691)
@@ -810,6 +810,12 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", PDEFLE_KILL_PART);
 	RNA_def_property_ui_text(prop, "Kill Particles", "Kill collided particles");
 	RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
+
+	prop= RNA_def_property(srna, "stickness", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "pdef_stickness");
+	RNA_def_property_range(prop, 0.0f, 10.0f);
+	RNA_def_property_ui_text(prop, "Stickness", "Amount of stickness to surface collision");
+	RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
 	
 	/* Soft Body and Cloth Interaction */
 	





More information about the Bf-blender-cvs mailing list