Match and link CBallFilter

Former-commit-id: 5dc8a60233
This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-14 01:47:30 +03:00
parent 85358450a7
commit 7391174814
6 changed files with 54 additions and 2 deletions

View File

@ -240,7 +240,7 @@ LIBS = [
"MetroidPrime/Weapons/CPlasmaProjectile", "MetroidPrime/Weapons/CPlasmaProjectile",
"MetroidPrime/Player/CPlayerOrbit", "MetroidPrime/Player/CPlayerOrbit",
"MetroidPrime/CGameCollision", "MetroidPrime/CGameCollision",
"MetroidPrime/CBallFilter", ["MetroidPrime/CBallFilter", True],
"MetroidPrime/CAABoxFilter", "MetroidPrime/CAABoxFilter",
"MetroidPrime/CGroundMovement", "MetroidPrime/CGroundMovement",
"MetroidPrime/Enemies/CNewIntroBoss", "MetroidPrime/Enemies/CNewIntroBoss",

View File

@ -0,0 +1,12 @@
#ifndef _COLLISIONUTIL
#define _COLLISIONUTIL
class CCollisionInfoList;
namespace CollisionUtil {
void AddAverageToFront(const CCollisionInfoList& in, CCollisionInfoList& out);
} // namespace CollisionUtil
#endif // _COLLISIONUTIL

View File

@ -0,0 +1,15 @@
#ifndef _CBALLFILTER
#define _CBALLFILTER
#include "MetroidPrime/ICollisionFilter.hpp"
class CCollisionInfoList;
class CPhysicsActor;
class CBallFilter : public ICollisionFilter {
public:
explicit CBallFilter(CActor& actor) : ICollisionFilter(actor) {}
void Filter(const CCollisionInfoList& in, CCollisionInfoList& out) const;
};
#endif // _CBALLFILTER

View File

@ -0,0 +1,18 @@
#ifndef _ICOLLISIONFILTER
#define _ICOLLISIONFILTER
class CActor;
class CCollisionInfoList;
class ICollisionFilter {
CActor& x4_actor;
protected:
explicit ICollisionFilter(CActor& actor) : x4_actor(actor) {}
public:
virtual ~ICollisionFilter() {};
virtual void Filter(const CCollisionInfoList& in, CCollisionInfoList& out) const = 0;
};
#endif // _ICOLLISIONFILTER

View File

@ -207,7 +207,7 @@ METROIDPRIME :=\
$(BUILD_DIR)/asm/MetroidPrime/Weapons/CPlasmaProjectile.o\ $(BUILD_DIR)/asm/MetroidPrime/Weapons/CPlasmaProjectile.o\
$(BUILD_DIR)/asm/MetroidPrime/Player/CPlayerOrbit.o\ $(BUILD_DIR)/asm/MetroidPrime/Player/CPlayerOrbit.o\
$(BUILD_DIR)/asm/MetroidPrime/CGameCollision.o\ $(BUILD_DIR)/asm/MetroidPrime/CGameCollision.o\
$(BUILD_DIR)/asm/MetroidPrime/CBallFilter.o\ $(BUILD_DIR)/src/MetroidPrime/CBallFilter.o\
$(BUILD_DIR)/asm/MetroidPrime/CAABoxFilter.o\ $(BUILD_DIR)/asm/MetroidPrime/CAABoxFilter.o\
$(BUILD_DIR)/asm/MetroidPrime/CGroundMovement.o\ $(BUILD_DIR)/asm/MetroidPrime/CGroundMovement.o\
$(BUILD_DIR)/asm/MetroidPrime/Enemies/CNewIntroBoss.o\ $(BUILD_DIR)/asm/MetroidPrime/Enemies/CNewIntroBoss.o\

View File

@ -0,0 +1,7 @@
#include "MetroidPrime/CBallFilter.hpp"
#include "Collision/CollisionUtil.hpp"
void CBallFilter::Filter(const CCollisionInfoList& in, CCollisionInfoList& out) const {
CollisionUtil::AddAverageToFront(in, out);
}