ImGuizmo는 Dear ImGui 위에서 동작하는 간단한 변환 도구(Transform Gizmo)입니다. 개발자들이 3D 모델링 도구(예: Blender, Unity)에서 볼 수 있는 이동(Translate), 회전(Rotate), 크기 조정(Scale) 기능을 게임 엔진이나 편집기에 통합할 수 있도록 도와줍니다. 주요 기능은 다음과 같습니다:
ImGuizmo::SetOrthographic(false);
ImGuizmo::SetDrawlist();
ImGuizmo::SetRect(mViewportBounds[0].x, mViewportBounds[0].y
, mViewportBounds[1].x - mViewportBounds[0].x, mViewportBounds[1].y - mViewportBounds[0].y);
mViewportBounds
는 화면에서 뷰포트의 시작점(좌측 상단)과 크기(가로, 세로)를 나타냅니다.const ya::math::Matrix& viewMatrix = ya::renderer::mainCamera->GetViewMatrix();
const ya::math::Matrix& projectionMatrix = ya::renderer::mainCamera->GetProjectionMatrix();
ya::Transform* transform = selectedObject->GetComponent<ya::Transform>();
ya::math::Matrix worldMatrix = transform->GetWorldMatrix();