1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-05 10:55:54 +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{
whichDoor = 1;
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 &&
pTargetEntity->GetPosition().y > -496.0f && pTargetEntity->GetPosition().y < -489.0f &&
pTargetEntity->GetPosition().z > 11.6f && pTargetEntity->GetPosition().z < 13.6f){
// if((garageCenter-garageDoorPos1).Magnitude() > 15.0f){
bool bClearViewOutside = true;
CVector dirOutside = pTargetEntity->GetPosition() - garageCenter;
dirOutside.z = 0.0f;
dirOutside.Normalise();
float zoneDim = stairsZone->maxx - stairsZone->minx;
if(zoneDim < stairsZone->maxy - stairsZone->miny)
zoneDim = stairsZone->maxy - stairsZone->miny;
zoneDim *= 2.0f;
CVector posOutside = pTargetEntity->GetPosition() + zoneDim*dirOutside;
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(stairsZone){ // always true
garageCenter = CVector((stairsZone->minx+stairsZone->maxx)/2, (stairsZone->miny+stairsZone->maxy)/2, 0.0f);
if(pTargetEntity->GetPosition().x > 376.0f && pTargetEntity->GetPosition().x < 383.0f &&
pTargetEntity->GetPosition().y > -496.0f && pTargetEntity->GetPosition().y < -489.0f &&
pTargetEntity->GetPosition().z > 11.6f && pTargetEntity->GetPosition().z < 13.6f){
garageDoorPos1 = CVector(382.6f, -489.6f, 13.1f);
}else{
bool bClearViewOutside = true;
CVector dirOutside = pTargetEntity->GetPosition() - garageCenter;
dirOutside.z = 0.0f;
dirOutside.Normalise();
float zoneDim = stairsZone->maxx - stairsZone->minx;
if(zoneDim < stairsZone->maxy - stairsZone->miny)
zoneDim = stairsZone->maxy - stairsZone->miny;
zoneDim *= 2.0f;
CVector posOutside = pTargetEntity->GetPosition() + zoneDim*dirOutside;
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;
}else{
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);
}
if(whichDoor == 1)

View file

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