59 lines
2.5 KiB
C++
59 lines
2.5 KiB
C++
#include "HydraGame.h"
|
|||
|
|
|
||
|
|
bool HydraGame::Initialise()
|
||
|
|
{
|
||
|
|
// m_angle = 0.01f;
|
||
|
|
|
||
|
|
m_sun_light_id = GetEngine()->ActorManager()->CreateActor<HydraDirectionalLightActor>();
|
||
|
|
GetEngine()->ActorManager()->InitialiseActor(m_sun_light_id);
|
||
|
|
GetEngine()->ActorManager()->SetOrientation(m_sun_light_id, -0.5f, 0.0f, 0.0f);
|
||
|
|
GetEngine()->ActorManager()->SetPosition(m_sun_light_id, glm::dvec3(0.0f, 4.0f, 10.0f));
|
||
|
|
|
||
|
|
|
||
|
|
// m_other_light_id = GetEngine()->ActorManager()->CreateActor<HydraDirectionalLightActor>();
|
||
|
|
// GetEngine()->ActorManager()->InitialiseActor(m_other_light_id);
|
||
|
|
// GetEngine()->ActorManager()->SetOrientation(m_other_light_id, 0.4f, 0.5f, 0.0f);
|
||
|
|
|
||
|
|
// //1.570796327f
|
||
|
|
// //3.141592654f
|
||
|
|
|
||
|
|
m_plane_actor_id = GetEngine()->ActorManager()->CreateActor<HydraPlaneActor>();
|
||
|
|
GetEngine()->ActorManager()->InitialiseActor(m_plane_actor_id);
|
||
|
|
GetEngine()->ActorManager()->SetPosition(m_plane_actor_id, glm::dvec3(0, 0, 0));
|
||
|
|
|
||
|
|
// m_cube_actor_id = GetEngine()->ActorManager()->CreateActor<HydraPlaneActor>();
|
||
|
|
// GetEngine()->ActorManager()->InitialiseActor(m_cube_actor_id);
|
||
|
|
// GetEngine()->ActorManager()->SetPosition(m_cube_actor_id, glm::dvec3(0, -2, 0));
|
||
|
|
// GetEngine()->ActorManager()->SetRelationship(m_plane_actor_id, m_cube_actor_id);
|
||
|
|
|
||
|
|
m_gltf_id = GetEngine()->ActorManager()->LoadActor("c:/Code/HydraV3/Media/AntiqueCamera.glb");
|
||
|
|
GetEngine()->ActorManager()->InitialiseActor(m_gltf_id);
|
||
|
|
GetEngine()->ActorManager()->SetPosition(m_gltf_id, glm::dvec3(0, 0, 0));
|
||
|
|
|
||
|
|
m_player_actor_id = GetEngine()->ActorManager()->CreateActor<HydraPlayerActor>();
|
||
|
|
GetEngine()->ActorManager()->InitialiseActor(m_player_actor_id);
|
||
|
|
GetEngine()->ActorManager()->SetPosition(m_player_actor_id, glm::dvec3(0, 4, 4));
|
||
|
|
|
||
|
|
GetEngine()->PossessPlayer(m_player_actor_id);
|
||
|
|
GetEngine()->Camera()->AttachToActor(m_player_actor_id);
|
||
|
|
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
void HydraGame::Update(float delta_t_seconds)
|
||
|
|
{
|
||
|
|
if (GetEngine()->KeyPressed(HYDRA_KEY_CODES::HYDRA_KEY_ESCAPE))
|
||
|
|
{
|
||
|
|
GetEngine()->Exit();
|
||
|
|
}
|
||
|
|
// GetEngine()->ActorManager()->SetOrientation(m_sun_light_id, m_angle, 0.4, 0.0f);
|
||
|
|
// if(m_angle > (M_PI) - 0.01)
|
||
|
|
// {
|
||
|
|
// m_angle = 0.01;
|
||
|
|
// }
|
||
|
|
|
||
|
|
m_angle += m_diff;
|
||
|
|
GetEngine()->ActorManager()->SetOrientation(m_sun_light_id, -0.2, m_angle, 0);
|
||
|
|
// GetEngine()->ActorManager()->SetOrientation(m_gltf_id, 0, m_angle, 0);
|
||
|
|
// GetEngine()->ActorManager()->SetOrientation(m_plane_actor_id, 0, m_angle, 0);
|
||
|
|
}
|