|
LineSelectorData Class |
LineSelectorData class can be used to get the closest distance of a specified screen position to the 3D line that is used to create an instance of LineSelectorData.
When LineSelectorData is created with LineNode parameter, then LineNode's WorldMatrix will be used to transform all the line positions.
It is also possible to apply custom transformation by setting the the
PositionsTransform property. In this case the LineNode's WorldMatrix is not used.
Inheritance Hierarchy Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax public class LineSelectorData
The LineSelectorData type exposes the following members.
Constructors Properties | Name | Description |
---|
| AdjustLineDistanceWithLineThickness |
Gets or sets a Boolean that specifies if LastDistance value is adjusted by line thickness.
If true then distance is measured from line edge, if false then distance is measured from center of the line.
This value is used only if LineSelectorData is created from BaseLineVisual3D.
|
| LastClosestPositionOnLine |
Gets as Vector3 that represents the position on the line that is closest to the mouse position.
This value is calculated in GetClosestDistance method.
|
| LastDistance |
Gets a float value that specifies the closest distance of this line to the specified position.
This value is calculated in GetClosestDistance method.
|
| LastDistanceFromCamera |
Gets a float value that represents a distance from the LastClosestPositionOnLine to the Camera.
|
| LastLinePositionIndex |
Gets an index of the first position of the line segment that is closest to the specified position.
This value is calculated in GetClosestDistance method.
|
| LineNode |
Gets a line SceneNode that was used to create this LineSelectorData.
|
| PositionsTransform |
Gets or sets a Transform that is used to transform all positions.
|
| SceneView |
SceneView that is used to show the 3D scene with 3D lines.
This property is also set when calling CalculateViewPositions(SceneView).
|
| UsedLineThickness |
Gets or sets LineThickness that is used to adjust the actual distance from the line.
This value can be automatically set from the LineSelectorData when it is created with BaseLineVisual3D and adjustLineDistanceWithLineThickness set to true.
|
| ViewPositions |
Gets a list of 2D view positions that were generated from 3D line positions by the CalculateViewPositions method.
|
TopMethods | Name | Description |
---|
| CalculateViewPositions(Matrix4x4) |
CalculateViewPositions method converts the 3D line positions into 2D positions that can be used for calculating distance to specified 2D position.
This method must be called before GetClosestDistance(Vector2) or GetClosestDistance(Vector2, Int32) can be called.
This method takes a reference to a worldToViewport Matrix4x4 and can be called on any thread.
To also transform the positions, call the CalculateViewPositions with an additional transformMatrix parameter.
|
| CalculateViewPositions(SceneView) |
CalculateViewPositions method converts the 3D line positions into 2D positions that can be used for calculating distance to specified 2D position.
This method must be called before GetClosestDistance(Vector2) or GetClosestDistance(Vector2, Int32) can be called.
This method can be called only on the UI thread. To call this method in multiple threads, use the method override that takes Matrix4x4 and Transform as parameters.
|
| CalculateViewPositions(Matrix4x4, Matrix4x4) |
CalculateViewPositions method converts the 3D line positions into 2D positions that can be used for calculating distance to specified 2D position.
This method must be called before GetClosestDistance(Vector2) or GetClosestDistance(Vector2, Int32) can be called.
This method takes a reference to a worldToViewport Matrix4x4 and an optional Transform and can be called on any thread.
|
| GetClosestDistance(Vector2) |
GetClosestDistance method calculates the closest distance of the line used to create this LineSelectorData to the specified position.
This method also sets LastDistance, LastLinePositionIndex, LastClosestPositionOnLine and LastDistanceFromCamera properties.
Before calling this method the CalculateViewPositions(SceneView), CalculateViewPositions(Matrix4x4) or CalculateViewPositions(Matrix4x4, Matrix4x4) method must be called.
|
| GetClosestDistance(Vector2, Int32) |
GetClosestDistance method calculates the closest distance of the line used to create this LineSelectorData to the specified position.
This method also sets LastDistance, LastLinePositionIndex and LastClosestPositionOnLine properties.
Before calling this method the CalculateViewPositions(SceneView), CalculateViewPositions(Matrix4x4) or CalculateViewPositions(Matrix4x4, Matrix4x4) method must be called.
|
| UpdateLinePositions |
UpdateLinePositions method updates the 3D line positions that are used to calculate the distances.
This method needs to be called when the 3D line positions are changed.
|
TopSee Also