[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33599] trunk/blender/source/blender/ makesdna/DNA_object_force.h: Added some explanation to pointcache-> step value as suggested by troubled on irc.

Janne Karhu jhkarh at gmail.com
Sat Dec 11 14:51:05 CET 2010


Revision: 33599
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33599
Author:   jhk
Date:     2010-12-11 14:51:04 +0100 (Sat, 11 Dec 2010)

Log Message:
-----------
Added some explanation to pointcache->step value as suggested by troubled on irc.

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_object_force.h

Modified: trunk/blender/source/blender/makesdna/DNA_object_force.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_object_force.h	2010-12-11 12:24:23 UTC (rev 33598)
+++ trunk/blender/source/blender/makesdna/DNA_object_force.h	2010-12-11 13:51:04 UTC (rev 33599)
@@ -154,7 +154,19 @@
 typedef struct PointCache {
 	struct PointCache *next, *prev;
 	int flag;		/* generic flag */
-	int step;		/* frames between cached frames */
+	
+	int step;		/* The number of frames between cached frames.
+					 * This should probably be an upper bound for a per point adaptive step in the future,
+					 * buf for now it's the same for all points. Without adaptivity this can effect the perceived
+					 * simulation quite a bit though. If for example particles are colliding with a horizontal
+					 * plane (with high damping) they quickly come to a stop on the plane, however there are still
+					 * forces acting on the particle (gravity and collisions), so the particle velocity isn't necessarily
+					 * zero for the whole duration of the frame even if the particle seems stationary. If all simulation
+					 * frames aren't cached (step > 1) these velocities are interpolated into movement for the non-cached
+					 * frames. The result will look like the point is oscillating around the collision location. So for
+					 * now cache step should be set to 1 for accurate reproduction of collisions.
+					 */
+
 	int simframe;	/* current frame of simulation (only if SIMULATION_VALID) */
 	int startframe;	/* simulation start frame */
 	int endframe;	/* simulation end frame */





More information about the Bf-blender-cvs mailing list