Improve Cloth usage

This commit is contained in:
Wojtek Figat
2023-11-01 10:46:47 +01:00
parent 1a254afd4f
commit c0a8d29453
3 changed files with 20 additions and 6 deletions

View File

@@ -225,6 +225,7 @@ namespace FlaxEngine.Tools
var cloth = _cloth;
if (cloth == null)
return;
var hasPaintInput = Owner.IsLeftMouseButtonDown && !Owner.IsAltKeyDown;
// Perform detailed tracing to find cursor location for the brush
var ray = Owner.MouseRay;
@@ -240,7 +241,7 @@ namespace FlaxEngine.Tools
// Cursor hit other object or nothing
PaintEnd();
if (Owner.IsLeftMouseButtonDown)
if (hasPaintInput)
{
// Select something else
var view = new Ray(Owner.ViewPosition, Owner.ViewDirection);
@@ -253,7 +254,7 @@ namespace FlaxEngine.Tools
}
// Handle painting
if (Owner.IsLeftMouseButtonDown)
if (hasPaintInput)
PaintStart();
else
PaintEnd();