@@ -61,6 +61,7 @@ float fov1P = 75.F;
6161float fov1PAiming = 60 .f;
6262float fov3PAiming = 60 .f;
6363float distanceOffset = 0 .f;
64+ float cameraAngle3p = 3 .5f ;
6465const float PI = 3 .1415926535897932f ;
6566int lastVehHash = -1 ;
6667bool isBike = false ;
@@ -70,6 +71,8 @@ bool isInVehicle = false;
7071float longitudeOffset3P = 0 .f;
7172float heightOffset3P = 0 .f;
7273
74+ float heightIcrementCalc = 0 .f;
75+
7376float rotationSpeed3P = 4 .75f ;
7477
7578// bool useVariableRotSpeed3P = true;
@@ -585,7 +588,8 @@ void ReadSettings(bool notify)
585588 lookLeftKey = strdup (ini.GetValue (" keyMappings" , " lookLeftKey" , " B" ));
586589 lookRightKey = strdup (ini.GetValue (" keyMappings" , " lookRightKey" , " N" ));
587590
588- distanceOffset = (float ) ini.GetDoubleValue (" 3rdPersonView" , " distanceOffset" , 0 .);
591+ distanceOffset = (float ) ini.GetDoubleValue (" 3rdPersonView" , " distanceOffset" , 0.0 );
592+ cameraAngle3p = clamp ((float )ini.GetDoubleValue (" 3rdPersonView" , " cameraAngle" , 3.5 ), 0 .f , 20 .f );
589593
590594 fov3P = (float ) ini.GetDoubleValue (" 3rdPersonView" , " fov" , 77.5 );
591595 fov1P = (float ) ini.GetDoubleValue (" 1stPersonView" , " fov" , 75.0 );
@@ -1015,7 +1019,7 @@ void updateVehicleProperties()
10151019
10161020 longitudeOffset3P += 1 .45f + distanceOffset;
10171021
1018- // ShowNotification(std::to_string( longitudeOffset3P).c_str() );
1022+ heightIcrementCalc = longitudeOffset3P * tan (cameraAngle3p * PI / 180.0 );
10191023
10201024 vehHasTowBone = vehHasBone (" tow_arm" );
10211025 vehHasTrailerBone = vehHasBone (" attach_female" );
@@ -1402,7 +1406,7 @@ Vector3f V3Reflect(Vector3f vector, Vector3f normal)
14021406
14031407void updateCam3pNfsAlgorithm ()
14041408{
1405- float heigthOffset = 0 .15f ;
1409+ float heigthOffset = 0 .15f + heightIcrementCalc ;
14061410
14071411 currentTowHeightIncrement = lerp (currentTowHeightIncrement, towHeightIncrement, 1 .45f * getDeltaTime ());
14081412 currentTowLongitudeIncrement = lerp (currentTowLongitudeIncrement, towLongitudeIncrement, 1 .75f * getDeltaTime ());
@@ -1567,7 +1571,7 @@ void updateCam3pNfsAlgorithm()
15671571
15681572 rotEuler[1 ] = 0 .f ;
15691573
1570- CAM::SET_CAM_ROT (customCam, rotEuler.x () + (lookDownThreshold * 7 .5f ), rotEuler.y (), rotEuler.z (), 2 );
1574+ CAM::SET_CAM_ROT (customCam, rotEuler.x () + (lookDownThreshold * 7 .5f ) - cameraAngle3p , rotEuler.y (), rotEuler.z (), 2 );
15711575}
15721576
15731577void updateCameraSmooth3P () {
0 commit comments