Skip to content

Commit 642d0cc

Browse files
committed
fixup free camera
1 parent 66fd5bd commit 642d0cc

2 files changed

Lines changed: 1 addition & 20 deletions

File tree

game/camera.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -492,22 +492,6 @@ void Camera::setDialogDistance(float d) {
492492
dlgDist = d;
493493
}
494494

495-
Vec3 Camera::clampPos(Tempest::Vec3 pos, Vec3 dest) {
496-
auto dp = (dest-pos);
497-
auto len = dp.length();
498-
499-
if(len > maxDist && (len-maxDist)>0.f) {
500-
float tr = (len-maxDist);
501-
float k = tr/len;
502-
return pos + dp*k;
503-
}
504-
505-
// auto len2 = (dest-pos).length();
506-
// if(len2>0.f)
507-
// Log::i("lenClp = ", len2);
508-
return pos;
509-
}
510-
511495
void Camera::followPos(Vec3& pos, Vec3 dest, float dtF) {
512496
const auto& def = cameraDef();
513497

@@ -655,9 +639,7 @@ void Camera::calcControlPoints(float dtF) {
655639
rotOffsetMat.project(dir);
656640

657641
auto target = dst.target + targetOffset;
658-
659-
if(camMarvinMod!=M_Free)
660-
followPos(src.target,target,dtF);
642+
followPos(src.target,target,dtF);
661643

662644
auto camTg = src.target;//clampPos(src.target,target);
663645
followCamera(cameraPos,src.target,dtF);

game/camera.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ class Camera final {
174174

175175
void followCamera(Tempest::Vec3& pos, Tempest::Vec3 dest, float dtF);
176176
void followPos (Tempest::Vec3& pos, Tempest::Vec3 dest, float dtF);
177-
Tempest::Vec3 clampPos (Tempest::Vec3 pos, Tempest::Vec3 dest);
178177
void followAng (Tempest::Vec3& spin, Tempest::Vec3 dest, float dtF);
179178
static void followAng (float& ang, float dest, float speed, float dtF);
180179

0 commit comments

Comments
 (0)