Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LineSelectorData changes in V2
#2
The LineSelectorData in v2 has been greatly improved and is now much faster.

Because of those changes, the methods in LineSelectorData class have changed.

As shown in the updated LineSelectionSample, you can get the mouse ray by the following code:
Code:
var mouseRay = SceneView.GetRayFromCamera(_lastMousePosition.X, _lastMousePosition.Y);
if (!mouseRay.IsValid)
    return;

// Then you can call:
var oneClosestPositionOnLine = oneLineSelectorData.GetClosestPositionOnLine(mouseRay.Position, mouseRay.Direction);

However, I understand your concern and in case when the LineSelectorData class is created with SceneView as a constructor parameter, then the GetClosestPositionOnLine method could internally calculate the mouse ray.

Because of that I have added a new overload to the GetClosestPositionOnLine method that takes a screenPosition (usually the mouse 2D positon). This method will be available with the next version of Ab4d.SharpEngine.
Andrej Benedik
  


Messages In This Thread
LineSelectorData changes in V2 - by henkt - 08-21-2024, 01:20 PM
RE: LineSelectorData changes in V2 - by abenedik - 08-21-2024, 01:56 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)