Skip to content

Commit 6e3a5b6

Browse files
committed
camera minor cleanup
1 parent abf079e commit 6e3a5b6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

game/camera.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,8 @@ void Camera::followAng(Vec3& spin, Vec3 dest, float dtF) {
614614

615615
void Camera::followAng(float& ang, float dest, float speed, float dtF) {
616616
float da = angleMod(dest-ang);
617-
float shift = da*std::min(1.f, speed*dtF*1.f);
618-
if(std::abs(da)<0.01f || dtF<0.f) {
617+
float shift = da*speed*std::min(1.f, dtF);
618+
if(std::abs(da)<=0.0001f || dtF<0.f) {
619619
ang = dest;
620620
return;
621621
}
@@ -636,13 +636,13 @@ void Camera::tick(uint64_t dt) {
636636

637637
const float dtF = float(dt)/1000.f;
638638

639-
{
639+
{
640640
const auto& def = cameraDef();
641641
dst.range = def.min_range + (def.max_range-def.min_range)*userRange;
642642
const float zSpeed = 5.f;
643643
const float dz = dst.range-src.range;
644644
src.range+=dz*std::min(1.f,2.f*zSpeed*dtF);
645-
}
645+
}
646646

647647
auto prev = origin;
648648
calcControlPoints(dtF);

0 commit comments

Comments
 (0)