20#include <egg/math/Vector.hh>
25#define KCL_ATTRIBUTE_TYPE(x) ((x)&0x1f)
28#define KCL_TYPE_BIT(x) (1 << (x))
30#define KCL_ATTRIBUTE_TYPE_BIT(x) KCL_TYPE_BIT(KCL_ATTRIBUTE_TYPE(x))
32#define KCL_VARIANT_TYPE(x) ((x >> 5) & 7)
72#define KCL_SOFT_WALL_MASK 0x8000
73#define KCL_ANY 0xffffffff
74#define KCL_NONE 0x00000000
77#define KCL_TYPE_DIRECTIONAL \
78 (KCL_TYPE_BIT(COL_TYPE_FALL_BOUNDARY) | KCL_TYPE_BIT(COL_TYPE_SOUND_TRIGGER) | \
79 KCL_TYPE_BIT(COL_TYPE_FORCE_RECALCULATE_ROUTE) | \
80 KCL_TYPE_BIT(COL_TYPE_EFFECT_TRIGGER) | KCL_TYPE_BIT(COL_TYPE_CANNON_TRIGGER))
83#define KCL_TYPE_SOLID_SURFACE \
85 (~KCL_TYPE_BIT(COL_TYPE_FALL_BOUNDARY) & ~KCL_TYPE_BIT(COL_TYPE_CANNON_TRIGGER) & \
86 ~KCL_TYPE_BIT(COL_TYPE_FORCE_RECALCULATE_ROUTE) & \
87 ~KCL_TYPE_BIT(COL_TYPE_SOUND_TRIGGER) & ~KCL_TYPE_BIT(COL_TYPE_WEAK_WALL) & \
88 ~KCL_TYPE_BIT(COL_TYPE_EFFECT_TRIGGER) & \
89 ~KCL_TYPE_BIT(COL_TYPE_ITEM_STATE_MODIFIER)))
92#define KCL_TYPE_FLOOR \
93 (KCL_TYPE_BIT(COL_TYPE_ROAD) | KCL_TYPE_BIT(COL_TYPE_SLIPPERY_ROAD) | \
94 KCL_TYPE_BIT(COL_TYPE_WEAK_OFF_ROAD) | KCL_TYPE_BIT(COL_TYPE_OFF_ROAD) | \
95 KCL_TYPE_BIT(COL_TYPE_HEAVY_OFF_ROAD) | KCL_TYPE_BIT(COL_TYPE_SLIPPERY_ROAD_2) | \
96 KCL_TYPE_BIT(COL_TYPE_BOOST_PAD) | KCL_TYPE_BIT(COL_TYPE_BOOST_RAMP) | \
97 KCL_TYPE_BIT(COL_TYPE_JUMP_PAD) | KCL_TYPE_BIT(COL_TYPE_ITEM_ROAD) | \
98 KCL_TYPE_BIT(COL_TYPE_SOLID_OOB) | KCL_TYPE_BIT(COL_TYPE_MOVING_WATER) | \
99 KCL_TYPE_BIT(COL_TYPE_HALFPIPE_RAMP) | KCL_TYPE_BIT(COL_TYPE_MOVING_ROAD) | \
100 KCL_TYPE_BIT(COL_TYPE_STICKY_ROAD) | KCL_TYPE_BIT(COL_TYPE_ROAD2) | \
101 KCL_TYPE_BIT(COL_TYPE_ROTATING_ROAD))
104#define KCL_TYPE_DRIVER_FLOOR (KCL_TYPE_FLOOR & ~KCL_TYPE_BIT(COL_TYPE_ITEM_ROAD))
107#define KCL_TYPE_WALL \
108 (KCL_TYPE_BIT(COL_TYPE_WALL) | KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL) | \
109 KCL_TYPE_BIT(COL_TYPE_ITEM_WALL) | KCL_TYPE_BIT(COL_TYPE_WALL_2) | \
110 KCL_TYPE_BIT(COL_TYPE_PLAYER_WALL) | KCL_TYPE_BIT(COL_TYPE_HALFPIPE_INVISIBLE_WALL) | \
111 KCL_TYPE_BIT(COL_TYPE_SPECIAL_WALL) | KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL2))
114#define KCL_TYPE_DRIVER_WALL \
115 (KCL_TYPE_WALL & ~KCL_TYPE_BIT(COL_TYPE_ITEM_WALL) & \
116 ~KCL_TYPE_BIT(COL_TYPE_HALFPIPE_INVISIBLE_WALL))
119#define KCL_TYPE_DRIVER_WALL_NO_INVISIBLE_WALL \
120 (KCL_TYPE_DRIVER_WALL & ~KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL))
123#define KCL_TYPE_DRIVER_WALL_NO_INVISIBLE_WALL2 \
124 (KCL_TYPE_DRIVER_WALL & ~KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL2))
127#define KCL_TYPE_4010D000 \
128 (KCL_TYPE_DRIVER_WALL_NO_INVISIBLE_WALL & ~KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL2) | \
129 KCL_TYPE_BIT(COL_TYPE_ITEM_WALL))
132#define KCL_TYPE_VEHICLE_INTERACTABLE \
133 (~KCL_TYPE_BIT(COL_TYPE_ITEM_ROAD) & ~KCL_TYPE_BIT(COL_TYPE_ITEM_WALL) & \
134 ~KCL_TYPE_BIT(COL_TYPE_HALFPIPE_INVISIBLE_WALL))
137#define KCL_TYPE_VEHICLE_COLLIDEABLE \
138 (KCL_TYPE_VEHICLE_INTERACTABLE & ~KCL_TYPE_BIT(COL_TYPE_SOUND_TRIGGER) & \
139 ~KCL_TYPE_BIT(COL_TYPE_EFFECT_TRIGGER) & ~KCL_TYPE_BIT(COL_TYPE_FALL_BOUNDARY) & \
140 ~KCL_TYPE_BIT(COL_TYPE_CANNON_TRIGGER) & \
141 ~KCL_TYPE_BIT(COL_TYPE_FORCE_RECALCULATE_ROUTE))
144#define KCL_TYPE_NON_DIRECTIONAL \
145 (KCL_TYPE_VEHICLE_COLLIDEABLE & ~KCL_TYPE_BIT(COL_TYPE_ITEM_STATE_MODIFIER) & \
146 ~KCL_TYPE_BIT(COL_TYPE_WEAK_WALL))
149#define KCL_TYPE_DRIVER_SOLID_SURFACE \
150 (KCL_TYPE_VEHICLE_COLLIDEABLE | KCL_TYPE_BIT(COL_TYPE_CANNON_TRIGGER))
153#define KCL_TYPE_B0E82DFF \
154 (KCL_TYPE_DRIVER_FLOOR | KCL_TYPE_BIT(COL_TYPE_HALFPIPE_INVISIBLE_WALL) | \
155 KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL) | \
156 KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL2) & ~KCL_TYPE_BIT(COL_TYPE_ITEM_ROAD))
158#define KCL_TYPE_64EBDFFF \
159 (KCL_TYPE_FLOOR | KCL_TYPE_BIT(COL_TYPE_SPECIAL_WALL) | \
160 KCL_TYPE_BIT(COL_TYPE_EFFECT_TRIGGER) | KCL_TYPE_BIT(COL_TYPE_CANNON_TRIGGER) | \
161 KCL_TYPE_BIT(COL_TYPE_FALL_BOUNDARY) | KCL_TYPE_BIT(COL_TYPE_WALL_2) | \
162 KCL_TYPE_BIT(COL_TYPE_ITEM_WALL) | KCL_TYPE_BIT(COL_TYPE_WALL))
164STATIC_ASSERT(KCL_TYPE_64EBDFFF == 0x64EBDFFF);
167#define KCL_TYPE_INVISIBLE_WALL \
168 (KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL) | KCL_TYPE_BIT(COL_TYPE_INVISIBLE_WALL2))
171#define KCL_TYPE_ANY_INVISIBLE_WALL \
172 (KCL_TYPE_INVISIBLE_WALL | KCL_TYPE_BIT(COL_TYPE_HALFPIPE_INVISIBLE_WALL))
193typedef u32 KCLTypeMask;
@ COL_TYPE_OFF_ROAD
Moderate off-road slowdown.
@ COL_TYPE_MOVING_WATER
Koopa Cape and DS Yoshi Falls.
@ COL_TYPE_STICKY_ROAD
Player sticks if within 200 units (rBC stairs).
@ COL_TYPE_BOOST_RAMP
Trickable. Variant affects boost duration.
@ COL_TYPE_ITEM_WALL
Wall that is only solid for items.
@ COL_TYPE_FORCE_RECALCULATE_ROUTE
Forces CPU pathing recalculation.
@ COL_TYPE_INVISIBLE_WALL
Solid wall that is (typically) invisible.
@ COL_TYPE_WALL
Default wall.
@ COL_TYPE_SOUND_TRIGGER
Triggers for changing sound effects per-course.
@ COL_TYPE_WEAK_OFF_ROAD
Slight off-road slowdown.
@ COL_TYPE_INVISIBLE_WALL2
Identical to COL_TYPE_INVISIBLE_WALL.
@ COL_TYPE_ITEM_STATE_MODIFIER
Stops items when leaving curved TF conveyers.
@ COL_TYPE_WALL_2
Difference to COL_TYPE_WALL is unknown.
@ COL_TYPE_ROAD2
COL_TYPE_ROAD but with more variants.
@ COL_TYPE_HALFPIPE_RAMP
Bowser's Castle half-pipe ramps.
@ COL_TYPE_HALFPIPE_INVISIBLE_WALL
Invisible wall after a half-pipe jump, like in BC.
@ COL_TYPE_WEAK_WALL
Pushes player away only at low speeds.
@ COL_TYPE_SPECIAL_WALL
Various other wall types, determined by variant.
@ COL_TYPE_SLIPPERY_ROAD_2
N64 Sherbet Land.
@ COL_TYPE_ROAD
Default road.
@ COL_TYPE_ITEM_ROAD
Road that is only solid for items.
@ COL_TYPE_FALL_BOUNDARY
Non-solid out-of-bounds trigger.
@ COL_TYPE_SLIPPERY_ROAD
Like Dry Dry Ruins.
@ COL_TYPE_BOOST_PAD
Boost panel.
@ COL_TYPE_ROTATING_ROAD
Chain Chomp Roulette.
@ COL_TYPE_PLAYER_WALL
Allows items to pass through but not players.
@ COL_TYPE_CANNON_TRIGGER
Launches player to a destination "cannon point".
@ COL_TYPE_SOLID_OOB
Solid out-of-bounds trigger.
@ COL_TYPE_JUMP_PAD
Like GBA Shy Guy Beach.
@ COL_TYPE_MOVING_ROAD
TF conveyers and CM escalators.
@ COL_TYPE_EFFECT_TRIGGER
Activates various effects based on variant.
@ COL_TYPE_HEAVY_OFF_ROAD
Heavy off-road slowdown.