Interface ILineRenderable
Get line points and hit point info for rendering.
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public interface ILineRenderable
Methods
GetLinePoints(ref Vector3[], out Int32)
Performs the computation to convert the sample points from their local positions to world space and outputs an array of those points to form a line.
Declaration
bool GetLinePoints(ref Vector3[] linePoints, out int numPoints)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | linePoints | When this method returns, contains the sample points if successful. |
Int32 | numPoints | When this method returns, contains the number of sample points if successful. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the sample points form a valid line, such as by having at least two points. Returns false otherwise. |
TryGetHitInfo(out Vector3, out Vector3, out Int32, out Boolean)
Gets the current raycast hit information., it will return the world position and the normal vector of the hit point, and its position in linePoints.
Declaration
bool TryGetHitInfo(out Vector3 position, out Vector3 normal, out int positionInLine, out bool isValidTarget)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | When this method returns, contains the world position of the ray impact point if the raycast result is valid. |
Vector3 | normal | When this method returns, contains the world normal of the surface the ray hit if the raycast result is valid. |
Int32 | positionInLine | When this method returns, contains the index within the list of raycast points returned by GetLinePoints(ref Vector3[], out Int32). |
Boolean | isValidTarget | When this method returns, contains whether both the raycast result is valid and a valid target for interaction. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the raycast result is valid. Returns false otherwise. |