SURFACE_RAYCAST (#177)

* SURFACE_RAYCAST

* Exclude from camera collision
This commit is contained in:
Agent X 2022-09-12 22:56:24 -04:00 committed by GitHub
parent 9963db2771
commit a1953afd1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 3 deletions

View file

@ -11002,6 +11002,9 @@ SURFACE_PAINTING_WOBBLE_D2 = 0x00D2
--- @type integer
SURFACE_QUICKSAND = 0x0026
--- @type integer
SURFACE_RAYCAST = 0x0003
--- @type integer
SURFACE_SHALLOW_MOVING_QUICKSAND = 0x0025

View file

@ -185,6 +185,7 @@ static s64 DynOS_Col_ParseConstants(const String& _Arg, bool* found) {
// Surface constants
col_constant(SURFACE_DEFAULT);
col_constant(SURFACE_BURNING);
col_constant(SURFACE_RAYCAST);
col_constant(SURFACE_0004);
col_constant(SURFACE_HANGABLE);
col_constant(SURFACE_SLOW);

View file

@ -3859,6 +3859,7 @@
- SURFACE_PAINTING_WOBBLE_D1
- SURFACE_PAINTING_WOBBLE_D2
- SURFACE_QUICKSAND
- SURFACE_RAYCAST
- SURFACE_SHALLOW_MOVING_QUICKSAND
- SURFACE_SHALLOW_QUICKSAND
- SURFACE_SLIPPERY

View file

@ -4,6 +4,7 @@
// Surface Types
#define SURFACE_DEFAULT 0x0000 // Environment default
#define SURFACE_BURNING 0x0001 // Lava / Frostbite (in SL), but is used mostly for Lava
#define SURFACE_RAYCAST 0x0003 // Custom sm64ex-coop specific custom surface for using collision_find_surface_on_ray
#define SURFACE_0004 0x0004 // Unused, has no function and has parameters
#define SURFACE_HANGABLE 0x0005 // Ceiling that Mario can climb on
#define SURFACE_SLOW 0x0009 // Slow down Mario, unused

View file

@ -245,7 +245,7 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode,
}
} else {
// Ignore camera only surfaces.
if (surf->type == SURFACE_CAMERA_BOUNDARY) {
if (surf->type == SURFACE_CAMERA_BOUNDARY || surf->type == SURFACE_RAYCAST) {
continue;
}
@ -415,7 +415,7 @@ static struct Surface *find_ceil_from_list(struct SurfaceNode *surfaceNode, s32
}
}
// Ignore camera only surfaces.
else if (surf->type == SURFACE_CAMERA_BOUNDARY) {
else if (surf->type == SURFACE_CAMERA_BOUNDARY || surf->type == SURFACE_RAYCAST) {
continue;
}
@ -643,7 +643,7 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32
}
}
// If we are not checking for the camera, ignore camera only floors.
else if (surf->type == SURFACE_CAMERA_BOUNDARY) {
else if (surf->type == SURFACE_CAMERA_BOUNDARY || surf->type == SURFACE_RAYCAST) {
continue;
}

View file

@ -444,6 +444,7 @@ static s32 surf_has_no_cam_collision(s16 surfaceType) {
s32 flags = 0;
switch (surfaceType) {
case SURFACE_RAYCAST:
case SURFACE_NO_CAM_COLLISION:
case SURFACE_NO_CAM_COLLISION_77: // Unused
case SURFACE_NO_CAM_COL_VERY_SLIPPERY:

View file

@ -3713,6 +3713,7 @@ char gSmluaConstants[] = ""
"SOUND_OBJ2_MRI_SPINNING = SOUND_ARG_LOAD(SOUND_BANK_OBJ2, 0x6B, 0x00, SOUND_DISCRETE)\n"
"SURFACE_DEFAULT = 0x0000\n"
"SURFACE_BURNING = 0x0001\n"
"SURFACE_RAYCAST = 0x0003\n"
"SURFACE_0004 = 0x0004\n"
"SURFACE_HANGABLE = 0x0005\n"
"SURFACE_SLOW = 0x0009\n"