Fix checkpoint normals, morph pickup deduplication, and final championship standings screen
This commit is contained in:
1 parent
bbd701b716
commit
9f276a432b
8 files changed
+460
-63
No files matched your search
+53
-15
@@ -271,25 +271,63 @@ bool LevelData::load(const Vfs& vfs, int level_num) {
|
||||
main_waypoints.push_back(node);
|
||||
}
|
||||
|
||||
// Compute approximate forward vector for each checkpoint from nearest waypoint direction
|
||||
// Compute exact perpendicular forward unit normal (and bidirectional flag) for each checkpoint
|
||||
if (!main_waypoints.empty()) {
|
||||
for (auto& gate : checkpoints) {
|
||||
size_t best_wp = 0;
|
||||
float best_d2 = 1e18f;
|
||||
for (size_t i = 0; i < main_waypoints.size(); ++i) {
|
||||
float dx = main_waypoints[i].x - gate.cx;
|
||||
float dz = main_waypoints[i].z - gate.cz;
|
||||
float d2 = dx * dx + dz * dz;
|
||||
if (d2 < best_d2) {
|
||||
best_d2 = d2;
|
||||
best_wp = i;
|
||||
Vec2 g0(gate.x0, gate.z0);
|
||||
Vec2 seg(gate.x1 - gate.x0, gate.z1 - gate.z0);
|
||||
float slen = seg.len();
|
||||
if (slen <= 1e-4f) continue;
|
||||
|
||||
Vec2 n1(-seg.y / slen, seg.x / slen);
|
||||
int pos_cross = 0;
|
||||
int neg_cross = 0;
|
||||
for (size_t wi = 0; wi < main_waypoints.size(); ++wi) {
|
||||
const auto& w0 = main_waypoints[wi];
|
||||
const auto& w1 = main_waypoints[(wi + 1) % main_waypoints.size()];
|
||||
Vec2 p0(w0.x, w0.z);
|
||||
Vec2 p1(w1.x, w1.z);
|
||||
float d0 = (p0 - g0).dot(n1);
|
||||
float d1 = (p1 - g0).dot(n1);
|
||||
if ((d0 <= 0.0f && d1 >= 0.0f) || (d0 >= 0.0f && d1 <= 0.0f)) {
|
||||
float denom = std::abs(d1 - d0);
|
||||
if (denom <= 1e-5f) continue;
|
||||
float frac = std::abs(d0) / denom;
|
||||
Vec2 pc = p0 + (p1 - p0) * frac;
|
||||
float t = (pc - g0).dot(seg) / (slen * slen);
|
||||
if (t >= -0.25f && t <= 1.25f) {
|
||||
if ((p1 - p0).dot(n1) >= 0.0f) {
|
||||
++pos_cross;
|
||||
} else {
|
||||
++neg_cross;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const WaypointNode& cur_wp = main_waypoints[best_wp];
|
||||
const WaypointNode& nxt_wp = main_waypoints[(best_wp + 1) % main_waypoints.size()];
|
||||
Vec2 dir = Vec2(nxt_wp.x - cur_wp.x, nxt_wp.z - cur_wp.z).normalized();
|
||||
if (dir.len_sq() > 0.01f) {
|
||||
gate.dir = dir;
|
||||
|
||||
if (pos_cross > 0 && neg_cross == 0) {
|
||||
gate.dir = n1;
|
||||
gate.bidirectional = false;
|
||||
} else if (neg_cross > 0 && pos_cross == 0) {
|
||||
gate.dir = n1 * -1.0f;
|
||||
gate.bidirectional = false;
|
||||
} else {
|
||||
gate.bidirectional = (pos_cross > 0 && neg_cross > 0);
|
||||
size_t best_wp = 0;
|
||||
float best_d2 = 1e18f;
|
||||
for (size_t i = 0; i < main_waypoints.size(); ++i) {
|
||||
float dx = main_waypoints[i].x - gate.cx;
|
||||
float dz = main_waypoints[i].z - gate.cz;
|
||||
float d2 = dx * dx + dz * dz;
|
||||
if (d2 < best_d2) {
|
||||
best_d2 = d2;
|
||||
best_wp = i;
|
||||
}
|
||||
}
|
||||
const WaypointNode& cur_wp = main_waypoints[best_wp];
|
||||
const WaypointNode& nxt_wp = main_waypoints[(best_wp + 1) % main_waypoints.size()];
|
||||
Vec2 wp_dir(nxt_wp.x - cur_wp.x, nxt_wp.z - cur_wp.z);
|
||||
gate.dir = (wp_dir.dot(n1) < 0.0f) ? (n1 * -1.0f) : n1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,8 @@ struct CheckpointGate {
|
||||
float x0 = 0.0f, z0 = 0.0f;
|
||||
float x1 = 0.0f, z1 = 0.0f;
|
||||
float cx = 0.0f, cz = 0.0f;
|
||||
Vec2 dir{0.0f, -1.0f}; // approximate track forward direction
|
||||
Vec2 dir{0.0f, -1.0f}; // unit normal perpendicular to gate segment pointing along track forward direction
|
||||
bool bidirectional = false; // true when main racing circuit crosses gate in both directions (e.g. hairpins, DeathMatch corridor)
|
||||
};
|
||||
|
||||
struct WaypointNode {
|
||||
|
||||
+40
-16
@@ -575,6 +575,7 @@ void GameApp::enter_state(ScreenState s) {
|
||||
}
|
||||
} else if (s == ScreenState::PostRace) {
|
||||
in_race_session_ = false;
|
||||
post_race_page_ = initial_post_race_page(selected_mode_, champ_.is_complete());
|
||||
audio_.set_engine_state(false, 0.0f, false, 0.0f);
|
||||
audio_.set_pitstop_state(false, false, 1.0f);
|
||||
audio_.stop_intro_sfx(-1);
|
||||
@@ -1222,8 +1223,12 @@ void GameApp::update_menu(float dt) {
|
||||
}
|
||||
|
||||
if (state_ == ScreenState::PostRace) {
|
||||
if (m.left || m.right) {
|
||||
post_race_page_ = (post_race_page_ + 1) % (selected_mode_ == sim::GameMode::Championship ? 3 : 2);
|
||||
const int page_count = (selected_mode_ == sim::GameMode::Championship) ? 3 : 2;
|
||||
if (m.left) {
|
||||
post_race_page_ = (post_race_page_ + page_count - 1) % page_count;
|
||||
audio_.play_sfx("CHANGE.WAV", 0.32f);
|
||||
} else if (m.right) {
|
||||
post_race_page_ = (post_race_page_ + 1) % page_count;
|
||||
audio_.play_sfx("CHANGE.WAV", 0.32f);
|
||||
}
|
||||
if (m.confirm || m.back) {
|
||||
@@ -2405,7 +2410,10 @@ void GameApp::render_menus() {
|
||||
}
|
||||
|
||||
if (state_ == ScreenState::PostRace) {
|
||||
ui_ren_.draw_text_centered(cx, oy + 76.0f, 2.65f, str.race_over, Vec4(0.35f, 1.0f, 0.55f, 1));
|
||||
const bool champ_done = (selected_mode_ == sim::GameMode::Championship && champ_.is_complete());
|
||||
ui_ren_.draw_text_centered(cx, oy + 76.0f, 2.65f,
|
||||
champ_done ? "CHAMPIONSHIP COMPLETE" : str.race_over,
|
||||
champ_done ? Vec4(1.0f, 0.88f, 0.25f, 1.0f) : Vec4(0.35f, 1.0f, 0.55f, 1.0f));
|
||||
if (post_race_record_flags_ & 1) {
|
||||
ui_ren_.draw_text_centered(cx, oy + 114.0f, 1.9f, "NEW FASTEST LAP!", Vec4(1, 0.9f, 0.2f, 1));
|
||||
}
|
||||
@@ -2493,30 +2501,46 @@ void GameApp::render_menus() {
|
||||
ui_ren_.draw_text(cx - 240.0f, oy + 370.0f, 2.0f, "RATING: " + champ_.player_rating_title(), Vec4(1, 0.9f, 0.2f, 1));
|
||||
}
|
||||
} else if (selected_mode_ == sim::GameMode::Championship) {
|
||||
ui_ren_.draw_text_centered(cx, oy + 152.0f, 2.25f, "CHAMPIONSHIP TABLE", Vec4(0.4f, 0.85f, 1, 1));
|
||||
auto ds = champ_.drivers;
|
||||
std::sort(ds.begin(), ds.end(), [](const auto& a, const auto& b) { return a.points > b.points; });
|
||||
ui_ren_.draw_text_centered(cx, oy + 144.0f, 2.15f,
|
||||
champ_done ? "FINAL CHAMPIONSHIP STANDINGS" : "CHAMPIONSHIP TABLE",
|
||||
Vec4(0.4f, 0.85f, 1, 1));
|
||||
const auto order = champ_.sorted_driver_indices();
|
||||
float tbl_w = std::min(720.0f, vw - 48.0f);
|
||||
float c0 = cx - tbl_w * 0.5f;
|
||||
float c1 = c0 + tbl_w * 0.10f;
|
||||
float c2 = c0 + tbl_w * 0.40f;
|
||||
float c3 = c0 + tbl_w * 0.70f;
|
||||
float c4 = c0 + tbl_w * 0.84f;
|
||||
for (size_t i = 0; i < ds.size(); ++i) {
|
||||
float ry = oy + 200.0f + static_cast<float>(i) * 32.0f;
|
||||
Vec4 col = (ds[i].name == cfg_.player_name)
|
||||
? Vec4(1, 0.95f, 0.25f, 1)
|
||||
: Vec4(0.9f, 0.95f, 1, 1);
|
||||
ui_ren_.draw_text_fit(c0, oy + 178.0f, tbl_w * 0.09f, 1.65f, str.position, Vec4(0.4f, 0.85f, 1, 1));
|
||||
ui_ren_.draw_text_fit(c1, oy + 178.0f, tbl_w * 0.29f, 1.65f, str.driver, Vec4(0.4f, 0.85f, 1, 1));
|
||||
ui_ren_.draw_text_fit(c2, oy + 178.0f, tbl_w * 0.29f, 1.65f, "TEAM", Vec4(0.4f, 0.85f, 1, 1));
|
||||
ui_ren_.draw_text_fit(c3, oy + 178.0f, tbl_w * 0.13f, 1.65f, "POINTS", Vec4(0.4f, 0.85f, 1, 1));
|
||||
ui_ren_.draw_text_fit(c4, oy + 178.0f, tbl_w * 0.16f, 1.65f, "WINS", Vec4(0.4f, 0.85f, 1, 1));
|
||||
for (size_t i = 0; i < order.size(); ++i) {
|
||||
const size_t idx = order[i];
|
||||
const auto& d = champ_.drivers[idx];
|
||||
float ry = oy + 208.0f + static_cast<float>(i) * 30.0f;
|
||||
Vec4 col = (idx == 0) ? Vec4(1, 0.95f, 0.25f, 1) : Vec4(0.9f, 0.95f, 1, 1);
|
||||
ui_ren_.draw_text_fit(c0, ry, tbl_w * 0.09f, 1.75f, std::to_string(i + 1) + ".", col);
|
||||
ui_ren_.draw_text_fit(c1, ry, tbl_w * 0.29f, 1.75f, ds[i].name, col);
|
||||
ui_ren_.draw_text_fit(c1, ry, tbl_w * 0.29f, 1.75f, d.name, col);
|
||||
ui_ren_.draw_text_fit(c2, ry, tbl_w * 0.29f, 1.75f,
|
||||
sim::kTeamNames[std::clamp(ds[i].team_idx, 0, 7)], col);
|
||||
ui_ren_.draw_text_fit(c3, ry, tbl_w * 0.13f, 1.75f, std::to_string(ds[i].points) + " PTS", col);
|
||||
ui_ren_.draw_text_fit(c4, ry, tbl_w * 0.16f, 1.75f, std::to_string(ds[i].wins) + " W", col);
|
||||
sim::kTeamNames[std::clamp(d.team_idx, 0, 7)], col);
|
||||
ui_ren_.draw_text_fit(c3, ry, tbl_w * 0.13f, 1.75f, std::to_string(d.points) + " PTS", col);
|
||||
ui_ren_.draw_text_fit(c4, ry, tbl_w * 0.16f, 1.75f, std::to_string(d.wins) + " W", col);
|
||||
}
|
||||
if (champ_done) {
|
||||
const size_t winner_idx = order[0];
|
||||
std::string summary = (winner_idx == 0)
|
||||
? ("CHAMPIONSHIP WINNER! RATING: " + champ_.player_rating_title())
|
||||
: ("CHAMPION: " + champ_.drivers[winner_idx].name + " RATING: " + champ_.player_rating_title());
|
||||
ui_ren_.draw_text_centered_fit(cx, oy + 458.0f, vw - 48.0f, 1.85f, summary,
|
||||
Vec4(1.0f, 0.90f, 0.25f, 1.0f));
|
||||
}
|
||||
}
|
||||
ui_ren_.draw_text_centered_fit(cx, oy + 505.0f, vw - 48.0f, 1.9f,
|
||||
"LEFT/RIGHT STATS PAGE ENTER CONTINUE", Vec4(1, 0.85f, 0.2f, 1));
|
||||
champ_done ? "LEFT/RIGHT RACE RESULTS & STATS ENTER MAIN MENU"
|
||||
: "LEFT/RIGHT STATS PAGE ENTER CONTINUE",
|
||||
Vec4(1, 0.85f, 0.2f, 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,17 @@ std::string ChampionshipState::player_rating_title() const {
|
||||
return sim::rating_for_score(overall_rating_pts);
|
||||
}
|
||||
|
||||
std::array<size_t, 8> ChampionshipState::sorted_driver_indices() const {
|
||||
std::array<size_t, 8> order{0, 1, 2, 3, 4, 5, 6, 7};
|
||||
std::sort(order.begin(), order.end(), [&](size_t a, size_t b) {
|
||||
if (drivers[a].points != drivers[b].points) return drivers[a].points > drivers[b].points;
|
||||
if (drivers[a].wins != drivers[b].wins) return drivers[a].wins > drivers[b].wins;
|
||||
if (drivers[a].kills != drivers[b].kills) return drivers[a].kills > drivers[b].kills;
|
||||
return a < b;
|
||||
});
|
||||
return order;
|
||||
}
|
||||
|
||||
bool ChampionshipState::save_slot(const std::filesystem::path& pref_dir, int slot) const {
|
||||
std::error_code ec;
|
||||
std::filesystem::create_directories(pref_dir, ec);
|
||||
|
||||
@@ -38,12 +38,17 @@ struct ChampionshipState {
|
||||
void record_race_results(const std::vector<sim::CraftState>& crafts);
|
||||
bool is_complete() const { return current_track > total_tracks; }
|
||||
std::string player_rating_title() const;
|
||||
std::array<size_t, 8> sorted_driver_indices() const;
|
||||
|
||||
bool save_slot(const std::filesystem::path& pref_dir, int slot) const;
|
||||
bool load_slot(const std::filesystem::path& pref_dir, int slot);
|
||||
static bool slot_exists(const std::filesystem::path& pref_dir, int slot);
|
||||
};
|
||||
|
||||
inline int initial_post_race_page(sim::GameMode mode, bool championship_complete) {
|
||||
return (mode == sim::GameMode::Championship && championship_complete) ? 2 : 0;
|
||||
}
|
||||
|
||||
struct TrackRecord {
|
||||
float best_lap = 0.0f;
|
||||
std::string best_lap_driver = "---";
|
||||
|
||||
+83
-31
@@ -14,12 +14,13 @@ bool segments_intersect_or_near(Vec2 p0, Vec2 p1, Vec2 g0, Vec2 g1, float margin
|
||||
float* out_frac = nullptr) {
|
||||
// Check if craft crossed near checkpoint gate line (segment g0..g1 or center proximity)
|
||||
Vec2 mid = (g0 + g1) * 0.5f;
|
||||
float gate_half = std::max((g1 - g0).len() * 0.5f, 3.0f) + margin;
|
||||
Vec2 seg = g1 - g0;
|
||||
float slen = seg.len();
|
||||
float gate_half = std::max(slen * 0.5f, 3.0f) + margin;
|
||||
if ((p1 - mid).len_sq() > gate_half * gate_half && (p0 - mid).len_sq() > gate_half * gate_half) {
|
||||
return false;
|
||||
}
|
||||
Vec2 seg = g1 - g0;
|
||||
if (seg.len_sq() < 0.25f) {
|
||||
if (slen < 0.5f) {
|
||||
if ((p1 - mid).len() <= 3.5f) {
|
||||
if (out_frac) *out_frac = 1.0f;
|
||||
return true;
|
||||
@@ -33,8 +34,9 @@ bool segments_intersect_or_near(Vec2 p0, Vec2 p1, Vec2 g0, Vec2 g1, float margin
|
||||
float denom = std::abs(d1 - d0);
|
||||
float frac = (denom > 1e-5f) ? std::clamp(std::abs(d0) / denom, 0.0f, 1.0f) : 1.0f;
|
||||
Vec2 p_cross = p0 + (p1 - p0) * frac;
|
||||
float t = (p_cross - g0).dot(seg) / seg.len_sq();
|
||||
if (t >= -0.35f && t <= 1.35f) {
|
||||
float t = (p_cross - g0).dot(seg) / (slen * slen);
|
||||
float ext = margin / slen;
|
||||
if (t >= -ext && t <= 1.0f + ext) {
|
||||
if (out_frac) *out_frac = frac;
|
||||
return true;
|
||||
}
|
||||
@@ -42,27 +44,38 @@ bool segments_intersect_or_near(Vec2 p0, Vec2 p1, Vec2 g0, Vec2 g1, float margin
|
||||
return false;
|
||||
}
|
||||
|
||||
bool clip_segment_slab(float origin, float delta, float bmin, float bmax,
|
||||
float& t0, float& t1) {
|
||||
if (std::abs(delta) < 1e-6f) {
|
||||
return origin >= bmin && origin <= bmax;
|
||||
}
|
||||
float inv = 1.0f / delta;
|
||||
float tn = (bmin - origin) * inv;
|
||||
float tf = (bmax - origin) * inv;
|
||||
if (tn > tf) std::swap(tn, tf);
|
||||
t0 = std::max(t0, tn);
|
||||
t1 = std::min(t1, tf);
|
||||
return t0 <= t1;
|
||||
}
|
||||
|
||||
bool segment_intersects_aabb(const Vec3& p0, const Vec3& p1,
|
||||
float min_x, float max_x,
|
||||
float min_y, float max_y,
|
||||
float min_z, float max_z) {
|
||||
float t0 = 0.0f;
|
||||
float t1 = 1.0f;
|
||||
auto clip = [&](float origin, float delta, float bmin, float bmax) -> bool {
|
||||
if (std::abs(delta) < 1e-6f) {
|
||||
return origin >= bmin && origin <= bmax;
|
||||
}
|
||||
float inv = 1.0f / delta;
|
||||
float tn = (bmin - origin) * inv;
|
||||
float tf = (bmax - origin) * inv;
|
||||
if (tn > tf) std::swap(tn, tf);
|
||||
t0 = std::max(t0, tn);
|
||||
t1 = std::min(t1, tf);
|
||||
return t0 <= t1;
|
||||
};
|
||||
return clip(p0.x, p1.x - p0.x, min_x, max_x) &&
|
||||
clip(p0.y, p1.y - p0.y, min_y, max_y) &&
|
||||
clip(p0.z, p1.z - p0.z, min_z, max_z);
|
||||
return clip_segment_slab(p0.x, p1.x - p0.x, min_x, max_x, t0, t1) &&
|
||||
clip_segment_slab(p0.y, p1.y - p0.y, min_y, max_y, t0, t1) &&
|
||||
clip_segment_slab(p0.z, p1.z - p0.z, min_z, max_z, t0, t1);
|
||||
}
|
||||
|
||||
bool segment_intersects_aabb_2d(Vec2 p0, Vec2 p1,
|
||||
float min_x, float max_x,
|
||||
float min_z, float max_z) {
|
||||
float t0 = 0.0f;
|
||||
float t1 = 1.0f;
|
||||
return clip_segment_slab(p0.x, p1.x - p0.x, min_x, max_x, t0, t1) &&
|
||||
clip_segment_slab(p0.y, p1.y - p0.y, min_z, max_z, t0, t1);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -556,11 +569,23 @@ void RaceSim::update_checkpoints_and_laps(CraftState& c, float dt) {
|
||||
const auto& gate = level_.checkpoints[expected];
|
||||
Vec2 move = p1 - p0;
|
||||
float mlen = move.len();
|
||||
bool moving_forward = (mlen <= 1e-4f || move.dot(gate.dir) >= -0.25f * mlen);
|
||||
bool moving_forward = gate.bidirectional || (mlen <= 1e-4f) || (move.dot(gate.dir) >= -0.25f * mlen);
|
||||
float cross_frac = 1.0f;
|
||||
if (moving_forward &&
|
||||
segments_intersect_or_near(p0, p1, Vec2(gate.x0, gate.z0), Vec2(gate.x1, gate.z1),
|
||||
2.5f, &cross_frac)) {
|
||||
bool crossed = false;
|
||||
if (moving_forward) {
|
||||
crossed = segments_intersect_or_near(p0, p1, Vec2(gate.x0, gate.z0), Vec2(gate.x1, gate.z1),
|
||||
2.5f, &cross_frac);
|
||||
if (!crossed && gate.bidirectional) {
|
||||
// Authentic Bullfrog checkpoint strip spans inclusive grid cells [min..max+1]
|
||||
float gx0 = std::min(gate.x0, gate.x1);
|
||||
float gx1 = std::max(gate.x0, gate.x1) + 1.0f;
|
||||
float gz0 = std::min(gate.z0, gate.z1);
|
||||
float gz1 = std::max(gate.z0, gate.z1) + 1.0f;
|
||||
crossed = segment_intersects_aabb_2d(p0, p1, gx0, gx1, gz0, gz1);
|
||||
cross_frac = 1.0f;
|
||||
}
|
||||
}
|
||||
if (crossed) {
|
||||
++c.checkpoints_passed;
|
||||
c.next_checkpoint = (expected + 1) % num_cps;
|
||||
c.wrong_way = false;
|
||||
@@ -884,9 +909,34 @@ void RaceSim::activate_group(uint16_t group, int actor_player, bool allow_banner
|
||||
const bool in_dst = (pk.pos.x >= dx0 && pk.pos.x < dx1 &&
|
||||
pk.pos.z >= dz0 && pk.pos.z < dz1);
|
||||
if (in_src && !in_dst) {
|
||||
pk.pos.x += shift_x;
|
||||
pk.pos.z += shift_z;
|
||||
pk.pos.y = level_.sample_entity_surface_y(pk.pos.x, pk.pos.z) + 0.45f;
|
||||
const float nx = pk.pos.x + shift_x;
|
||||
const float nz = pk.pos.z + shift_z;
|
||||
PickupItem* conflict = nullptr;
|
||||
for (auto& other : pickups_) {
|
||||
if (&other == &pk || !other.group_unlocked) continue;
|
||||
float dx = other.pos.x - nx;
|
||||
float dz = other.pos.z - nz;
|
||||
if (dx * dx + dz * dz <= 0.25f) {
|
||||
conflict = &other;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (conflict != nullptr) {
|
||||
if (pk.group == m.group && conflict->group != m.group) {
|
||||
conflict->active = false;
|
||||
conflict->group_unlocked = false;
|
||||
pk.pos.x = nx;
|
||||
pk.pos.z = nz;
|
||||
pk.pos.y = level_.sample_entity_surface_y(nx, nz) + 0.45f;
|
||||
} else {
|
||||
pk.active = false;
|
||||
pk.group_unlocked = false;
|
||||
}
|
||||
} else {
|
||||
pk.pos.x = nx;
|
||||
pk.pos.z = nz;
|
||||
pk.pos.y = level_.sample_entity_surface_y(nx, nz) + 0.45f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -897,10 +947,12 @@ void RaceSim::activate_group(uint16_t group, int actor_player, bool allow_banner
|
||||
|
||||
if (am.duration <= 0.0f) {
|
||||
apply_morph_fraction(am, 1.0f);
|
||||
morph_touched_.clear();
|
||||
morph_touched_.push_back({m.dst_x, m.dst_z, m.dst_x + m.size_x, m.dst_z + m.size_z});
|
||||
morph_touched_.push_back({m.src_x, m.src_z, m.src_x + m.size_x, m.src_z + m.size_z});
|
||||
resnap_entities_in_rects(morph_touched_);
|
||||
if (height_differs || tex_or_col_differs) {
|
||||
morph_touched_.clear();
|
||||
morph_touched_.push_back({m.dst_x, m.dst_z, m.dst_x + m.size_x, m.dst_z + m.size_z});
|
||||
morph_touched_.push_back({m.src_x, m.src_z, m.src_x + m.size_x, m.src_z + m.size_z});
|
||||
resnap_entities_in_rects(morph_touched_);
|
||||
}
|
||||
} else {
|
||||
active_morphs_.push_back(std::move(am));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user