mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add mat4.from_quat(...) & update mat4.decompose(...)
This commit is contained in:
parent
2294690f29
commit
02c9c4ced3
16 changed files with 167 additions and 137 deletions
|
|
@ -17,7 +17,7 @@ inline std::shared_ptr<Player> get_player(lua::State* L, int idx) {
|
|||
|
||||
static int l_get_pos(lua::State* L) {
|
||||
if (auto player = get_player(L, 1)) {
|
||||
return lua::pushvec3(L, player->getPosition());
|
||||
return lua::pushvec3_stack(L, player->getPosition());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ static int l_set_pos(lua::State* L) {
|
|||
static int l_get_vel(lua::State* L) {
|
||||
if (auto player = get_player(L, 1)) {
|
||||
if (auto hitbox = player->getHitbox()) {
|
||||
return lua::pushvec3(L, hitbox->velocity);
|
||||
return lua::pushvec3_stack(L, hitbox->velocity);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -59,7 +59,7 @@ static int l_set_vel(lua::State* L) {
|
|||
|
||||
static int l_get_rot(lua::State* L) {
|
||||
if (auto player = get_player(L, 1)) {
|
||||
return lua::pushvec3(L, player->cam);
|
||||
return lua::pushvec3_stack(L, player->cam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ static int l_set_rot(lua::State* L) {
|
|||
|
||||
static int l_get_dir(lua::State* L) {
|
||||
if (auto player = get_player(L, 1)) {
|
||||
return lua::pushvec3_arr(L, player->camera->front);
|
||||
return lua::pushvec3(L, player->camera->front);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ static int l_get_selected_block(lua::State* L) {
|
|||
if (player->selection.vox.id == BLOCK_VOID) {
|
||||
return 0;
|
||||
}
|
||||
return lua::pushivec3(L, player->selection.position);
|
||||
return lua::pushivec3_stack(L, player->selection.position);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ static int l_get_selected_entity(lua::State* L) {
|
|||
|
||||
static int l_get_spawnpoint(lua::State* L) {
|
||||
if (auto player = get_player(L, 1)) {
|
||||
return lua::pushvec3(L, player->getSpawnPoint());
|
||||
return lua::pushvec3_stack(L, player->getSpawnPoint());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue