| 1043 | } |
| 1044 | |
| 1045 | Handle::EntityHandle WorldInstance::createCamera() |
| 1046 | { |
| 1047 | // Add player-camera |
| 1048 | m_Camera = addEntity(Components::PositionComponent::MASK); |
| 1049 | |
| 1050 | Math::Matrix lookAt = Math::Matrix::CreateLookAt(Math::float3(0, 0, 0), Math::float3(1, 0, 0), Math::float3(0, 1, 0)); |
| 1051 | getCameraComp<Components::PositionComponent>().m_WorldMatrix = lookAt.Invert(); |
| 1052 | |
| 1053 | getCameraComp<Components::PositionComponent>().m_WorldMatrix.Translation(Math::float3(0.0f, 50.0f, 50.0f)); |
| 1054 | |
| 1055 | Components::LogicComponent& logic = Components::Actions::initComponent<Components::LogicComponent>( |
| 1056 | getComponentAllocator(), |
| 1057 | m_Camera); |
| 1058 | |
| 1059 | Logic::CameraController* cam = new Logic::CameraController(*this, m_Camera); |
| 1060 | logic.m_pLogicController = cam; |
| 1061 | |
| 1062 | LogInfo() << "Setting camera mode to third-person"; |
| 1063 | cam->setCameraMode(Logic::CameraController::ECameraMode::ThirdPerson); |
| 1064 | //cam->getCameraSettings().freeCameraSettings.moveSpeed = 5.0f; |
| 1065 | //cam->getCameraSettings().freeCameraSettings.turnSpeed = 3.5f; |
| 1066 | |
| 1067 | return m_Camera; |
| 1068 | } |
| 1069 | |
| 1070 | Handle::EntityHandle WorldInstance::getCamera() |
| 1071 | { |
no test coverage detected