1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 17:00:01 +00:00

garage cam fix

This commit is contained in:
aap 2020-12-26 13:45:53 +01:00
parent c9c447e7a9
commit b41f93fcd6
2 changed files with 31 additions and 27 deletions

View file

@ -1137,27 +1137,31 @@ CCamera::CamControl(void)
}else{ }else{
whichDoor = 1; whichDoor = 1;
garageDoorPos1 = Cams[ActiveCam].Source; garageDoorPos1 = Cams[ActiveCam].Source;
garageCenter = CVector((stairsZone->minx+stairsZone->maxx)/2.0f, (stairsZone->miny+stairsZone->maxy)/2.0f, 0.0f);
if(pTargetEntity->GetPosition().x > 376.0f && pTargetEntity->GetPosition().x < 383.0f && if(stairsZone){ // always true
pTargetEntity->GetPosition().y > -496.0f && pTargetEntity->GetPosition().y < -489.0f && garageCenter = CVector((stairsZone->minx+stairsZone->maxx)/2, (stairsZone->miny+stairsZone->maxy)/2, 0.0f);
pTargetEntity->GetPosition().z > 11.6f && pTargetEntity->GetPosition().z < 13.6f){ if(pTargetEntity->GetPosition().x > 376.0f && pTargetEntity->GetPosition().x < 383.0f &&
// if((garageCenter-garageDoorPos1).Magnitude() > 15.0f){ pTargetEntity->GetPosition().y > -496.0f && pTargetEntity->GetPosition().y < -489.0f &&
bool bClearViewOutside = true; pTargetEntity->GetPosition().z > 11.6f && pTargetEntity->GetPosition().z < 13.6f){
CVector dirOutside = pTargetEntity->GetPosition() - garageCenter; garageDoorPos1 = CVector(382.6f, -489.6f, 13.1f);
dirOutside.z = 0.0f; }else{
dirOutside.Normalise(); bool bClearViewOutside = true;
float zoneDim = stairsZone->maxx - stairsZone->minx; CVector dirOutside = pTargetEntity->GetPosition() - garageCenter;
if(zoneDim < stairsZone->maxy - stairsZone->miny) dirOutside.z = 0.0f;
zoneDim = stairsZone->maxy - stairsZone->miny; dirOutside.Normalise();
zoneDim *= 2.0f; float zoneDim = stairsZone->maxx - stairsZone->minx;
CVector posOutside = pTargetEntity->GetPosition() + zoneDim*dirOutside; if(zoneDim < stairsZone->maxy - stairsZone->miny)
if(!CWorld::GetIsLineOfSightClear(pTargetEntity->GetPosition(), posOutside, true, false, false, false, false, false, true)){ zoneDim = stairsZone->maxy - stairsZone->miny;
posOutside = pTargetEntity->GetPosition() - zoneDim*dirOutside; zoneDim *= 2.0f;
if(!CWorld::GetIsLineOfSightClear(pTargetEntity->GetPosition(), posOutside, true, false, false, false, false, false, true)) CVector posOutside = pTargetEntity->GetPosition() + zoneDim*dirOutside;
bClearViewOutside = false; if(!CWorld::GetIsLineOfSightClear(pTargetEntity->GetPosition(), posOutside, true, false, false, false, false, false, true)){
posOutside = pTargetEntity->GetPosition() - zoneDim*dirOutside;
if(!CWorld::GetIsLineOfSightClear(pTargetEntity->GetPosition(), posOutside, true, false, false, false, false, false, true))
bClearViewOutside = false;
}
if(bClearViewOutside)
garageDoorPos1 = posOutside;
} }
if(bClearViewOutside)
garageDoorPos1 = posOutside;
} }
} }
@ -1167,7 +1171,7 @@ CCamera::CamControl(void)
garageCenter.z = 0.0f; garageCenter.z = 0.0f;
}else{ }else{
garageDoorPos1.z = 0.0f; garageDoorPos1.z = 0.0f;
if(stairs == nil) // how can this be true? if(!stairs) // how can this be true?
garageCenter = CVector(pTargetEntity->GetPosition().x, pTargetEntity->GetPosition().y, 0.0f); garageCenter = CVector(pTargetEntity->GetPosition().x, pTargetEntity->GetPosition().y, 0.0f);
} }
if(whichDoor == 1) if(whichDoor == 1)

View file

@ -17,12 +17,12 @@ enum eZoneAttribs
struct CAttributeZone struct CAttributeZone
{ {
float minx; int16 minx;
float maxx; int16 maxx;
float miny; int16 miny;
float maxy; int16 maxy;
float minz; int16 minz;
float maxz; int16 maxz;
int16 attributes; int16 attributes;
int16 wantedLevel; int16 wantedLevel;
}; };