rickomax / psxprev

PSXPREV - Playstation (PSX) Files Previewer/Extractor
BSD 2-Clause "Simplified" License
193 stars 10 forks source link

Fix Gizmo Translation and add Reset Transform #56

Closed trigger-segfault closed 1 year ago

trigger-segfault commented 1 year ago

Short explanation

This PR aims to fix the Translation Gizmo (issue #50), and a handful of other transform issues generally stemming from matrix multiplication.

An additional feature has been added to store a model's original LocalMatrix transform, and allow users to reset the model's transform from the Model menu.

Lastly, a UI thread issue has been fixed with PreviewForm and LauncherForm, where these classes were constructed outside the UI thread, but run by the application inside the thread. I have no idea how this didn't cause problems sooner, since I only encountered an issue after adding a submenu under the Model menu.

Preview: UI thread error ![image](https://github.com/rickomax/psxprev/assets/9752430/b115170b-b38d-44d8-b0f4-e1950bcdae29)

Detailed explanation

EntityBase

WorldMatrix

ResetTransform

ApplyTranslation → ApplyTransform

GetRootEntity


PreviewForm

Export Selected ▹
Reset Transform ▹
    Reset Whole Model
    Reset Selected Model
----------
Wireframe
...

Program