Fix some cutscene bugs
This commit is contained in:
parent
7a526a4cab
commit
8ea112e26c
2 changed files with 20 additions and 16 deletions
|
@ -102,6 +102,8 @@ void CommonEditor::update(float deltaTime) {
|
|||
platform::capture_mouse(willCaptureMouse);
|
||||
|
||||
if(willCaptureMouse) {
|
||||
if(engine->get_scene() != nullptr && !engine->get_scene()->get_all<Camera>().empty()) {
|
||||
|
||||
yaw += engine->get_input()->get_value("lookX") * 50.0f * deltaTime;
|
||||
pitch += engine->get_input()->get_value("lookY") * 50.0f * deltaTime;
|
||||
|
||||
|
@ -121,6 +123,7 @@ void CommonEditor::update(float deltaTime) {
|
|||
|
||||
engine->get_scene()->get<Transform>(obj).rotation = angle_axis(yaw, prism::float3(0, 1, 0)) * angle_axis(pitch, prism::float3(1, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
doing_viewport_input = willCaptureMouse;
|
||||
|
||||
|
@ -925,7 +928,7 @@ GFXTexture* CommonEditor::generate_common_preview(Scene& scene, const prism::flo
|
|||
texture_create_info.width = thumbnail_resolution;
|
||||
texture_create_info.height = thumbnail_resolution;
|
||||
texture_create_info.format = GFXPixelFormat::RGBA8_UNORM;
|
||||
texture_create_info.usage = GFXTextureUsage::Attachment | GFXTextureUsage::Sampled;
|
||||
texture_create_info.usage = GFXTextureUsage::Attachment | GFXTextureUsage::Sampled | GFXTextureUsage::TransferDst;
|
||||
|
||||
auto final_texture = gfx->create_texture(texture_create_info);
|
||||
|
||||
|
@ -1085,7 +1088,7 @@ void CommonEditor::load_thumbnail_cache() {
|
|||
info.width = thumbnail_resolution;
|
||||
info.height = thumbnail_resolution;
|
||||
info.format = GFXPixelFormat::RGBA8_UNORM;
|
||||
info.usage = GFXTextureUsage::Sampled;
|
||||
info.usage = GFXTextureUsage::Sampled | GFXTextureUsage::TransferDst;
|
||||
|
||||
GFXTexture* texture = engine->get_gfx()->create_texture(info);
|
||||
|
||||
|
|
|
@ -425,7 +425,8 @@ void CutsceneEditor::drawUI() {
|
|||
ImGui::End();
|
||||
|
||||
if(ImGui::Begin("Viewport")) {
|
||||
drawViewport(engine->get_scene());
|
||||
if(currentShot != nullptr && currentShot->scene != nullptr)
|
||||
drawViewport(currentShot->scene);
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
|
Reference in a new issue