41 lines
993 B
C++
41 lines
993 B
C++
#pragma once
|
|
|
|
#include "IViewportHostService.h"
|
|
|
|
#include <XCEngine/Core/Math/Ray.h>
|
|
#include <XCEngine/Core/Math/Vector2.h>
|
|
|
|
#include <cstdint>
|
|
|
|
namespace XCEngine {
|
|
namespace Components {
|
|
class Scene;
|
|
} // namespace Components
|
|
|
|
namespace Editor {
|
|
|
|
struct SceneViewportPickRequest {
|
|
const Components::Scene* scene = nullptr;
|
|
SceneViewportOverlayData overlay = {};
|
|
Math::Vector2 viewportSize = Math::Vector2::Zero();
|
|
Math::Vector2 viewportPosition = Math::Vector2::Zero();
|
|
};
|
|
|
|
struct SceneViewportPickResult {
|
|
uint64_t entityId = 0;
|
|
Math::Vector3 worldPosition = Math::Vector3::Zero();
|
|
float distanceSq = Math::FLOAT_MAX;
|
|
bool hit = false;
|
|
};
|
|
|
|
bool BuildSceneViewportRay(
|
|
const SceneViewportOverlayData& overlay,
|
|
const Math::Vector2& viewportSize,
|
|
const Math::Vector2& viewportPosition,
|
|
Math::Ray& outRay);
|
|
|
|
SceneViewportPickResult PickSceneViewportEntity(const SceneViewportPickRequest& request);
|
|
|
|
} // namespace Editor
|
|
} // namespace XCEngine
|