mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Improve floor detection for multi-story buildings
- Increase footprint sampling radius from 0.28 to 0.4 units - Only update floor cache if found floor is close to query height - Prevents caching wrong floor from different stories
This commit is contained in:
parent
e768f5048c
commit
bf6a5ba596
2 changed files with 7 additions and 5 deletions
|
|
@ -518,9 +518,9 @@ void CameraController::update(float deltaTime) {
|
|||
return base;
|
||||
};
|
||||
|
||||
// Sample center + small footprint to avoid slipping through narrow floor pieces.
|
||||
// Sample center + footprint to avoid slipping through narrow floor pieces.
|
||||
std::optional<float> groundH;
|
||||
constexpr float FOOTPRINT = 0.28f;
|
||||
constexpr float FOOTPRINT = 0.4f; // Larger footprint for better floor detection
|
||||
const glm::vec2 offsets[] = {
|
||||
{0.0f, 0.0f},
|
||||
{FOOTPRINT, 0.0f}, {-FOOTPRINT, 0.0f},
|
||||
|
|
@ -824,7 +824,7 @@ void CameraController::update(float deltaTime) {
|
|||
};
|
||||
|
||||
std::optional<float> groundH;
|
||||
constexpr float FOOTPRINT = 0.28f;
|
||||
constexpr float FOOTPRINT = 0.4f; // Larger footprint for better floor detection
|
||||
const glm::vec2 offsets[] = {
|
||||
{0.0f, 0.0f}, {FOOTPRINT, 0.0f}, {-FOOTPRINT, 0.0f}, {0.0f, FOOTPRINT}, {0.0f, -FOOTPRINT}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue