|
NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <game/bases/d_cc.hpp>
Collider ("Collision Check") class - handles collisions between actors.
It also includes logic that handles collisions within a horizontally looping stage (like 2-C).
Classes | |
| class | U32Holder |
| < More... | |
| struct | GlobalData_t |
Public Member Functions | |
| dCc_c () | |
| Constructs a new collider. | |
| virtual | ~dCc_c () |
| Destroys the collider. | |
| void | clear () |
| Clear the data related to previous collisions. | |
| void | entry () |
| Places this collider in the collider list. | |
| void | release () |
| Removes this collider from the collider list. | |
| void | set (dActor_c *actor, sCcDatNewF *collInfo) |
| Registers an owner actor to this collider and sets the collider data. | |
| void | set (dActor_c *actor, sCcDatNewF *collInfo, u8 amiLine) |
| Registers an owner actor to this collider and sets the collider data. | |
| void | setFriendActor (dActor_c *actor) |
| Sets a friend actor for this collider. | |
| dActor_c * | getOwner () const |
| Gets the owner actor of this collider. | |
| u16 | isHit (u16 mask) const |
| Gets the result of a hit check. | |
| u16 | isHitAtDmg (u16 mask) const |
| Gets the result of an attack hit check. | |
| float | getTopPos () |
| Gets the Y position of the top of the collider. | |
| float | getUnderPos () |
| Gets the Y position of the bottom of the collider. | |
| float | getCenterPosY () |
| Gets the Y position of the center of the collider. | |
| float | getRightPos () |
| Gets the X position of the right side of the collider. | |
| float | getLeftPos () |
| Gets the X position of the left side of the collider. | |
| float | getCenterPosX () |
| Gets the X position of the center of the collider. | |
| mVec2_c | getCenterVec () |
| Gets the center of the collider as a vector. | |
| bool | isInside (dCc_c *other) |
| Checks if this collider is inside another collider. | |
| float | getCollPosX () const |
| float | getCollPosY () const |
| float | getXOffset (int idx) |
| float | getYOffset (int idx) |
Static Public Member Functions | |
| static bool | checkCollision (dCc_c *c1, dCc_c *c2, int active) |
| Checks for collisions between two colliders. | |
| static void | execute () |
| Check all colliders against each other for collisions. | |
| static void | reset () |
| Clears the collider list. | |
Public Attributes | |
| dActor_c * | mpOwner |
| The actor this collider belongs to. | |
| dActor_c * | mpFriendActor |
| A second actor that this collider will not collide with. | |
| u32 | unk2 |
| [Unused (?)]. | |
| dCc_c * | mpNext |
| The next collider in the list. | |
| dCc_c * | mpPrev |
| The previous collider in the list. | |
| u32 | mCanBounce |
| [used by Giant Wigglers to allow jumping]. | |
| sCcDatNewF | mCcData |
| The collision data of this collider. | |
| float | mTrpOffsets [4] |
| The X or Y offset of the four corners of a trapezoid-shaped collider. | |
| float | mCollOffsetX [CC_KIND_COUNT] |
| The X offset for a collision. | |
| float | mCollOffsetY [CC_KIND_COUNT] |
| The Y offset for a collision. | |
| mVec2_c | mCollPos |
| The position where the last collision occurred. | |
| u16 | mCollidedWith |
| The categories of the previously collided with colliders. | |
| u16 | mAttSent |
| The attack types sent by this collider in the previous collisions. | |
| u16 | mAttReceived |
| The attack types received by this collider in the previous collisions. | |
| u8 | mShape |
| The shape of the collider. See CC_SHAPE_e . | |
| u8 | mAmiLine |
| The non-collide mask for this collider. | |
| u8 | mLayer |
| The layer this collider is on. | |
| u8 | mInfo |
| Info flags for this collider. See CC_INFO_e. | |
Private Types | |
| typedef bool(* | hitCheck) (dCc_c *, dCc_c *) |
Private Member Functions | |
| float | getTrpOffset (int idx) |
Static Private Member Functions | |
| 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. | |
| static bool | _hitCheckNormal (dCc_c *c1, dCc_c *c2) |
| Check two rectangular colliders against each other for collisions without stage looping. | |
| static bool | _hitCheckLoop (dCc_c *c1, dCc_c *c2) |
| Check two rectangular colliders against each other for collisions with stage looping. | |
| static bool | _hitCheckCircle (dCc_c *c1, dCc_c *c2) |
| Check two circle colliders against each other for collisions. | |
| static bool | _hitCheckBoxCircle (dCc_c *c1, dCc_c *c2) |
| Check a rectangular and a circle collider against each other for collisions. | |
| static int | _lineCheckUD (mVec2_c p1, mVec2_c p2, float p3, float p4) |
| static bool | _hitCheckDaikeiUD_R (dCc_c *ccBox, dCc_c *ccTrp) |
| Check a rectangular collider against a trapezoid-shaped collider for collisions. | |
| static bool | _hitCheckDaikeiUD (dCc_c *ccTrp, dCc_c *ccBox) |
| Check a trapezoid-shaped collider against a rectangular collider for collisions. | |
| static int | _lineCheckLR (mVec2_c p1, mVec2_c p2, float p3, float p4) |
| static bool | _hitCheckDaikeiLR_R (dCc_c *ccBox, dCc_c *ccTrp) |
| Check a rectangular collider against a trapezoid-shaped collider for collisions. | |
| static bool | _hitCheckDaikeiLR (dCc_c *ccTrp, dCc_c *ccBox) |
| Check a trapezoid-shaped collider against a rectangular collider for collisions. | |
Private Attributes | |
| bool | mIsLinked |
| Whether this collider has been placed in the collider list. | |
Static Private Attributes | |
| static hitCheck | _hitCheck [4][4] |
| The hit check function for each combination of collider shapes. | |
| static dCc_c * | mEntryN |
| The first collider in the list. | |
| static dCc_c * | mEntryB |
| The last collider in the list. | |
| void dCc_c::clear | ( | ) |
| void dCc_c::entry | ( | ) |
| void dCc_c::release | ( | ) |
| void dCc_c::set | ( | dActor_c * | actor, |
| sCcDatNewF * | collInfo ) |
| void dCc_c::set | ( | dActor_c * | actor, |
| sCcDatNewF * | collInfo, | ||
| u8 | amiLine ) |
|
inline |
|
inline |
| u16 dCc_c::isHit | ( | u16 | mask | ) | const |
| u16 dCc_c::isHitAtDmg | ( | u16 | mask | ) | const |
| float dCc_c::getTopPos | ( | ) |
| float dCc_c::getUnderPos | ( | ) |
| float dCc_c::getCenterPosY | ( | ) |
| float dCc_c::getRightPos | ( | ) |
| float dCc_c::getLeftPos | ( | ) |
| float dCc_c::getCenterPosX | ( | ) |
|
inline |
| bool dCc_c::isInside | ( | dCc_c * | other | ) |
|
static |
|
static |
| dActor_c* dCc_c::mpOwner |
| dActor_c* dCc_c::mpFriendActor |
| u32 dCc_c::mCanBounce |
| sCcDatNewF dCc_c::mCcData |
| float dCc_c::mTrpOffsets[4] |
| float dCc_c::mCollOffsetX[CC_KIND_COUNT] |
| float dCc_c::mCollOffsetY[CC_KIND_COUNT] |
| mVec2_c dCc_c::mCollPos |
| u16 dCc_c::mCollidedWith |
| u16 dCc_c::mAttSent |
| u16 dCc_c::mAttReceived |
| u8 dCc_c::mShape |
| u8 dCc_c::mAmiLine |
| u8 dCc_c::mLayer |
| u8 dCc_c::mInfo |
|
private |
|
staticprivate |
The hit check function for each combination of collider shapes.
The first index is the shape of the first collider and the second index is the shape of the second collider.
|
staticprivate |