Merged in MAINT-8066 "Breasts Bounce" increases at low fps.

Mon, 11 Dec 2017 13:50:24 +0000

author
Andrey Kleshchev <andreykproductengine@lindenlab.com>
date
Mon, 11 Dec 2017 13:50:24 +0000
changeset 53576
00d6bd90bdb0
parent 53575
80bfec7e3da7
child 53577
03862413c3bc

Merged in MAINT-8066 "Breasts Bounce" increases at low fps.

Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com>
Approved-by: Simon Linden <simon@lindenlab.com>
Approved-by: Maxim Nikolenko <maximnproductengine@lindenlab.com>

indra/newview/llphysicsmotion.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llphysicsmotion.cpp	Thu Dec 14 15:48:02 2017 +0200
     1.2 +++ b/indra/newview/llphysicsmotion.cpp	Mon Dec 11 13:50:24 2017 +0000
     1.3 @@ -44,7 +44,7 @@
     1.4  typedef std::map<std::string, F32> default_controller_map_t;
     1.5  
     1.6  #define MIN_REQUIRED_PIXEL_AREA_AVATAR_PHYSICS_MOTION 0.f
     1.7 -#define TIME_ITERATION_STEP 0.1f
     1.8 +#define TIME_ITERATION_STEP 0.05f
     1.9  
    1.10  inline F64 llsgn(const F64 a)
    1.11  {
    1.12 @@ -559,6 +559,18 @@
    1.13  	
    1.14  	// Break up the physics into a bunch of iterations so that differing framerates will show
    1.15  	// roughly the same behavior.
    1.16 +	// Explanation/example: Lets assume we have a bouncing object. Said abjects bounces at a
    1.17 +	// trajectory that has points A>B>C. Object bounces from A to B with specific speed.
    1.18 +	// It needs time T to move from A to B.
    1.19 +	// As long as our frame's time significantly smaller then T our motion will be split into
    1.20 +	// multiple parts. with each part speed will decrease. Object will reach B position (roughly)
    1.21 +	// and bounce/fall back to A.
    1.22 +	// But if frame's time (F_T) is larger then T, object will move with same speed for whole F_T
    1.23 +	// and will jump over point B up to C ending up with increased amplitude. To avoid that we
    1.24 +	// split F_T into smaller portions so that when frame's time is too long object can virtually
    1.25 +	// bounce at right (relatively) position.
    1.26 +	// Note: this doesn't look to be optimal, since it provides only "roughly same" behavior, but
    1.27 +	// irregularity at higher fps looks to be insignificant so it works good enough for low fps.
    1.28  	for (F32 time_iteration = 0; time_iteration <= time_delta; time_iteration += TIME_ITERATION_STEP)
    1.29  	{
    1.30  		F32 time_iteration_step = TIME_ITERATION_STEP;

mercurial