Minor fixes
All checks were successful
Build and Publish WASM version of demo / Build-And-Deploy (push) Successful in 19s

This commit is contained in:
Stephen Seo 2023-08-18 15:50:37 +09:00
parent b885b869cb
commit 596912617f
2 changed files with 3 additions and 5 deletions

View file

@ -287,8 +287,7 @@ bool TRunnerScreen::update(float dt) {
// Check if clicked on a Walker. // Check if clicked on a Walker.
for (unsigned int idx = 0; idx < walkers.size(); ++idx) { for (unsigned int idx = 0; idx < walkers.size(); ++idx) {
if (auto walker_bb = walkers[idx].get_body_bb(); if (GetRayCollisionBox(ray, walkers[idx].get_body_bb()).hit) {
GetRayCollisionBox(ray, walker_bb).hit) {
if (controlled_walker_idx.has_value()) { if (controlled_walker_idx.has_value()) {
walkers[controlled_walker_idx.value()].set_player_controlled(false); walkers[controlled_walker_idx.value()].set_player_controlled(false);
} }
@ -345,8 +344,7 @@ bool TRunnerScreen::update(float dt) {
} }
}; };
if (auto bb_collision = GetRayCollisionBox(ray, surface_bbs[idx]); if (GetRayCollisionBox(ray, surface_bbs[idx]).hit) {
bb_collision.hit) {
if (auto collision = GetRayCollisionTriangle(ray, nw, sw, ne); if (auto collision = GetRayCollisionTriangle(ray, nw, sw, ne);
collision.hit) { collision.hit) {
on_collide_fn(collision.point); on_collide_fn(collision.point);

View file

@ -98,7 +98,7 @@ class Walker {
template <std::size_t BBCount> template <std::size_t BBCount>
void Walker::update(float dt, const std::array<BoundingBox, BBCount> &bbs, void Walker::update(float dt, const std::array<BoundingBox, BBCount> &bbs,
unsigned int width, unsigned int height) { unsigned int width, unsigned int /*height*/) {
if ((flags & 8) == 0 && (flags & 4) != 0 && (flags & 3) == 0) { if ((flags & 8) == 0 && (flags & 4) != 0 && (flags & 3) == 0) {
roaming_timer += dt; roaming_timer += dt;
if (roaming_timer > roaming_time) { if (roaming_timer > roaming_time) {