INNER CODE UNIT · C++

avg_frame_time

trillek-team/tec · client/game.cpp:179

		avg_frame_time = static_cast<float>(frame_deltas / frames);
		frame_deltas = 0;
		frames = 0;
	}

	if (this->player_camera != nullptr) {
		const int window_width = os.GetWindowWidth();
		const int window_height = os.GetWindowHeight();
		double mouse_x, mouse_y;
		if (this->player_camera->mouse_look) {
			os.EnableMouseLock(); // TODO: create event to change to mouse look
			mouse_x = static_cast<double>(window_width) / 2.0;
			mouse_y = static_cast<double>(window_height) / 2.0;
			const auto intersection = ps.GetLastRayPos();
			const auto player_position = ps.GetPosition(player_entity_id);
			placement.SetRayIntersectionPoint(player_position.value, intersection);
		}
		else {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…