3#include <game/mLib/m_vec.hpp>
16enum CC_STATUS_FLAG_e {
18 CC_STATUS_NO_REVISION = BIT_FLAG(0),
24 CC_STATUS_NO_PASS_INFO = BIT_FLAG(2),
29 CC_NO_HIT = BIT_FLAG(1),
39 CC_KIND_PLAYER_ATTACK,
61 CC_ATTACK_PENGUIN_SLIDE,
67 CC_ATTACK_YOSHI_MOUTH,
69 CC_ATTACK_SPIN_LIFT_UP,
70 CC_ATTACK_YOSHI_BULLET,
116 U32Holder(u32 value) : mValue(value) {}
163 u16
isHit(u16 mask)
const;
193 float getTrpOffset(
int idx) {
218 float getCollPosX()
const {
return mCollPos.x; }
219 float getCollPosY()
const {
return mCollPos.y; }
240 static int _lineCheckUD(mVec2_c p1, mVec2_c p2,
float p3,
float p4);
246 static int _lineCheckLR(mVec2_c p1, mVec2_c p2,
float p3,
float p4);
The minimum required implementation for a stage actor.
Collider ("Collision Check") class - handles collisions between actors.
void set(dActor_c *actor, sCcDatNewF *collInfo)
Registers an owner actor to this collider and sets the collider data.
mVec2_c getCenterVec()
Gets the center of the collider as a vector.
static bool _hitCheckSquare(dCc_c *c1, dCc_c *c2, mVec2_c pos1, mVec2_c pos2)
A hit check function for rectangular colliders. Used in _hitCheckNormal and _hitCheckLoop.
bool mIsLinked
Whether this collider has been placed in the collider list.
static bool checkCollision(dCc_c *c1, dCc_c *c2, int active)
Checks for collisions between two colliders.
static bool _hitCheckDaikeiUD_R(dCc_c *ccBox, dCc_c *ccTrp)
Check a rectangular collider against a trapezoid-shaped collider for collisions.
dActor_c * mpOwner
The actor this collider belongs to.
float getUnderPos()
Gets the Y position of the bottom of the collider.
static bool _hitCheckLoop(dCc_c *c1, dCc_c *c2)
Check two rectangular colliders against each other for collisions with stage looping.
float getTopPos()
Gets the Y position of the top of the collider.
static dCc_c * mEntryN
The first collider in the list.
u16 isHitAtDmg(u16 mask) const
Gets the result of an attack hit check.
u8 mInfo
Info flags for this collider. See CC_INFO_e.
float mTrpOffsets[4]
The X or Y offset of the four corners of a trapezoid-shaped collider.
dCc_c * mpPrev
The previous collider in the list.
void clear()
Clear the data related to previous collisions.
float getCenterPosY()
Gets the Y position of the center of the collider.
float mCollOffsetY[8]
The Y offset for a collision.
void entry()
Places this collider in the collider list.
u16 mCollidedWith
The categories of the previously collided with colliders.
u8 mShape
The shape of the collider. See CC_SHAPE_e .
u16 mAttSent
The attack types sent by this collider in the previous collisions.
u16 isHit(u16 mask) const
Gets the result of a hit check.
static hitCheck _hitCheck[4][4]
The hit check function for each combination of collider shapes.
u16 mAttReceived
The attack types received by this collider in the previous collisions.
u8 mLayer
The layer this collider is on.
float getCenterPosX()
Gets the X position of the center of the collider.
static bool _hitCheckCircle(dCc_c *c1, dCc_c *c2)
Check two circle colliders against each other for collisions.
float getLeftPos()
Gets the X position of the left side of the collider.
mVec2_c mCollPos
The position where the last collision occurred.
float getRightPos()
Gets the X position of the right side of the collider.
static bool _hitCheckDaikeiLR_R(dCc_c *ccBox, dCc_c *ccTrp)
Check a rectangular collider against a trapezoid-shaped collider for collisions.
virtual ~dCc_c()
Destroys the collider.
static void execute()
Check all colliders against each other for collisions.
dActor_c * getOwner() const
Gets the owner actor of this collider.
dActor_c * mFriendActor
A second actor that this collider will not collide with.
void release()
Removes this collider from the collider list.
sCcDatNewF mCcData
The collision data of this collider.
float mCollOffsetX[8]
The X offset for a collision.
static bool _hitCheckDaikeiLR(dCc_c *ccTrp, dCc_c *ccBox)
Check a trapezoid-shaped collider against a rectangular collider for collisions.
u8 mAmiLine
The non-collide mask for this collider.
void setFriendActor(dActor_c *actor)
Sets a friend actor for this collider.
static bool _hitCheckBoxCircle(dCc_c *c1, dCc_c *c2)
Check a rectangular and a circle collider against each other for collisions.
static void reset()
Clears the collider list.
dCc_c * mpNext
The next collider in the list.
dCc_c()
Constructs a new collider.
static dCc_c * mEntryB
The last collider in the list.
static bool _hitCheckNormal(dCc_c *c1, dCc_c *c2)
Check two rectangular colliders against each other for collisions without stage looping.
static bool _hitCheckDaikeiUD(dCc_c *ccTrp, dCc_c *ccBox)
Check a trapezoid-shaped collider against a rectangular collider for collisions.
bool isInside(dCc_c *other)
Checks if this collider is inside another collider.
A two-dimensional floating point vector.
A structure that contains information about a collider.
void(* mCallback)(dCc_c *self, dCc_c *target)
The callback to execute when a collision occurs.
u8 mKind
The type of this collider. See CC_KIND_e.
u8 mAttack
The attack type of this collider. See CC_ATTACK_e.
u16 mStatus
Status flags for this collider. See CC_STATUS_FLAG_e.
mVec2_POD_c mOffset
The offset of the collider.
u32 mVsKind
Which attack types this collider should be able to receive. This is a bitfield with the bits enumerat...