more D3D interop work

This commit is contained in:
Nick Fisher
2023-09-26 15:14:17 +10:00
parent 77eb42ce30
commit c27ca565f9
17 changed files with 2971 additions and 93 deletions

View File

@@ -954,18 +954,15 @@ void FilamentViewer::grabUpdate(float x, float y) {
return;
}
Camera& cam =_view->getCamera();
auto eye = cam.getPosition();// math::float3 {0.0f, 0.5f, 50.0f } ;// ; //
auto eye = cam.getPosition();
auto target = eye + cam.getForwardVector();
auto upward = cam.getUpVector();
Viewport const& vp = _view->getViewport();
if(_panning) {
auto trans = cam.getModelMatrix() * mat4::translation(math::float3 { 10 * (x - _startX) / vp.width, 10 * (y - _startY) / vp.height, 0.0f });
auto trans = cam.getModelMatrix() * mat4::translation(math::float3 { 50 * (x - _startX) / vp.width, 50 * (y - _startY) / vp.height, 0.0f });
cam.setModelMatrix(trans);
} else {
auto trans = cam.getModelMatrix() * mat4::rotation(
0.01,
// math::float3 { 0.0f, 1.0f, 0.0f });
auto trans = cam.getModelMatrix() * mat4::rotation(0.05,
math::float3 { (y - _startY) / vp.height, (x - _startX) / vp.width, 0.0f });
cam.setModelMatrix(trans);
}