1
0
mirror of https://github.com/td512/re3.git synced 2026-04-20 12:06:09 +00:00

Merge branch 'miami' into lcs

# Conflicts:
#	src/control/Script.cpp
#	src/control/Script4.cpp
#	src/render/Weather.cpp
#	src/render/Weather.h
#	src/vehicles/Automobile.cpp
This commit is contained in:
Sergeanur
2021-01-20 19:32:03 +02:00
28 changed files with 510 additions and 329 deletions

View File

@@ -4056,9 +4056,17 @@ CCamera::CalculateDerivedValues(void)
bool
CCamera::IsPointVisible(const CVector &center, const CMatrix *mat)
{
RwV3d c;
c = center;
RwV3dTransformPoints(&c, &c, 1, &mat->m_matrix);
#ifdef GTA_PS2
CVuVector c;
TransformPoint(c, *mat, center);
#else
CVector c = center;
#ifdef FIX_BUGS
c = *mat * center;
#else
RwV3dTransformPoints(&c, &c, 1, (RwMatrix*)mat);
#endif
#endif
if(c.y < CDraw::GetNearClipZ()) return false;
if(c.y > CDraw::GetFarClipZ()) return false;
if(c.x*m_vecFrustumNormals[0].x + c.y*m_vecFrustumNormals[0].y > 0.0f) return false;
@@ -4071,9 +4079,17 @@ CCamera::IsPointVisible(const CVector &center, const CMatrix *mat)
bool
CCamera::IsSphereVisible(const CVector &center, float radius, const CMatrix *mat)
{
RwV3d c;
c = center;
RwV3dTransformPoints(&c, &c, 1, &mat->m_matrix);
#ifdef GTA_PS2
CVuVector c;
TransformPoint(c, *mat, center);
#else
CVector c = center;
#ifdef FIX_BUGS
c = *mat * center;
#else
RwV3dTransformPoints(&c, &c, 1, (RwMatrix*)mat);
#endif
#endif
if(c.y + radius < CDraw::GetNearClipZ()) return false;
if(c.y - radius > CDraw::GetFarClipZ()) return false;
if(c.x*m_vecFrustumNormals[0].x + c.y*m_vecFrustumNormals[0].y > radius) return false;
@@ -4091,11 +4107,24 @@ CCamera::IsSphereVisible(const CVector &center, float radius)
}
bool
CCamera::IsBoxVisible(RwV3d *box, const CMatrix *mat)
#ifdef GTA_PS2
CCamera::IsBoxVisible(CVuVector *box, const CMatrix *mat)
#else
CCamera::IsBoxVisible(CVector *box, const CMatrix *mat)
#endif
{
int i;
int frustumTests[6] = { 0 };
RwV3dTransformPoints(box, box, 8, &mat->m_matrix);
#ifdef GTA_PS2
TransformPoints(box, 8, *mat, box);
#else
#ifdef FIX_BUGS
for (i = 0; i < 8; i++)
box[i] = *mat * box[i];
#else
RwV3dTransformPoints(box, box, 8, (RwMatrix*)mat);
#endif
#endif
for(i = 0; i < 8; i++){
if(box[i].y < CDraw::GetNearClipZ()) frustumTests[0]++;