From 63a508408d63c2a8853b6b0eac374c348c4c8ed1 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 11 Dec 2010 13:51:04 +0000 Subject: Added some explanation to pointcache->step value as suggested by troubled on irc. --- source/blender/makesdna/DNA_object_force.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna/DNA_object_force.h') diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 4515a6c05a3..8a6018fb7ea 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -154,7 +154,19 @@ typedef struct PTCacheMem { 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 */ -- cgit v1.2.3