Minor improvments to plane camera
parent
582e3c865f
commit
b058a6986b
|
@ -419,16 +419,26 @@ float CCamera::GetDist()
|
|||
return m_fixDist;
|
||||
}
|
||||
|
||||
void CCamera::SetFixDirection(float angle)
|
||||
void CCamera::SetFixDirectionH(float angle)
|
||||
{
|
||||
m_fixDirectionH = angle;
|
||||
}
|
||||
|
||||
float CCamera::GetFixDirection()
|
||||
float CCamera::GetFixDirectionH()
|
||||
{
|
||||
return m_fixDirectionH;
|
||||
}
|
||||
|
||||
void CCamera::SetFixDirectionV(float angle)
|
||||
{
|
||||
m_fixDirectionV = angle;
|
||||
}
|
||||
|
||||
float CCamera::GetFixDirectionV()
|
||||
{
|
||||
return m_fixDirectionV;
|
||||
}
|
||||
|
||||
void CCamera::SetRemotePan(float value)
|
||||
{
|
||||
m_remotePan = value;
|
||||
|
@ -1531,6 +1541,7 @@ bool CCamera::EventFrameFix(const Event &event)
|
|||
|
||||
// Up/Down
|
||||
m_fixDirectionV -= event.cameraInput.y * event.rTime * 0.7f * m_speed;
|
||||
m_fixDirectionV = Math::Min(Math::Max(m_fixDirectionV, -0.5*Math::PI), 0.25*Math::PI);
|
||||
|
||||
if ((m_mouseDirH != 0) || (m_mouseDirV != 0))
|
||||
AbortCentering(); // special stops framing
|
||||
|
|
|
@ -160,8 +160,10 @@ public:
|
|||
float GetDist();
|
||||
|
||||
//! Manage angle mode CAM_TYPE_FIX
|
||||
void SetFixDirection(float angle);
|
||||
float GetFixDirection();
|
||||
void SetFixDirectionH(float angle);
|
||||
float GetFixDirectionH();
|
||||
void SetFixDirectionV(float angle);
|
||||
float GetFixDirectionV();
|
||||
|
||||
//! Managing the triggering mode of the camera panning
|
||||
void SetRemotePan(float value);
|
||||
|
|
|
@ -2637,7 +2637,6 @@ bool CRobotMain::EventFrame(const Event &event)
|
|||
// NOTE: It's important to do this AFTER the first update event finished processing
|
||||
// because otherwise all robot parts are misplaced
|
||||
m_userPause = m_pause->ActivatePause(PAUSE_CODE_BATTLE_LOCK);
|
||||
m_sound->MuteAll(false); // Allow sound
|
||||
m_codeBattleInit = true; // Will start on resume
|
||||
}
|
||||
|
||||
|
@ -2649,6 +2648,7 @@ bool CRobotMain::EventFrame(const Event &event)
|
|||
// Deselect object, but keep camera attached to it
|
||||
CObject* obj = DeselectAll();
|
||||
SelectObject(obj, false); // this uses code battle selection mode already
|
||||
m_camera->SetFixDirectionV(-0.25f*Math::PI);
|
||||
|
||||
m_eventQueue->AddEvent(Event(EVENT_UPDINTERFACE));
|
||||
}
|
||||
|
@ -3597,7 +3597,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
|
|||
if (line->GetParam("fadeIn")->AsBool(false))
|
||||
m_camera->StartOver(Gfx::CAM_OVER_EFFECT_FADEIN_WHITE, Math::Vector(0.0f, 0.0f, 0.0f), 1.0f);
|
||||
|
||||
m_camera->SetFixDirection(line->GetParam("fixDirection")->AsFloat(0.25f)*Math::PI);
|
||||
m_camera->SetFixDirectionH(line->GetParam("fixDirection")->AsFloat(0.25f)*Math::PI);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue