Tick Action: "U" Subscript, "p" "d" "a" "t" "e" , Baseline left parenthesis, "d" Subscript, "t" , Baseline , right parenthesisUpdatedt
every
Min Step Time: 5050
ms
Linear interpolate collision time
45
Expression 46: "t" Subscript, "c" "d" 1 , Baseline left parenthesis, "p" Subscript, 0 , Baseline , "v" Subscript, 0 , Baseline , "h" , right parenthesis equals negative StartFraction, "C" left parenthesis, "p" Subscript, 0 , Baseline , right parenthesis Over "C" left parenthesis, "p" Subscript, "E" "u" "l" "e" "r" , Baseline left parenthesis, "p" Subscript, 0 , Baseline , "v" Subscript, 0 , Baseline , "h" , right parenthesis , right parenthesis minus "C" left parenthesis, "p" Subscript, 0 , Baseline , right parenthesis , EndFractiontcd1p0,v0,h=−Cp0CpEulerp0,v0,h−Cp0
46
Collision response, reflect
47
Expression 48: "p" Subscript, "c" "d" 1 "r" , Baseline left parenthesis, "p" Subscript, 0 , Baseline , "v" Subscript, 0 , Baseline , "n" , "t" , "h" , right parenthesis equals "p" Subscript, 0 , Baseline plus "v" Subscript, 0 , Baseline "h" "t" plus "r" Subscript, "e" "f" "l" "e" "c" "t" , Baseline left parenthesis, "v" Subscript, 0 , Baseline , "n" , right parenthesis "h" left parenthesis, 1 minus "t" , right parenthesis plus 1 half "g" "h" squaredpcd1rp0,v0,n,t,h=p0+v0ht+reflectv0,nh1−t+12gh2
48
Expression 49: "p" Subscript, "c" "d" 1 , Baseline left parenthesis, "h" , right parenthesis equals "p" Subscript, "c" "d" 1 "r" , Baseline left parenthesis, "p" , "v" , "N" left parenthesis, "p" , right parenthesis , "t" Subscript, "c" "d" 1 , Baseline left parenthesis, "p" , "v" , "h" , right parenthesis , "h" , right parenthesispcd1h=pcd1rp,v,Np,tcd1p,v,h,h
49
Expression 50: "v" Subscript, "c" "d" 1 , Baseline left parenthesis, "h" , right parenthesis equals "r" Subscript, "e" "f" "l" "e" "c" "t" , Baseline left parenthesis, "v" , "N" left parenthesis, "p" , right parenthesis , right parenthesis plus "g" "h"vcd1h=reflectv,Np+gh
50
Enforce energy conservation
51
Expression 52: "E" Subscript, "m" "C" "d" 1 , Baseline left parenthesis, "h" , right parenthesis equals StartFraction, StartRoot, max left parenthesis, 2 left parenthesis, "E" left parenthesis, "p" , "v" , right parenthesis minus "E" Subscript, "g" "r" "a" "v" , Baseline left parenthesis, "p" Subscript, "c" "d" 1 , Baseline left parenthesis, "h" , right parenthesis , right parenthesis , right parenthesis , 10 to the negative 32nd power , right parenthesis , EndRoot Over StartRoot, "d" Subscript, "o" "t" 2 , Baseline left parenthesis, "v" Subscript, "c" "d" 1 , Baseline left parenthesis, "h" , right parenthesis , right parenthesis , EndRoot plus 10 to the negative 16th power , EndFractionEmCd1h=max2Ep,v−Egravpcd1h,10−32dot2vcd1h+10−16
52
Expression 53: "U" Subscript, "p" "d" "a" "t" "e" "C" "d" 1 "r" , Baseline left parenthesis, "h" , right parenthesis equals "p" to "p" Subscript, "c" "d" 1 , Baseline left parenthesis, "h" , right parenthesis , "v" to "v" Subscript, "c" "d" 1 , Baseline left parenthesis, "h" , right parenthesis times "E" Subscript, "m" "C" "d" 1 , Baseline left parenthesis, "h" , right parenthesisUpdateCd1rh=p→pcd1h,v→vcd1h·EmCd1h
53
Expression 54: "U" Subscript, "p" "d" "a" "t" "e" "C" "d" 1 , Baseline left parenthesis, "h" , right parenthesis equals left brace, "C" left parenthesis, "p" Subscript, "E" "u" "l" "e" "r" , Baseline left parenthesis, "p" , "v" , "h" , right parenthesis , right parenthesis greater than 0 : "U" Subscript, "p" "d" "a" "t" "e" "C" "d" 1 "r" , Baseline left parenthesis, "h" , right parenthesis , "U" Subscript, "p" "d" "a" "t" "e" "C" "d" "E" "u" "l" "e" "r" , Baseline left parenthesis, "h" , right parenthesis , right braceUpdateCd1h=CpEulerp,v,h>0:UpdateCd1rh,UpdateCdEulerh
54
Expression 55: "U" Subscript, "p" "d" "a" "t" "e" , Baseline left parenthesis, "h" , right parenthesis equals "U" Subscript, "p" "d" "a" "t" "e" "C" "d" 1 , Baseline left parenthesis, "h" , right parenthesis , "P" Subscript, "u" "s" "h" "P" , Baseline left parenthesis, , right parenthesisUpdateh=UpdateCd1h,PushP
55
Expression 56: "U" Subscript, "p" "d" "a" "t" "e" , Baseline left parenthesis, "d" Subscript, "t" , Baseline , right parenthesisUpdatedt