tried to reconstruct bills cam

This commit is contained in:
aap 2020-06-21 11:03:20 +02:00
parent e1c58131c4
commit 586e8a2ab4
3 changed files with 41 additions and 4 deletions

View file

@ -167,7 +167,9 @@ CCam::Process(void)
case MODE_MODELVIEW: case MODE_MODELVIEW:
Process_ModelView(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar); Process_ModelView(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
break; break;
// case MODE_BILL: case MODE_BILL:
Process_Bill(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
break;
case MODE_SYPHON: case MODE_SYPHON:
Process_Syphon(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar); Process_Syphon(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
break; break;
@ -1665,6 +1667,8 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
} }
} }
float fBillsBetaOffset; // made up name, actually in CCam
void void
CCam::Process_BehindCar(const CVector &CameraTarget, float TargetOrientation, float, float) CCam::Process_BehindCar(const CVector &CameraTarget, float TargetOrientation, float, float)
{ {
@ -1684,6 +1688,15 @@ CCam::Process_BehindCar(const CVector &CameraTarget, float TargetOrientation, fl
if(Length < 0.002f) if(Length < 0.002f)
Length = 0.002f; Length = 0.002f;
Beta = CGeneral::GetATanOfXY(TargetCoors.x - Source.x, TargetCoors.y - Source.y); Beta = CGeneral::GetATanOfXY(TargetCoors.x - Source.x, TargetCoors.y - Source.y);
#ifdef TOGGLEABLE_BETA_FEATURES
// This is completely made up but Bill's cam manipulates an angle before calling this
// and otherwise calculating Beta doesn't make much sense.
Beta += fBillsBetaOffset;
fBillsBetaOffset = 0.0f;
Dist.x = -Length*Cos(Beta);
Dist.y = -Length*Sin(Beta);
Source = TargetCoors + Dist;
#endif
if(Length > CA_MAX_DISTANCE){ if(Length > CA_MAX_DISTANCE){
Source.x = TargetCoors.x + Dist.x/Length * CA_MAX_DISTANCE; Source.x = TargetCoors.x + Dist.x/Length * CA_MAX_DISTANCE;
Source.y = TargetCoors.y + Dist.y/Length * CA_MAX_DISTANCE; Source.y = TargetCoors.y + Dist.y/Length * CA_MAX_DISTANCE;
@ -1773,8 +1786,13 @@ CCam::WorkOutCamHeightWeeCar(CVector &TargetCoors, float TargetOrientation)
else else
WellBufferMe(TargetZOffSet, &RoadHeightFix, &RoadHeightFixSpeed, 0.27f, 0.1f, false); WellBufferMe(TargetZOffSet, &RoadHeightFix, &RoadHeightFixSpeed, 0.27f, 0.1f, false);
if((colpoint.surfaceB == SURFACE_DEFAULT || colpoint.surfaceB >= SURFACE_CAR) && if(colpoint.surfaceB != SURFACE_TARMAC &&
colpoint.surfaceB != SURFACE_THICK_METAL_PLATE && colpoint.surfaceB != SURFACE_STEEP_CLIFF && colpoint.surfaceB != SURFACE_GRASS &&
colpoint.surfaceB != SURFACE_GRAVEL &&
colpoint.surfaceB != SURFACE_MUD_DRY &&
colpoint.surfaceB != SURFACE_PAVEMENT &&
colpoint.surfaceB != SURFACE_THICK_METAL_PLATE &&
colpoint.surfaceB != SURFACE_STEEP_CLIFF &&
RoadHeightFix > 1.4f) RoadHeightFix > 1.4f)
RoadHeightFix = 1.4f; RoadHeightFix = 1.4f;
@ -4421,6 +4439,24 @@ CCam::Process_FollowPed_WithBinding(const CVector &CameraTarget, float TargetOri
GetVectorsReadyForRW(); GetVectorsReadyForRW();
} }
void
CCam::Process_Bill(const CVector &CameraTarget, float TargetOrientation, float SpeedVar, float TargetSpeedVar)
{
#ifdef FIX_BUGS
fBillsBetaOffset += CPad::GetPad(0)->GetRightStickX()/1000.0f;
#else
// just wtf is this? this code must be ancient
if(CPad::GetPad(0)->GetStart())
fBillsBetaOffset += CPad::GetPad(0)->GetLeftStickX()/1000.0f;
#endif
while(fBillsBetaOffset > TWOPI) fBillsBetaOffset -= TWOPI;
while(fBillsBetaOffset < 0.0f) fBillsBetaOffset += TWOPI;
TargetOrientation += fBillsBetaOffset;
while(TargetOrientation > TWOPI) TargetOrientation -= TWOPI;
while(TargetOrientation < 0.0f) TargetOrientation += TWOPI;
Process_BehindCar(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
}
void void
CCam::Process_Im_The_Passenger_Woo_Woo(const CVector &CameraTarget, float TargetOrientation, float, float) CCam::Process_Im_The_Passenger_Woo_Woo(const CVector &CameraTarget, float TargetOrientation, float, float)
{ {

View file

@ -249,7 +249,7 @@ public:
// CCam::Process_Look_At_Cars // CCam::Process_Look_At_Cars
// CCam::Process_CheesyZoom // CCam::Process_CheesyZoom
// CCam::Process_Aiming // CCam::Process_Aiming
// CCam::Process_Bill // same as BehindCar due to unused variables void Process_Bill(const CVector &CameraTarget, float TargetOrientation, float SpeedVar, float TargetSpeedVar);
void Process_Im_The_Passenger_Woo_Woo(const CVector &CameraTarget, float TargetOrientation, float, float); void Process_Im_The_Passenger_Woo_Woo(const CVector &CameraTarget, float TargetOrientation, float, float);
void Process_Blood_On_The_Tracks(const CVector &CameraTarget, float TargetOrientation, float, float); void Process_Blood_On_The_Tracks(const CVector &CameraTarget, float TargetOrientation, float, float);
void Process_Cam_Running_Side_Train(const CVector &CameraTarget, float TargetOrientation, float, float); void Process_Cam_Running_Side_Train(const CVector &CameraTarget, float TargetOrientation, float, float);

View file

@ -444,6 +444,7 @@ public:
bool GetLeftShoulder2(void) { return !!NewState.LeftShoulder2; } bool GetLeftShoulder2(void) { return !!NewState.LeftShoulder2; }
bool GetRightShoulder1(void) { return !!NewState.RightShoulder1; } bool GetRightShoulder1(void) { return !!NewState.RightShoulder1; }
bool GetRightShoulder2(void) { return !!NewState.RightShoulder2; } bool GetRightShoulder2(void) { return !!NewState.RightShoulder2; }
bool GetStart() { return !!NewState.Start; }
int16 GetLeftStickX(void) { return NewState.LeftStickX; } int16 GetLeftStickX(void) { return NewState.LeftStickX; }
int16 GetLeftStickY(void) { return NewState.LeftStickY; } int16 GetLeftStickY(void) { return NewState.LeftStickY; }
int16 GetRightStickX(void) { return NewState.RightStickX; } int16 GetRightStickX(void) { return NewState.RightStickX; }