Added collision_get_temp_wall_collision_data() to Lua

This commit is contained in:
MysterD 2023-06-15 19:55:55 -07:00
parent c594179cca
commit 488ef1c6d2
6 changed files with 50 additions and 0 deletions

View File

@ -8100,6 +8100,11 @@ function collision_find_surface_on_ray(startX, startY, startZ, dirX, dirY, dirZ)
-- ...
end
--- @return WallCollisionData
function collision_get_temp_wall_collision_data()
-- ...
end
--- @return Surface
function get_water_surface_pseudo_floor()
-- ...

View File

@ -7345,6 +7345,24 @@
<br />
## [collision_get_temp_wall_collision_data](#collision_get_temp_wall_collision_data)
### Lua Example
`local WallCollisionDataValue = collision_get_temp_wall_collision_data()`
### Parameters
- None
### Returns
[WallCollisionData](structs.md#WallCollisionData)
### C Prototype
`struct WallCollisionData* collision_get_temp_wall_collision_data(void);`
[:arrow_up_small:](#)
<br />
## [get_water_surface_pseudo_floor](#get_water_surface_pseudo_floor)
### Lua Example

View File

@ -1503,6 +1503,7 @@
- smlua_collision_utils.h
- [collision_find_surface_on_ray](functions-4.md#collision_find_surface_on_ray)
- [collision_get_temp_wall_collision_data](functions-4.md#collision_get_temp_wall_collision_data)
- [get_water_surface_pseudo_floor](functions-4.md#get_water_surface_pseudo_floor)
- [smlua_collision_util_get](functions-4.md#smlua_collision_util_get)

View File

@ -27042,6 +27042,21 @@ int smlua_func_collision_find_surface_on_ray(lua_State* L) {
return 1;
}
int smlua_func_collision_get_temp_wall_collision_data(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 0) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "collision_get_temp_wall_collision_data", 0, top);
return 0;
}
smlua_push_object(L, LOT_WALLCOLLISIONDATA, collision_get_temp_wall_collision_data());
return 1;
}
int smlua_func_get_water_surface_pseudo_floor(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
@ -31516,6 +31531,7 @@ void smlua_bind_functions_autogen(void) {
// smlua_collision_utils.h
smlua_bind_function(L, "collision_find_surface_on_ray", smlua_func_collision_find_surface_on_ray);
smlua_bind_function(L, "collision_get_temp_wall_collision_data", smlua_func_collision_get_temp_wall_collision_data);
smlua_bind_function(L, "get_water_surface_pseudo_floor", smlua_func_get_water_surface_pseudo_floor);
smlua_bind_function(L, "smlua_collision_util_get", smlua_func_smlua_collision_util_get);

View File

@ -171,3 +171,9 @@ struct Surface* get_water_surface_pseudo_floor(void) {
Collision* smlua_collision_util_get(const char* name) {
return dynos_collision_get(name);
}
struct WallCollisionData* collision_get_temp_wall_collision_data(void) {
static struct WallCollisionData sTmpWcd = { 0 };
memset(&sTmpWcd, 0, sizeof(struct WallCollisionData));
return &sTmpWcd;
}

View File

@ -1,6 +1,8 @@
#ifndef SMLUA_COLLISION_UTILS_H
#define SMLUA_COLLISION_UTILS_H
#include "engine/surface_collision.h"
struct RayIntersectionInfo {
struct Surface* surface;
Vec3f hitPos;
@ -118,4 +120,6 @@ struct Surface* get_water_surface_pseudo_floor(void);
Collision* smlua_collision_util_get(const char* name);
struct WallCollisionData* collision_get_temp_wall_collision_data(void);
#endif