6 #include "ThemeStateController.h"
18 const std::string& initialStateName,
20 : m_themeStateController(themeStateController)
21 , m_targetStateName(initialStateName)
22 , m_pTargetState(NULL)
23 , m_pTargetStateTextures(NULL)
24 , m_transitionParam(0.0f)
25 , m_transitionSpeed(0.0f)
29 void OnSharedThemeDataUpdate()
31 m_themeStateController.ResetFromState();
36 m_pTargetState = &targetState;
37 m_pTargetStateTextures = &targetStateTextures;
38 m_targetStateName = m_pTargetState->Name;
40 m_themeStateController.StartTransitionToState(targetState, targetStateTextures);
42 m_transitionParam = 0.0f;
43 m_transitionSpeed = transitionSpeed;
48 m_pTargetState = &targetState;
49 m_pTargetStateTextures = &targetStateTextures;
50 m_targetStateName = m_pTargetState->Name;
52 m_themeStateController.SetState(targetState, targetStateTextures);
54 m_transitionParam = 0.0f;
55 m_transitionSpeed = 0.0f;
58 void Update(
float dt,
const dv3& ecefInterestPoint)
60 m_transitionParam += (dt * m_transitionSpeed);
62 if(m_transitionParam < 1.0f)
64 m_themeStateController.SetTransition(m_transitionParam, ecefInterestPoint);
68 m_transitionParam = 0.0f;
69 m_transitionSpeed = 0.0f;
70 m_themeStateController.SetState(*m_pTargetState, *m_pTargetStateTextures);
71 m_themeStateController.SetTransition(m_transitionParam, ecefInterestPoint);
75 const std::string& GetTargetStateName()
const
77 return m_targetStateName;
83 std::string m_targetStateName;
87 float m_transitionParam;
88 float m_transitionSpeed;