@@ -26,14 +26,25 @@ public class CameraData
2626 public float MinTime ;
2727 public float MaxTime ;
2828
29+ public Vector3 SmoothedPositionBinding = Vector3 . zero ;
30+ public Vector3 SmoothedLookAtBinding = Vector3 . zero ;
31+
2932 public Vector3 EvaluatePositionBinding ( PluginCameraHelper helper )
3033 {
31- return EvaluateBinding ( helper , PositionBinding ) + PositionOffset ;
34+ var newPos = EvaluateBinding ( helper , PositionBinding ) + PositionOffset ;
35+
36+ var filter = 0.05f ;
37+ SmoothedPositionBinding = SmoothedPositionBinding * ( 1.0f - filter ) + newPos * filter ;
38+ return SmoothedPositionBinding ;
3239 }
3340
3441 public Vector3 EvaluateLookAtBindingBinding ( PluginCameraHelper helper )
3542 {
36- return EvaluateBinding ( helper , LookAtBinding ) + LookAt ;
43+ var newLookat = EvaluateBinding ( helper , LookAtBinding ) + LookAt ;
44+
45+ var filter = 0.05f ;
46+ SmoothedLookAtBinding = SmoothedLookAtBinding * ( 1.0f - filter ) + newLookat * filter ;
47+ return SmoothedLookAtBinding ;
3748 }
3849
3950 Vector3 EvaluateBinding ( PluginCameraHelper helper , string binding )
@@ -62,9 +73,6 @@ public static void LoadSettings()
6273 string docPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) ;
6374 string settingLoc = Path . Combine ( docPath , @"LIV\Plugins\CameraBehaviours\FriesBSCam\" ) ;
6475
65- // Create the directory in the off-chance that it doesn't exist.
66- Directory . CreateDirectory ( settingLoc ) ;
67-
6876 settingLoc = Path . Combine ( settingLoc , "settings.txt" ) ;
6977
7078 // Check to see if the file exists.
@@ -105,7 +113,7 @@ public static void LoadSettings()
105113 ws . WriteLine ( " Name='BottomRight'" ) ;
106114 ws . WriteLine ( " Type='LookAt'" ) ;
107115 ws . WriteLine ( " PositionBinding='playerWaist'" ) ;
108- ws . WriteLine ( " PositionOffset={x='1.0 ', y='0.0', z='-2.0'} " ) ;
116+ ws . WriteLine ( " PositionOffset={x='0.75 ', y='0.0', z='-2.0'} " ) ;
109117 ws . WriteLine ( " LookAt={x='0.0', y='0.0', z='1.0'} " ) ;
110118 ws . WriteLine ( " MinTime='4.0' " ) ;
111119 ws . WriteLine ( " MaxTime='8.0' " ) ;
@@ -114,7 +122,7 @@ public static void LoadSettings()
114122 ws . WriteLine ( " Name='BottomLeft'" ) ;
115123 ws . WriteLine ( " Type='LookAt'" ) ;
116124 ws . WriteLine ( " PositionBinding='playerWaist'" ) ;
117- ws . WriteLine ( " PositionOffset={x='-1.0 ', y='0.0', z='-2.0'} " ) ;
125+ ws . WriteLine ( " PositionOffset={x='-0.75 ', y='0.0', z='-2.0'} " ) ;
118126 ws . WriteLine ( " LookAt={x='0.0', y='0.0', z='1.0'} " ) ;
119127 ws . WriteLine ( " MinTime='4.0' " ) ;
120128 ws . WriteLine ( " MaxTime='8.0' " ) ;
0 commit comments