2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-14 08:46:09 +00:00

De-hardcode max entity count

This commit is contained in:
2021-06-06 16:53:41 -07:00
parent 89378700f7
commit 5f1aed51cb
64 changed files with 246 additions and 238 deletions

View File

@@ -38,14 +38,14 @@ void CGroundMovement::CheckFalling(CPhysicsActor& actor, CStateManager& mgr, flo
}
void CGroundMovement::MoveGroundCollider(CStateManager& mgr, CPhysicsActor& actor, float dt,
const rstl::reserved_vector<TUniqueId, 1024>* nearList) {
const rstl::reserved_vector<TUniqueId, kMaxEntities>* nearList) {
CMotionState oldState = actor.GetMotionState();
CMotionState newState = actor.PredictMotion_Internal(dt);
float deltaMag = newState.x0_translation.magnitude();
TUniqueId idDetect = kInvalidUniqueId;
CCollisionInfoList collisionList;
zeus::CAABox motionVol = actor.GetMotionVolume(dt);
rstl::reserved_vector<TUniqueId, 1024> useColliderList;
rstl::reserved_vector<TUniqueId, kMaxEntities> useColliderList;
if (nearList != nullptr) {
useColliderList = *nearList;
}
@@ -114,7 +114,7 @@ void CGroundMovement::MoveGroundCollider(CStateManager& mgr, CPhysicsActor& acto
}
bool CGroundMovement::ResolveUpDown(CAreaCollisionCache& cache, CStateManager& mgr, CPhysicsActor& actor,
const CMaterialFilter& filter, rstl::reserved_vector<TUniqueId, 1024>& nearList,
const CMaterialFilter& filter, rstl::reserved_vector<TUniqueId, kMaxEntities>& nearList,
float stepUp, float stepDown, float& fOut, CCollisionInfoList& list) {
float zextent = stepDown;
if (list.GetCount() <= 0) {
@@ -178,7 +178,7 @@ bool CGroundMovement::ResolveUpDown(CAreaCollisionCache& cache, CStateManager& m
bool CGroundMovement::MoveGroundColliderZ(CAreaCollisionCache& cache, CStateManager& mgr, CPhysicsActor& actor,
const CMaterialFilter& filter,
rstl::reserved_vector<TUniqueId, 1024>& nearList, float amt, float& resolved,
rstl::reserved_vector<TUniqueId, kMaxEntities>& nearList, float amt, float& resolved,
CCollisionInfoList& list, TUniqueId& idOut) {
actor.MoveCollisionPrimitive({0.f, 0.f, amt});
@@ -238,7 +238,7 @@ bool CGroundMovement::MoveGroundColliderZ(CAreaCollisionCache& cache, CStateMana
void CGroundMovement::MoveGroundColliderXY(CAreaCollisionCache& cache, CStateManager& mgr, CPhysicsActor& actor,
const CMaterialFilter& filter,
rstl::reserved_vector<TUniqueId, 1024>& nearList, float dt) {
rstl::reserved_vector<TUniqueId, kMaxEntities>& nearList, float dt) {
bool didCollide = false;
bool isPlayer = actor.GetMaterialList().HasMaterial(EMaterialTypes::Player);
float remDt = dt;
@@ -335,9 +335,9 @@ zeus::CVector3f CGroundMovement::CollisionDamping(const zeus::CVector3f& vel, co
}
void CGroundMovement::MoveGroundCollider_New(CStateManager& mgr, CPhysicsActor& actor, float dt,
const rstl::reserved_vector<TUniqueId, 1024>* nearList) {
const rstl::reserved_vector<TUniqueId, kMaxEntities>* nearList) {
zeus::CAABox motionVol = actor.GetMotionVolume(dt);
rstl::reserved_vector<TUniqueId, 1024> useNearList;
rstl::reserved_vector<TUniqueId, kMaxEntities> useNearList;
if (nearList != nullptr) {
useNearList = *nearList;
} else {
@@ -638,7 +638,7 @@ static bool RemovePositiveZComponentFromNormal(zeus::CVector3f& vec) {
}
CMaterialList CGroundMovement::MoveObjectAnalytical(CStateManager& mgr, CPhysicsActor& actor, float dt,
rstl::reserved_vector<TUniqueId, 1024>& nearList,
rstl::reserved_vector<TUniqueId, kMaxEntities>& nearList,
CAreaCollisionCache& cache, const SMovementOptions& opts,
SMoveObjectResult& result) {
result.x6c_processedCollisions = 0;