3#include <game/bases/d_actor.hpp>
127 if (!dCc_c::msIsInitialized) {
128 dCc_c::msInitializedUnkClass.b = 0xa000a0;
129 dCc_c::msInitializedUnkClass.c = 0xa00000a0;
130 dCc_c::msIsInitialized =
true;
135 static char msIsInitialized;
172 u16
isHit(u16 mask)
const;
202 float getTrpOffset(
int idx) {
246 static int _lineCheckUD(
mVec2_c p1,
mVec2_c p2,
float p3,
float p4);
252 static int _lineCheckLR(
mVec2_c p1,
mVec2_c p2,
float p3,
float p4);
Collider ("Collision Check") class - handles collisions between actors.
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.
u8 mFlag
Flags for this collider. See CC_FLAG_e .
static bool checkCollision(dCc_c *c1, dCc_c *c2, int active)
Checks for collisions between two colliders.
u8 mNonCollideMask
The non-collide mask for this collider.
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.
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.
@ CC_SHAPE_BOX
Rectangular collider.
@ CC_SHAPE_DAIKEI_UD
Trapezoid-shaped collider (left/right sides are parallel)
@ CC_SHAPE_DAIKEI_LR
Trapezoid-shaped collider (top/bottom sides are parallel)
@ CC_SHAPE_CIRCLE
Circular / elliptical collider.
void registerCc(dActor_c *actor, CcData_s *collInfo)
Registers an owner actor to this collider and sets the collider data.
CcData_s mCcData
The collision data of this collider.
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.
@ CC_DATA_NO_OFFSET
Don't set the collision offset if a collision occurs.
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 * mFriendActor
A second actor that this collider will not collide with.
void release()
Removes this collider from the collider list.
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.
@ CC_DISABLE
Disables all collisions with 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 *, dCc_c *)
The callback to execute when a collision occurs.
float mHeight
The height of the collider.
u32 mAttackCategoryInteract
Which attack categories this collider should be able to receive.
u8 mAttackCategory
The attack category of this collider. See CC_ATTACK_e .
float mOffsetX
The X offset of the collider.
u32 mCategoryInteract
Which categories this collider should be able to collide with.
float mWidth
The width of the collider.
u16 mFlag
Flags for this collider. See CC_DATA_FLAG_e .
float mOffsetY
The Y offset of the collider.
u8 mCategory
The category of this collider. See CC_CATEGORY_e .