Small camera fixes

This commit is contained in:
Sergeanur 2020-04-08 09:58:08 +03:00
parent 0ed9b0574b
commit 560fc65538
4 changed files with 68 additions and 59 deletions

View File

@ -1107,7 +1107,7 @@ void CReplay::TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float ca
CStreaming::LoadScene(ff_coord); CStreaming::LoadScene(ff_coord);
} }
if (cam_mode == REPLAYCAMMODE_ASSTORED) if (cam_mode == REPLAYCAMMODE_ASSTORED)
TheCamera.CarZoomIndicator = 5.0f; TheCamera.CarZoomIndicator = CAM_ZOOM_CINEMATIC;
} }
void CReplay::StoreStuffInMem(void) void CReplay::StoreStuffInMem(void)

View File

@ -4672,15 +4672,15 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
else { else {
switch ((int)TheCamera.CarZoomIndicator) { switch ((int)TheCamera.CarZoomIndicator) {
// near // near
case 1: case CAM_ZOOM_1:
zoomModeAlphaOffset = ZmOneAlphaOffsetLCS[alphaArrPos]; zoomModeAlphaOffset = ZmOneAlphaOffsetLCS[alphaArrPos];
break; break;
// mid // mid
case 2: case CAM_ZOOM_2:
zoomModeAlphaOffset = ZmTwoAlphaOffsetLCS[alphaArrPos]; zoomModeAlphaOffset = ZmTwoAlphaOffsetLCS[alphaArrPos];
break; break;
// far // far
case 3: case CAM_ZOOM_3:
zoomModeAlphaOffset = ZmThreeAlphaOffsetLCS[alphaArrPos]; zoomModeAlphaOffset = ZmThreeAlphaOffsetLCS[alphaArrPos];
break; break;
default: default:
@ -4705,14 +4705,12 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
} }
} else { } else {
// 0.6f = fTestShiftHeliCamTarget // 0.6f = fTestShiftHeliCamTarget
TargetCoors.x += 0.6f * car->GetUp().x * colMaxZ; TargetCoors += 0.6f * car->GetUp() * colMaxZ;
TargetCoors.y += 0.6f * car->GetUp().y * colMaxZ;
TargetCoors.z += 0.6f * car->GetUp().z * colMaxZ;
} }
float minDistForVehType = CARCAM_SET[camSetArrPos][4]; float minDistForVehType = CARCAM_SET[camSetArrPos][4];
if ((int)TheCamera.CarZoomIndicator == 1 && (camSetArrPos < 2 || camSetArrPos == 7)) { if (TheCamera.CarZoomIndicator == CAM_ZOOM_1 && (camSetArrPos < 2 || camSetArrPos == 7)) {
minDistForVehType = minDistForVehType * 0.65f; minDistForVehType = minDistForVehType * 0.65f;
} }
@ -4904,8 +4902,8 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
// yMovement = 0.0; // yMovement = 0.0;
if (!nextDirectionIsForward) { if (!nextDirectionIsForward) {
yMovement = 0.0; yMovement = 0.0f;
xMovement = 0.0; xMovement = 0.0f;
} }
if (camSetArrPos == 0 || camSetArrPos == 7) { if (camSetArrPos == 0 || camSetArrPos == 7) {

View File

@ -65,8 +65,8 @@ bool &bDidWeProcessAnyCinemaCam = *(bool*)0x95CD46;
#define KEYJUSTDOWN(k) ControlsManager.GetIsKeyboardKeyJustDown((RsKeyCodes)k) #define KEYJUSTDOWN(k) ControlsManager.GetIsKeyboardKeyJustDown((RsKeyCodes)k)
#define KEYDOWN(k) ControlsManager.GetIsKeyboardKeyDown((RsKeyCodes)k) #define KEYDOWN(k) ControlsManager.GetIsKeyboardKeyDown((RsKeyCodes)k)
#define CTRLJUSTDOWN(key) \ #define CTRLJUSTDOWN(key) \
((KEYDOWN(rsLCTRL) || KEYDOWN(rsRCTRL)) && KEYJUSTDOWN((RsKeyCodes)key) || \ ((KEYDOWN(rsLCTRL) || KEYDOWN(rsRCTRL)) && KEYJUSTDOWN((RsKeyCodes)key) || \
(KEYJUSTDOWN(rsLCTRL) || KEYJUSTDOWN(rsRCTRL)) && KEYDOWN((RsKeyCodes)key)) (KEYJUSTDOWN(rsLCTRL) || KEYJUSTDOWN(rsRCTRL)) && KEYDOWN((RsKeyCodes)key))
#define CTRLDOWN(key) ((KEYDOWN(rsLCTRL) || KEYDOWN(rsRCTRL)) && KEYDOWN((RsKeyCodes)key)) #define CTRLDOWN(key) ((KEYDOWN(rsLCTRL) || KEYDOWN(rsRCTRL)) && KEYDOWN((RsKeyCodes)key))
#endif #endif
@ -124,8 +124,8 @@ CCamera::Init(void)
m_WideScreenOn = false; m_WideScreenOn = false;
m_fFOV_Wide_Screen = 0.0f; m_fFOV_Wide_Screen = 0.0f;
m_bRestoreByJumpCut = false; m_bRestoreByJumpCut = false;
CarZoomIndicator = 2.0f; CarZoomIndicator = CAM_ZOOM_2;
PedZoomIndicator = 2.0f; PedZoomIndicator = CAM_ZOOM_2;
CarZoomValueSmooth = 0.0f; CarZoomValueSmooth = 0.0f;
m_fPedZoomValueSmooth = 0.0f; m_fPedZoomValueSmooth = 0.0f;
pTargetEntity = nil; pTargetEntity = nil;
@ -623,11 +623,11 @@ CCamera::CamControl(void)
if(CPad::GetPad(0)->CycleCameraModeUpJustDown() && !CReplay::IsPlayingBack() && if(CPad::GetPad(0)->CycleCameraModeUpJustDown() && !CReplay::IsPlayingBack() &&
(m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) && (m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) &&
!m_WideScreenOn) !m_WideScreenOn)
CarZoomIndicator -= 1.0f; CarZoomIndicator--;
if(CPad::GetPad(0)->CycleCameraModeDownJustDown() && !CReplay::IsPlayingBack() && if(CPad::GetPad(0)->CycleCameraModeDownJustDown() && !CReplay::IsPlayingBack() &&
(m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) && (m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) &&
!m_WideScreenOn) !m_WideScreenOn)
CarZoomIndicator += 1.0f; CarZoomIndicator++;
if(!m_bFailedCullZoneTestPreviously){ if(!m_bFailedCullZoneTestPreviously){
if(CarZoomIndicator < CAM_ZOOM_1STPRS) CarZoomIndicator = CAM_ZOOM_CINEMATIC; if(CarZoomIndicator < CAM_ZOOM_1STPRS) CarZoomIndicator = CAM_ZOOM_CINEMATIC;
else if(CarZoomIndicator > CAM_ZOOM_CINEMATIC) CarZoomIndicator = CAM_ZOOM_1STPRS; else if(CarZoomIndicator > CAM_ZOOM_CINEMATIC) CarZoomIndicator = CAM_ZOOM_1STPRS;
@ -812,7 +812,7 @@ CCamera::CamControl(void)
else else
PedZoomIndicator = CAM_ZOOM_TOPDOWN; PedZoomIndicator = CAM_ZOOM_TOPDOWN;
}else }else
PedZoomIndicator -= 1.0f; PedZoomIndicator--;
} }
if(CPad::GetPad(0)->CycleCameraModeDownJustDown() && !CReplay::IsPlayingBack() && if(CPad::GetPad(0)->CycleCameraModeDownJustDown() && !CReplay::IsPlayingBack() &&
(m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) && (m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) &&
@ -823,7 +823,7 @@ CCamera::CamControl(void)
else else
PedZoomIndicator = CAM_ZOOM_TOPDOWN; PedZoomIndicator = CAM_ZOOM_TOPDOWN;
}else }else
PedZoomIndicator += 1.0f; PedZoomIndicator++;
} }
// disabled obbe's cam here // disabled obbe's cam here
if(PedZoomIndicator < CAM_ZOOM_1) PedZoomIndicator = CAM_ZOOM_TOPDOWN; if(PedZoomIndicator < CAM_ZOOM_1) PedZoomIndicator = CAM_ZOOM_TOPDOWN;
@ -1223,7 +1223,7 @@ CCamera::CamControl(void)
ReqMode == CCam::MODE_1STPERSON_RUNABOUT || ReqMode == CCam::MODE_M16_1STPERSON_RUNABOUT || ReqMode == CCam::MODE_1STPERSON_RUNABOUT || ReqMode == CCam::MODE_M16_1STPERSON_RUNABOUT ||
ReqMode == CCam::MODE_FIGHT_CAM_RUNABOUT || ReqMode == CCam::MODE_HELICANNON_1STPERSON || ReqMode == CCam::MODE_FIGHT_CAM_RUNABOUT || ReqMode == CCam::MODE_HELICANNON_1STPERSON ||
WhoIsInControlOfTheCamera == CAMCONTROL_SCRIPT || WhoIsInControlOfTheCamera == CAMCONTROL_SCRIPT ||
m_bJustCameOutOfGarage || m_bPlayerIsInGarage) m_bJustCameOutOfGarage || m_bPlayerIsInGarage)
canUseObbeCam = false; canUseObbeCam = false;
if(m_bObbeCinematicPedCamOn && canUseObbeCam) if(m_bObbeCinematicPedCamOn && canUseObbeCam)
@ -1468,9 +1468,9 @@ CCamera::CamControl(void)
// Ped visibility // Ped visibility
if((Cams[ActiveCam].Mode == CCam::MODE_1STPERSON || if((Cams[ActiveCam].Mode == CCam::MODE_1STPERSON ||
Cams[ActiveCam].Mode == CCam::MODE_SNIPER || Cams[ActiveCam].Mode == CCam::MODE_SNIPER ||
Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON || Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON ||
Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER) && pTargetEntity->IsPed() || Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER) && pTargetEntity->IsPed() ||
Cams[ActiveCam].Mode == CCam::MODE_FLYBY) Cams[ActiveCam].Mode == CCam::MODE_FLYBY)
FindPlayerPed()->bIsVisible = false; FindPlayerPed()->bIsVisible = false;
else else
@ -1524,7 +1524,7 @@ CCamera::UpdateTargetEntity(void)
cantOpen = false; cantOpen = false;
if(PLAYER->GetPedState() == PED_ENTER_CAR && !cantOpen){ if(PLAYER->GetPedState() == PED_ENTER_CAR && !cantOpen){
if(!enteringCar && CarZoomIndicator != 0.0f){ if(!enteringCar && CarZoomIndicator != CAM_ZOOM_1STPRS){
pTargetEntity = PLAYER->m_pMyVehicle; pTargetEntity = PLAYER->m_pMyVehicle;
if(PLAYER->m_pMyVehicle == nil) if(PLAYER->m_pMyVehicle == nil)
pTargetEntity = PLAYER; pTargetEntity = PLAYER;
@ -1532,7 +1532,7 @@ CCamera::UpdateTargetEntity(void)
} }
if((PLAYER->GetPedState() == PED_CARJACK || PLAYER->GetPedState() == PED_OPEN_DOOR) && !cantOpen){ if((PLAYER->GetPedState() == PED_CARJACK || PLAYER->GetPedState() == PED_OPEN_DOOR) && !cantOpen){
if(!enteringCar && CarZoomIndicator != 0.0f) if(!enteringCar && CarZoomIndicator != CAM_ZOOM_1STPRS)
#ifdef GTA_PS2_STUFF #ifdef GTA_PS2_STUFF
// dunno if this has any amazing effects // dunno if this has any amazing effects
{ {
@ -1549,7 +1549,7 @@ CCamera::UpdateTargetEntity(void)
pTargetEntity = FindPlayerPed(); pTargetEntity = FindPlayerPed();
if(PLAYER->GetPedState() == PED_DRAG_FROM_CAR) if(PLAYER->GetPedState() == PED_DRAG_FROM_CAR)
pTargetEntity = FindPlayerPed(); pTargetEntity = FindPlayerPed();
if(pTargetEntity->IsVehicle() && CarZoomIndicator != 0.0f && FindPlayerPed()->GetPedState() == PED_ARRESTED) if(pTargetEntity->IsVehicle() && CarZoomIndicator != CAM_ZOOM_1STPRS && FindPlayerPed()->GetPedState() == PED_ARRESTED)
pTargetEntity = FindPlayerPed(); pTargetEntity = FindPlayerPed();
} }
} }
@ -1566,15 +1566,15 @@ CCamera::UpdateSoundDistances(void)
int n; int n;
if((Cams[ActiveCam].Mode == CCam::MODE_1STPERSON || if((Cams[ActiveCam].Mode == CCam::MODE_1STPERSON ||
Cams[ActiveCam].Mode == CCam::MODE_SNIPER || Cams[ActiveCam].Mode == CCam::MODE_SNIPER ||
Cams[ActiveCam].Mode == CCam::MODE_SNIPER_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_SNIPER_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_1STPERSON_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_1STPERSON_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_FIGHT_CAM_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_FIGHT_CAM_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_HELICANNON_1STPERSON || Cams[ActiveCam].Mode == CCam::MODE_HELICANNON_1STPERSON ||
Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON || Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON ||
Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER) && Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER) &&
pTargetEntity->IsPed()) pTargetEntity->IsPed())
center = GetPosition() + 0.5f*GetForward(); center = GetPosition() + 0.5f*GetForward();
else else
@ -1856,14 +1856,14 @@ CCamera::StartTransition(int16 newMode)
m_bUseTransitionBeta = false; m_bUseTransitionBeta = false;
if((Cams[ActiveCam].Mode == CCam::MODE_SNIPER || if((Cams[ActiveCam].Mode == CCam::MODE_SNIPER ||
Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER || Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER ||
Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON || Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON ||
Cams[ActiveCam].Mode == CCam::MODE_SNIPER_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_SNIPER_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_M16_1STPERSON_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_FIGHT_CAM_RUNABOUT || Cams[ActiveCam].Mode == CCam::MODE_FIGHT_CAM_RUNABOUT ||
Cams[ActiveCam].Mode == CCam::MODE_HELICANNON_1STPERSON || Cams[ActiveCam].Mode == CCam::MODE_HELICANNON_1STPERSON ||
Cams[ActiveCam].Mode == CCam::MODE_1STPERSON_RUNABOUT) && Cams[ActiveCam].Mode == CCam::MODE_1STPERSON_RUNABOUT) &&
pTargetEntity->IsPed()){ pTargetEntity->IsPed()){
float angle = CGeneral::GetATanOfXY(Cams[ActiveCam].Front.x, Cams[ActiveCam].Front.y) - HALFPI; float angle = CGeneral::GetATanOfXY(Cams[ActiveCam].Front.x, Cams[ActiveCam].Front.y) - HALFPI;
((CPed*)pTargetEntity)->m_fRotationCur = angle; ((CPed*)pTargetEntity)->m_fRotationCur = angle;
@ -2184,12 +2184,12 @@ CCamera::DrawBordersForWideScreen(void)
CSprite2d::DrawRect( CSprite2d::DrawRect(
CRect(0.0f, (SCREEN_HEIGHT/2) * m_ScreenReductionPercentage/100.0f - 8.0f, CRect(0.0f, (SCREEN_HEIGHT/2) * m_ScreenReductionPercentage/100.0f - 8.0f,
SCREEN_WIDTH, 0.0f), SCREEN_WIDTH, 0.0f),
CRGBA(0, 0, 0, 255)); CRGBA(0, 0, 0, 255));
CSprite2d::DrawRect( CSprite2d::DrawRect(
CRect(0.0f, SCREEN_HEIGHT, CRect(0.0f, SCREEN_HEIGHT,
SCREEN_WIDTH, SCREEN_HEIGHT - (SCREEN_HEIGHT/2) * m_ScreenReductionPercentage/100.0f - 8.0f), SCREEN_WIDTH, SCREEN_HEIGHT - (SCREEN_HEIGHT/2) * m_ScreenReductionPercentage/100.0f - 8.0f),
CRGBA(0, 0, 0, 255)); CRGBA(0, 0, 0, 255));
} }
@ -2631,8 +2631,8 @@ CCamera::ProcessObbeCinemaCameraCar(void)
if(!bDidWeProcessAnyCinemaCam || IsItTimeForNewcam(SequenceOfCams[OldMode], TimeForNext)){ if(!bDidWeProcessAnyCinemaCam || IsItTimeForNewcam(SequenceOfCams[OldMode], TimeForNext)){
// This is very strange code... // This is very strange code...
for(OldMode = (OldMode+1) % 14; for(OldMode = (OldMode+1) % 14;
!TryToStartNewCamMode(SequenceOfCams[OldMode]) && i <= 14; !TryToStartNewCamMode(SequenceOfCams[OldMode]) && i <= 14;
OldMode = (OldMode+1) % 14) OldMode = (OldMode+1) % 14)
i++; i++;
TimeForNext = CTimer::GetTimeInMilliseconds(); TimeForNext = CTimer::GetTimeInMilliseconds();
if(i >= 14){ if(i >= 14){
@ -2659,8 +2659,8 @@ CCamera::ProcessObbeCinemaCameraPed(void)
if(!bDidWeProcessAnyCinemaCam || IsItTimeForNewcam(SequenceOfPedCams[PedOldMode], PedTimeForNext)){ if(!bDidWeProcessAnyCinemaCam || IsItTimeForNewcam(SequenceOfPedCams[PedOldMode], PedTimeForNext)){
for(PedOldMode = (PedOldMode+1) % 5; for(PedOldMode = (PedOldMode+1) % 5;
!TryToStartNewCamMode(SequenceOfPedCams[PedOldMode]); !TryToStartNewCamMode(SequenceOfPedCams[PedOldMode]);
PedOldMode = (PedOldMode+1) % 5); PedOldMode = (PedOldMode+1) % 5);
PedTimeForNext = CTimer::GetTimeInMilliseconds(); PedTimeForNext = CTimer::GetTimeInMilliseconds();
} }
bDidWeProcessAnyCinemaCam = true; bDidWeProcessAnyCinemaCam = true;
@ -2813,11 +2813,11 @@ CCamera::Process_Train_Camera_Control(void)
uint32 node = m_iCurrentTrainCamNode; uint32 node = m_iCurrentTrainCamNode;
for(i = 0; i < m_uiNumberOfTrainCamNodes && !found; i++){ for(i = 0; i < m_uiNumberOfTrainCamNodes && !found; i++){
if(target->IsWithinArea(m_arrTrainCamNode[node].m_cvecMinPointInRange.x, if(target->IsWithinArea(m_arrTrainCamNode[node].m_cvecMinPointInRange.x,
m_arrTrainCamNode[node].m_cvecMinPointInRange.y, m_arrTrainCamNode[node].m_cvecMinPointInRange.y,
m_arrTrainCamNode[node].m_cvecMinPointInRange.z, m_arrTrainCamNode[node].m_cvecMinPointInRange.z,
m_arrTrainCamNode[node].m_cvecMaxPointInRange.x, m_arrTrainCamNode[node].m_cvecMaxPointInRange.x,
m_arrTrainCamNode[node].m_cvecMaxPointInRange.y, m_arrTrainCamNode[node].m_cvecMaxPointInRange.y,
m_arrTrainCamNode[node].m_cvecMaxPointInRange.z)){ m_arrTrainCamNode[node].m_cvecMaxPointInRange.z)){
m_iCurrentTrainCamNode = node; m_iCurrentTrainCamNode = node;
found = true; found = true;
} }

View File

@ -16,12 +16,15 @@ enum
}; };
#define DEFAULT_NEAR (0.9f) #define DEFAULT_NEAR (0.9f)
#define CAM_ZOOM_1STPRS (0.0f) enum
#define CAM_ZOOM_1 (1.0f) {
#define CAM_ZOOM_2 (2.0f) CAM_ZOOM_1STPRS,
#define CAM_ZOOM_3 (3.0f) CAM_ZOOM_1,
#define CAM_ZOOM_TOPDOWN (4.0f) CAM_ZOOM_2,
#define CAM_ZOOM_CINEMATIC (5.0f) CAM_ZOOM_3,
CAM_ZOOM_TOPDOWN,
CAM_ZOOM_CINEMATIC,
};
#ifdef FREE_CAM // LCS values #ifdef FREE_CAM // LCS values
#define FREE_CAR_ZOOM_VALUE_1 (-1.0f) #define FREE_CAR_ZOOM_VALUE_1 (-1.0f)
@ -412,7 +415,11 @@ uint32 unknown; // some counter having to do with music
float CamFrontXNorm; float CamFrontXNorm;
float CamFrontYNorm; float CamFrontYNorm;
#if 0 // TODO: FIX_BUGS once GenericLoad is done
int32 CarZoomIndicator;
#else
float CarZoomIndicator; float CarZoomIndicator;
#endif
float CarZoomValue; float CarZoomValue;
float CarZoomValueSmooth; float CarZoomValueSmooth;
@ -448,7 +455,11 @@ uint32 unknown; // some counter having to do with music
float m_ScreenReductionSpeed; float m_ScreenReductionSpeed;
float m_AlphaForPlayerAnim1rstPerson; float m_AlphaForPlayerAnim1rstPerson;
float Orientation; float Orientation;
#if 0 // TODO: FIX_BUGS once GenericLoad is done
int32 PedZoomIndicator;
#else
float PedZoomIndicator; float PedZoomIndicator;
#endif
float PlayerExhaustion; float PlayerExhaustion;
float SoundDistUp, SoundDistLeft, SoundDistRight; float SoundDistUp, SoundDistLeft, SoundDistRight;
float SoundDistUpAsRead, SoundDistLeftAsRead, SoundDistRightAsRead; float SoundDistUpAsRead, SoundDistLeftAsRead, SoundDistRightAsRead;