mirror of
https://github.com/GTAmodding/re3.git
synced 2025-07-18 14:14:08 +00:00
CEntity done; C(Vu)Vector fixes and cleanup
This commit is contained in:
parent
fb03ee45b5
commit
e014bb5359
18 changed files with 249 additions and 89 deletions
|
@ -4103,16 +4103,11 @@ CCamera::IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat
|
|||
bool
|
||||
CCamera::IsSphereVisible(const CVector ¢er, float radius)
|
||||
{
|
||||
CMatrix mat = m_cameraMatrix;
|
||||
return IsSphereVisible(center, radius, &mat);
|
||||
return IsSphereVisible(center, radius, &m_cameraMatrix);
|
||||
}
|
||||
|
||||
bool
|
||||
#ifdef GTA_PS2
|
||||
CCamera::IsBoxVisible(CVuVector *box, const CMatrix *mat)
|
||||
#else
|
||||
CCamera::IsBoxVisible(CVector *box, const CMatrix *mat)
|
||||
#endif
|
||||
CCamera::IsBoxVisible(CVUVECTOR *box, const CMatrix *mat)
|
||||
{
|
||||
int i;
|
||||
int frustumTests[6] = { 0 };
|
||||
|
|
|
@ -634,11 +634,7 @@ public:
|
|||
bool IsPointVisible(const CVector ¢er, const CMatrix *mat);
|
||||
bool IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat);
|
||||
bool IsSphereVisible(const CVector ¢er, float radius);
|
||||
#ifdef GTA_PS2
|
||||
bool IsBoxVisible(CVuVector *box, const CMatrix *mat);
|
||||
#else
|
||||
bool IsBoxVisible(CVector *box, const CMatrix *mat);
|
||||
#endif
|
||||
bool IsBoxVisible(CVUVECTOR *box, const CMatrix *mat);
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(CCamera, 0xE9D8);
|
||||
|
|
|
@ -39,9 +39,7 @@ CEntity::RegisterReference(CEntity **pent)
|
|||
ref->pentity = pent;
|
||||
ref->next = m_pFirstReference;
|
||||
m_pFirstReference = ref;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Clean up the reference from *pent -> 'this'
|
||||
|
|
|
@ -1906,16 +1906,7 @@ CWorld::Process(void)
|
|||
for(int i = 0; i < NUMCUTSCENEOBJECTS; i++) {
|
||||
CCutsceneObject *csObj = CCutsceneMgr::GetCutsceneObject(i);
|
||||
if(csObj && csObj->m_entryInfoList.first) {
|
||||
if(csObj->m_rwObject && RwObjectGetType(csObj->m_rwObject) == rpCLUMP &&
|
||||
RpAnimBlendClumpGetFirstAssociation(csObj->GetClump())) {
|
||||
if (csObj->IsObject())
|
||||
RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), CTimer::GetTimeStepNonClippedInSeconds());
|
||||
else {
|
||||
if (!csObj->bOffscreen)
|
||||
csObj->bOffscreen = !csObj->GetIsOnScreen();
|
||||
RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), CTimer::GetTimeStepInSeconds(), !csObj->bOffscreen);
|
||||
}
|
||||
}
|
||||
csObj->UpdateAnim();
|
||||
csObj->ProcessControl();
|
||||
csObj->ProcessCollision();
|
||||
csObj->GetMatrix().UpdateRW();
|
||||
|
@ -1927,26 +1918,40 @@ CWorld::Process(void)
|
|||
} else {
|
||||
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
||||
CEntity *movingEnt = (CEntity *)node->item;
|
||||
if(!movingEnt->bRemoveFromWorld && movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP &&
|
||||
RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) {
|
||||
if (movingEnt->IsObject())
|
||||
RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), CTimer::GetTimeStepNonClippedInSeconds());
|
||||
else {
|
||||
if (!movingEnt->bOffscreen)
|
||||
movingEnt->bOffscreen = !movingEnt->GetIsOnScreen();
|
||||
RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), CTimer::GetTimeStepInSeconds(), !movingEnt->bOffscreen);
|
||||
}
|
||||
}
|
||||
if(!movingEnt->bRemoveFromWorld)
|
||||
movingEnt->UpdateAnim();
|
||||
}
|
||||
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
||||
CPhysical *movingEnt = (CPhysical *)node->item;
|
||||
if(movingEnt->bRemoveFromWorld) {
|
||||
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
||||
} else {
|
||||
movingEnt->ProcessControl();
|
||||
if(!CCutsceneMgr::IsCutsceneProcessing() || movingEnt->UpdatesInCutscene())
|
||||
movingEnt->ProcessControl();
|
||||
if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||
}
|
||||
}
|
||||
for(int y = 0; y < NUMSECTORS_Y; y++)
|
||||
for(int x = 0; x < NUMSECTORS_X; x++){
|
||||
CPtrNode *node;
|
||||
CSector *sect = CWorld::GetSector(x, y);
|
||||
for(node = sect->m_lists[ENTITYLIST_PEDS].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_PEDS_OVERLAP].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_VEHICLES].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_VEHICLES_OVERLAP].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_OBJECTS].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_OBJECTS_OVERLAP].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_DUMMIES].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
for(node = sect->m_lists[ENTITYLIST_DUMMIES_OVERLAP].first; node; node = node->next)
|
||||
((CEntity*)node->item)->UpdateDistanceFade();
|
||||
}
|
||||
bForceProcessControl = true;
|
||||
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
||||
CPhysical *movingEnt = (CPhysical *)node->item;
|
||||
|
|
|
@ -29,6 +29,7 @@ enum
|
|||
{
|
||||
ENTITYLIST_BUILDINGS,
|
||||
ENTITYLIST_BUILDINGS_OVERLAP,
|
||||
ENTITYLIST_UNKNOWN,
|
||||
ENTITYLIST_OBJECTS,
|
||||
ENTITYLIST_OBJECTS_OVERLAP,
|
||||
ENTITYLIST_VEHICLES,
|
||||
|
|
|
@ -228,6 +228,12 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
|
|||
|
||||
#include "maths.h"
|
||||
#include "Vector.h"
|
||||
#ifdef GTA_PS2
|
||||
#include "VuVector.h"
|
||||
#define CVUVECTOR CVuVector
|
||||
#else
|
||||
#define CVUVECTOR CVector
|
||||
#endif
|
||||
#include "Vector2D.h"
|
||||
#include "Matrix.h"
|
||||
#include "Rect.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue