2023-12-13 00:40:16 -05:00
|
|
|
#include "Game/Map/CollisionCategorizedKeeper.hpp"
|
|
|
|
|
#include "Game/Map/CollisionParts.hpp"
|
2022-01-04 00:11:21 +01:00
|
|
|
|
|
|
|
|
TVec3f CollisionParts::getTrans() {
|
|
|
|
|
TVec3f translation;
|
2022-01-04 01:38:24 +01:00
|
|
|
mBaseMatrix.getTransInline(translation);
|
2022-01-04 00:11:21 +01:00
|
|
|
|
|
|
|
|
return translation;
|
|
|
|
|
}
|
2021-12-21 04:02:22 -05:00
|
|
|
|
|
|
|
|
void CollisionCategorizedKeeper::addToZone(CollisionParts *pParts, s32 zone) {
|
|
|
|
|
mZones[zone]->addParts(pParts);
|
|
|
|
|
mZoneCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CollisionCategorizedKeeper::removeFromZone(CollisionParts *pParts, s32 zone) {
|
|
|
|
|
mZones[zone]->eraseParts(pParts);
|
|
|
|
|
mZoneCount--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CollisionCategorizedKeeper::addToGlobal(CollisionParts *pParts) {
|
|
|
|
|
mZones[0]->addParts(pParts);
|
|
|
|
|
mZoneCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CollisionCategorizedKeeper::removeFromGlobal(CollisionParts *pParts) {
|
|
|
|
|
mZones[0]->eraseParts(pParts);
|
|
|
|
|
mZoneCount--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CollisionZone::CollisionZone(s32 zoneID)
|
|
|
|
|
: mZoneID(zoneID), mNumParts(0), _808(0, 0, 0), mRadius(0.0f), _818(0, 0, 0), _824(0, 0, 0) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CollisionZone::addParts(CollisionParts* pParts) {
|
|
|
|
|
s32 cnt = mNumParts;
|
|
|
|
|
mNumParts++;
|
|
|
|
|
mPartsArray[cnt] = pParts;
|
|
|
|
|
|
|
|
|
|
if (mZoneID) {
|
|
|
|
|
calcMinMaxAndRadius();
|
|
|
|
|
}
|
|
|
|
|
}
|