mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-22 15:43:18 -05:00
Document surface_collision.h (#549)
* Document surface_collision.h Add documentation to the functions of surface_collision.h * Make descriptions a little more clear * Fix random space
This commit is contained in:
parent
ccdb94042e
commit
7d0b184fa5
3 changed files with 45 additions and 0 deletions
|
@ -10094,6 +10094,7 @@ end
|
||||||
--- @param y number
|
--- @param y number
|
||||||
--- @param z number
|
--- @param z number
|
||||||
--- @return number
|
--- @return number
|
||||||
|
--- Finds the height of the highest ceiling above a given position (x, y, z). If no ceiling is found, returns the default height limit of `gLevelValues.cellHeightLimit`(20000 by default)
|
||||||
function find_ceil_height(x, y, z)
|
function find_ceil_height(x, y, z)
|
||||||
-- ...
|
-- ...
|
||||||
end
|
end
|
||||||
|
@ -10102,6 +10103,7 @@ end
|
||||||
--- @param y number
|
--- @param y number
|
||||||
--- @param z number
|
--- @param z number
|
||||||
--- @return number
|
--- @return number
|
||||||
|
--- Finds the height of the highest floor below a given position (x, y, z). If no floor is found, returns the default floor height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
function find_floor_height(x, y, z)
|
function find_floor_height(x, y, z)
|
||||||
-- ...
|
-- ...
|
||||||
end
|
end
|
||||||
|
@ -10109,12 +10111,14 @@ end
|
||||||
--- @param x number
|
--- @param x number
|
||||||
--- @param z number
|
--- @param z number
|
||||||
--- @return number
|
--- @return number
|
||||||
|
--- Finds the height of the poison gas at a given position (x, z), if the position is within a gas region. If no gas is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
function find_poison_gas_level(x, z)
|
function find_poison_gas_level(x, z)
|
||||||
-- ...
|
-- ...
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param colData WallCollisionData
|
--- @param colData WallCollisionData
|
||||||
--- @return integer
|
--- @return integer
|
||||||
|
--- Detects wall collisions at a given position and adjusts the position based on the walls found. Returns the number of wall collisions detected.
|
||||||
function find_wall_collisions(colData)
|
function find_wall_collisions(colData)
|
||||||
-- ...
|
-- ...
|
||||||
end
|
end
|
||||||
|
@ -10122,6 +10126,7 @@ end
|
||||||
--- @param x number
|
--- @param x number
|
||||||
--- @param z number
|
--- @param z number
|
||||||
--- @return number
|
--- @return number
|
||||||
|
--- Finds the height of water at a given position (x, z), if the position is within a water region. If no water is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
function find_water_level(x, z)
|
function find_water_level(x, z)
|
||||||
-- ...
|
-- ...
|
||||||
end
|
end
|
||||||
|
|
|
@ -3397,6 +3397,9 @@ Replaces the secret star course name of `courseNum` with `courseName`
|
||||||
|
|
||||||
## [find_ceil_height](#find_ceil_height)
|
## [find_ceil_height](#find_ceil_height)
|
||||||
|
|
||||||
|
### Description
|
||||||
|
Finds the height of the highest ceiling above a given position (x, y, z). If no ceiling is found, returns the default height limit of `gLevelValues.cellHeightLimit`(20000 by default)
|
||||||
|
|
||||||
### Lua Example
|
### Lua Example
|
||||||
`local numberValue = find_ceil_height(x, y, z)`
|
`local numberValue = find_ceil_height(x, y, z)`
|
||||||
|
|
||||||
|
@ -3419,6 +3422,9 @@ Replaces the secret star course name of `courseNum` with `courseName`
|
||||||
|
|
||||||
## [find_floor_height](#find_floor_height)
|
## [find_floor_height](#find_floor_height)
|
||||||
|
|
||||||
|
### Description
|
||||||
|
Finds the height of the highest floor below a given position (x, y, z). If no floor is found, returns the default floor height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
|
|
||||||
### Lua Example
|
### Lua Example
|
||||||
`local numberValue = find_floor_height(x, y, z)`
|
`local numberValue = find_floor_height(x, y, z)`
|
||||||
|
|
||||||
|
@ -3441,6 +3447,9 @@ Replaces the secret star course name of `courseNum` with `courseName`
|
||||||
|
|
||||||
## [find_poison_gas_level](#find_poison_gas_level)
|
## [find_poison_gas_level](#find_poison_gas_level)
|
||||||
|
|
||||||
|
### Description
|
||||||
|
Finds the height of the poison gas at a given position (x, z), if the position is within a gas region. If no gas is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
|
|
||||||
### Lua Example
|
### Lua Example
|
||||||
`local numberValue = find_poison_gas_level(x, z)`
|
`local numberValue = find_poison_gas_level(x, z)`
|
||||||
|
|
||||||
|
@ -3462,6 +3471,9 @@ Replaces the secret star course name of `courseNum` with `courseName`
|
||||||
|
|
||||||
## [find_wall_collisions](#find_wall_collisions)
|
## [find_wall_collisions](#find_wall_collisions)
|
||||||
|
|
||||||
|
### Description
|
||||||
|
Detects wall collisions at a given position and adjusts the position based on the walls found. Returns the number of wall collisions detected.
|
||||||
|
|
||||||
### Lua Example
|
### Lua Example
|
||||||
`local integerValue = find_wall_collisions(colData)`
|
`local integerValue = find_wall_collisions(colData)`
|
||||||
|
|
||||||
|
@ -3482,6 +3494,9 @@ Replaces the secret star course name of `courseNum` with `courseName`
|
||||||
|
|
||||||
## [find_water_level](#find_water_level)
|
## [find_water_level](#find_water_level)
|
||||||
|
|
||||||
|
### Description
|
||||||
|
Finds the height of water at a given position (x, z), if the position is within a water region. If no water is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
|
|
||||||
### Lua Example
|
### Lua Example
|
||||||
`local numberValue = find_water_level(x, z)`
|
`local numberValue = find_water_level(x, z)`
|
||||||
|
|
||||||
|
|
|
@ -43,13 +43,38 @@ extern u8 gFindWallDirectionActive;
|
||||||
extern u8 gFindWallDirectionAirborne;
|
extern u8 gFindWallDirectionAirborne;
|
||||||
|
|
||||||
s32 f32_find_wall_collision(f32 *xPtr, f32 *yPtr, f32 *zPtr, f32 offsetY, f32 radius);
|
s32 f32_find_wall_collision(f32 *xPtr, f32 *yPtr, f32 *zPtr, f32 offsetY, f32 radius);
|
||||||
|
|
||||||
|
/* |description|
|
||||||
|
Detects wall collisions at a given position and adjusts the position based on the walls found.
|
||||||
|
Returns the number of wall collisions detected.
|
||||||
|
|descriptionEnd| */
|
||||||
s32 find_wall_collisions(struct WallCollisionData *colData);
|
s32 find_wall_collisions(struct WallCollisionData *colData);
|
||||||
f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil);
|
f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil);
|
||||||
|
|
||||||
|
/* |description|
|
||||||
|
Finds the height of the highest ceiling above a given position (x, y, z).
|
||||||
|
If no ceiling is found, returns the default height limit of `gLevelValues.cellHeightLimit`(20000 by default)
|
||||||
|
|descriptionEnd| */
|
||||||
f32 find_ceil_height(f32 x, f32 y, f32 z);
|
f32 find_ceil_height(f32 x, f32 y, f32 z);
|
||||||
f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct FloorGeometry **floorGeo);
|
f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct FloorGeometry **floorGeo);
|
||||||
|
|
||||||
|
/* |description|
|
||||||
|
Finds the height of the highest floor below a given position (x, y, z).
|
||||||
|
If no floor is found, returns the default floor height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
|
|descriptionEnd| */
|
||||||
f32 find_floor_height(f32 x, f32 y, f32 z);
|
f32 find_floor_height(f32 x, f32 y, f32 z);
|
||||||
f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor);
|
f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor);
|
||||||
|
|
||||||
|
/* |description|
|
||||||
|
Finds the height of water at a given position (x, z), if the position is within a water region.
|
||||||
|
If no water is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
|
|descriptionEnd| */
|
||||||
f32 find_water_level(f32 x, f32 z);
|
f32 find_water_level(f32 x, f32 z);
|
||||||
|
|
||||||
|
/* |description|
|
||||||
|
Finds the height of the poison gas at a given position (x, z), if the position is within a gas region.
|
||||||
|
If no gas is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
|
||||||
|
|descriptionEnd| */
|
||||||
f32 find_poison_gas_level(f32 x, f32 z);
|
f32 find_poison_gas_level(f32 x, f32 z);
|
||||||
void debug_surface_list_info(f32 xPos, f32 zPos);
|
void debug_surface_list_info(f32 xPos, f32 zPos);
|
||||||
void find_surface_on_ray(Vec3f orig, Vec3f dir, struct Surface **hit_surface, Vec3f hit_pos, f32 precision);
|
void find_surface_on_ray(Vec3f orig, Vec3f dir, struct Surface **hit_surface, Vec3f hit_pos, f32 precision);
|
||||||
|
|
Loading…
Reference in a new issue