mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-05-01 18:13:57 +00:00
Lower 3rd-to-1st person camera switch distance to 0.5
Separate the switch-to-first-person threshold from the default starting distance so the camera can zoom in closer before transitioning. Both mouse and touch inputs use the same new SWITCH_TO_FIRST_PERSON_DISTANCE constant (0.5f), while MIN_DISTANCE (1.5f) remains as the default orbit distance when activating 3rd person mode. https://claude.ai/code/session_01KJ8KHH4XWx7F5VxhSNGo7M
This commit is contained in:
parent
74271aa189
commit
071e066e8d
@ -54,6 +54,7 @@ class OrbitCamera {
|
||||
static constexpr float MIN_PITCH = 0.05f;
|
||||
static constexpr float MAX_PITCH = 1.4f;
|
||||
static constexpr float MIN_DISTANCE = 1.5f;
|
||||
static constexpr float SWITCH_TO_FIRST_PERSON_DISTANCE = 0.5f;
|
||||
static constexpr float MAX_DISTANCE = 15.0f;
|
||||
|
||||
private:
|
||||
|
||||
@ -91,7 +91,7 @@ void InputHandler::HandleSDLEvent(SDL_Event* p_event, OrbitCamera& p_orbit, bool
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (p_orbit.GetOrbitDistance() <= OrbitCamera::MIN_DISTANCE && p_event->wheel.y > 0) {
|
||||
if (p_orbit.GetOrbitDistance() <= OrbitCamera::SWITCH_TO_FIRST_PERSON_DISTANCE && p_event->wheel.y > 0) {
|
||||
m_wantsAutoDisable = true;
|
||||
break;
|
||||
}
|
||||
@ -215,7 +215,7 @@ void InputHandler::HandleSDLEvent(SDL_Event* p_event, OrbitCamera& p_orbit, bool
|
||||
break;
|
||||
}
|
||||
|
||||
if (p_orbit.GetOrbitDistance() <= OrbitCamera::MIN_DISTANCE) {
|
||||
if (p_orbit.GetOrbitDistance() <= OrbitCamera::SWITCH_TO_FIRST_PERSON_DISTANCE) {
|
||||
float totalDelta = newDist - m_touch.gesturePinchDist;
|
||||
if (totalDelta > PINCH_TRANSITION_THRESHOLD) {
|
||||
m_wantsAutoDisable = true;
|
||||
|
||||
@ -117,8 +117,8 @@ void OrbitCamera::ClampPitch()
|
||||
|
||||
void OrbitCamera::ClampDistance()
|
||||
{
|
||||
if (m_orbitDistance < MIN_DISTANCE) {
|
||||
m_orbitDistance = MIN_DISTANCE;
|
||||
if (m_orbitDistance < SWITCH_TO_FIRST_PERSON_DISTANCE) {
|
||||
m_orbitDistance = SWITCH_TO_FIRST_PERSON_DISTANCE;
|
||||
}
|
||||
if (m_orbitDistance > MAX_DISTANCE) {
|
||||
m_orbitDistance = MAX_DISTANCE;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user