Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions game/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,14 @@ void Camera::tick(uint64_t dt) {
auto pl = isFree() ? nullptr : world->player();
auto& physic = *world->physic();

if(pl!=nullptr && !pl->isInWater()) {
if(pl!=nullptr && pl->isSwim()) {
inWater = (angles.x < -8.f);
}
else if(pl!=nullptr && (pl->isInAir() || pl->isJump()) && !pl->isDead()) {
// NOTE: not quite correct
inWater = physic.cameraRay(inter.target, origin).waterCol % 2;
} else {
}
else {
// NOTE: find a way to avoid persistent tracking
inWater = inWater ^ (physic.cameraRay(prev, origin).waterCol % 2);
}
Expand Down
Loading
Loading