add mat4.from_quat(...) & update mat4.decompose(...)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user