Class BaseMixedRealityLineDataProvider
Base class that provides data about a line.
Inheritance
BaseMixedRealityLineDataProvider
Assembly: cs.temp.dll.dll
public abstract class BaseMixedRealityLineDataProvider : MonoBehaviour, MonoBehaviour
Fields
Declaration
protected const int UnclampedWorldLengthSearchSteps = 10
Field Value
Declaration
protected const int UnclampedWorldLengthSearchSteps = 10
Field Value
Properties
A list of distorters that apply to this line
Declaration
public IReadOnlyList<Distorter> Distorters { get; }
Property Value
Type |
Description |
IReadOnlyList<Distorter> |
|
A list of distorters that apply to this line
Declaration
public IReadOnlyList<Distorter> Distorters { get; }
Property Value
Type |
Description |
IReadOnlyList<Distorter> |
|
Enabled / disables all distorters used by line.
Declaration
public bool DistortionEnabled { get; set; }
Property Value
Enabled / disables all distorters used by line.
Declaration
public bool DistortionEnabled { get; set; }
Property Value
NormalizedLength mode uses the DistortionStrength curve for distortion strength, Uniform uses UniformDistortionStrength along entire line
Declaration
public DistortionMode DistortionMode { get; set; }
Property Value
NormalizedLength mode uses the DistortionStrength curve for distortion strength, Uniform uses UniformDistortionStrength along entire line
Declaration
public DistortionMode DistortionMode { get; set; }
Property Value
Curve that defines distoration strength over distance, only used when DistortionMode = NormalizedLength
Declaration
public AnimationCurve DistortionStrength { get; set; }
Property Value
Type |
Description |
AnimationCurve |
|
Curve that defines distoration strength over distance, only used when DistortionMode = NormalizedLength
Declaration
public AnimationCurve DistortionStrength { get; set; }
Property Value
Type |
Description |
AnimationCurve |
|
Returns world position of first point along line as defined by this data provider
Declaration
public Vector3 FirstPoint { get; set; }
Property Value
Returns world position of first point along line as defined by this data provider
Declaration
public Vector3 FirstPoint { get; set; }
Property Value
Reverses up vector when determining rotation along line
Declaration
public bool FlipUpVector { get; set; }
Property Value
Reverses up vector when determining rotation along line
Declaration
public bool FlipUpVector { get; set; }
Property Value
Returns world position of last point along line as defined by this data provider
Declaration
public Vector3 LastPoint { get; set; }
Property Value
Returns world position of last point along line as defined by this data provider
Declaration
public Vector3 LastPoint { get; set; }
Property Value
Clamps the line's normalized end point. This setting will affect line renderers.
Declaration
public float LineEndClamp { get; set; }
Property Value
Clamps the line's normalized end point. This setting will affect line renderers.
Declaration
public float LineEndClamp { get; set; }
Property Value
Clamps the line's normalized start point. This setting will affect line renderers.
Declaration
public float LineStartClamp { get; set; }
Property Value
Clamps the line's normalized start point. This setting will affect line renderers.
Declaration
public float LineStartClamp { get; set; }
Property Value
Transform to use when translating points from local to world space. If null, this object's transform is used.
Declaration
public Transform LineTransform { get; set; }
Property Value
Type |
Description |
Transform |
|
Transform to use when translating points from local to world space. If null, this object's transform is used.
Declaration
public Transform LineTransform { get; set; }
Property Value
Type |
Description |
Transform |
|
Controls whether this line loops
Declaration
public virtual bool Loops { get; set; }
Property Value
Controls whether this line loops
Declaration
public virtual bool Loops { get; set; }
Property Value
The weight of manual up vectors in Velocity rotation mode
Declaration
public float ManualUpVectorBlend { get; set; }
Property Value
The weight of manual up vectors in Velocity rotation mode
Declaration
public float ManualUpVectorBlend { get; set; }
Property Value
These vectors are used with ManualUpVectorBlend to determine rotation along the line in Velocity rotation mode. Vectors are distributed along the normalized length of the line.
Declaration
public Vector3[] ManualUpVectors { get; set; }
Property Value
Type |
Description |
Vector3[] |
|
These vectors are used with ManualUpVectorBlend to determine rotation along the line in Velocity rotation mode. Vectors are distributed along the normalized length of the line.
Declaration
public Vector3[] ManualUpVectors { get; set; }
Property Value
Type |
Description |
Vector3[] |
|
Local space offset to transform position. Used to determine rotation along line in RelativeToOrigin rotation mode
Declaration
public Vector3 OriginOffset { get; set; }
Property Value
Local space offset to transform position. Used to determine rotation along line in RelativeToOrigin rotation mode
Declaration
public Vector3 OriginOffset { get; set; }
Property Value
The number of points this line has.
Declaration
public abstract int PointCount { get; }
Property Value
The number of points this line has.
Declaration
public abstract int PointCount { get; }
Property Value
The rotation mode used in the GetRotation function. You can visualize rotations by checking Draw Rotations under Editor Settings.
Declaration
public LineRotationMode RotationMode { get; set; }
Property Value
The rotation mode used in the GetRotation function. You can visualize rotations by checking Draw Rotations under Editor Settings.
Declaration
public LineRotationMode RotationMode { get; set; }
Property Value
Defines how a base line data provider will transform its points
Declaration
public LinePointTransformMode TransformMode { get; set; }
Property Value
Defines how a base line data provider will transform its points
Declaration
public LinePointTransformMode TransformMode { get; set; }
Property Value
Declaration
public float UnClampedWorldLength { get; }
Property Value
Declaration
public float UnClampedWorldLength { get; }
Property Value
Float value that defines distoration strength uniformly over distance, only used when DistortionMode = Uniform
Declaration
public float UniformDistortionStrength { get; set; }
Property Value
Float value that defines distoration strength uniformly over distance, only used when DistortionMode = Uniform
Declaration
public float UniformDistortionStrength { get; set; }
Property Value
Used in Velocity rotation mode.
Declaration
public float VelocitySearchRange { get; set; }
Property Value
Used in Velocity rotation mode.
Declaration
public float VelocitySearchRange { get; set; }
Property Value
Methods
Declaration
protected virtual void DrawUnselectedGizmosPreview()
Declaration
protected virtual void DrawUnselectedGizmosPreview()
Iterates along line until it finds the point closest to worldPosition
Declaration
public Vector3 GetClosestPoint(Vector3 worldPosition, int resolution = 5, int maxIterations = 5)
Parameters
Type |
Name |
Description |
Vector3 |
worldPosition |
|
Int32 |
resolution |
|
Int32 |
maxIterations |
|
Returns
Iterates along line until it finds the point closest to worldPosition
Declaration
public Vector3 GetClosestPoint(Vector3 worldPosition, int resolution = 5, int maxIterations = 5)
Parameters
Type |
Name |
Description |
Vector3 |
worldPosition |
|
Int32 |
resolution |
|
Int32 |
maxIterations |
|
Returns
Returns a normalized length corresponding to a world length
Useful for determining LineStartClamp / LineEndClamp values
Declaration
public float GetNormalizedLengthFromWorldLength(float worldLength, int searchResolution = 10)
Parameters
Type |
Name |
Description |
Single |
worldLength |
|
Int32 |
searchResolution |
|
Returns
Returns a normalized length corresponding to a world length
Useful for determining LineStartClamp / LineEndClamp values
Declaration
public float GetNormalizedLengthFromWorldLength(float worldLength, int searchResolution = 10)
Parameters
Type |
Name |
Description |
Single |
worldLength |
|
Int32 |
searchResolution |
|
Returns
Iterates along line until it finds the length closest to worldposition.
Declaration
public float GetNormalizedLengthFromWorldPos(Vector3 worldPosition, int resolution = 5, int maxIterations = 5)
Parameters
Type |
Name |
Description |
Vector3 |
worldPosition |
|
Int32 |
resolution |
|
Int32 |
maxIterations |
|
Returns
Iterates along line until it finds the length closest to worldposition.
Declaration
public float GetNormalizedLengthFromWorldPos(Vector3 worldPosition, int resolution = 5, int maxIterations = 5)
Parameters
Type |
Name |
Description |
Vector3 |
worldPosition |
|
Int32 |
resolution |
|
Int32 |
maxIterations |
|
Returns
Gets a point along the line at the specified index
Declaration
public Vector3 GetPoint(int pointIndex)
Parameters
Type |
Name |
Description |
Int32 |
pointIndex |
|
Returns
Gets a point along the line at the specified index
Declaration
public Vector3 GetPoint(int pointIndex)
Parameters
Type |
Name |
Description |
Int32 |
pointIndex |
|
Returns
Gets a point along the line at the specified normalized length.
Declaration
public Vector3 GetPoint(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Gets a point along the line at the specified normalized length.
Declaration
public Vector3 GetPoint(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Get a point based on point index
Point index will be pre-clamped
Declaration
protected abstract Vector3 GetPointInternal(int pointIndex)
Parameters
Type |
Name |
Description |
Int32 |
pointIndex |
|
Returns
Get a point based on point index
Point index will be pre-clamped
Declaration
protected abstract Vector3 GetPointInternal(int pointIndex)
Parameters
Type |
Name |
Description |
Int32 |
pointIndex |
|
Returns
Get a point based on normalized distance along line
Normalized distance will be pre-clamped
Declaration
protected abstract Vector3 GetPointInternal(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Get a point based on normalized distance along line
Normalized distance will be pre-clamped
Declaration
protected abstract Vector3 GetPointInternal(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Gets the rotation of a point along the line at the specified index
Declaration
public Quaternion GetRotation(int pointIndex, LineRotationMode lineRotationMode = null)
Parameters
Returns
Type |
Description |
Quaternion |
|
Gets the rotation of a point along the line at the specified index
Declaration
public Quaternion GetRotation(int pointIndex, LineRotationMode lineRotationMode = null)
Parameters
Returns
Type |
Description |
Quaternion |
|
Gets the rotation of a point along the line at the specified length
Declaration
public Quaternion GetRotation(float normalizedLength, LineRotationMode lineRotationMode = null)
Parameters
Returns
Type |
Description |
Quaternion |
|
Gets the rotation of a point along the line at the specified length
Declaration
public Quaternion GetRotation(float normalizedLength, LineRotationMode lineRotationMode = null)
Parameters
Returns
Type |
Description |
Quaternion |
|
Gets a point along the line at the specified length without using LineStartClamp or LineEndClamp
Declaration
public Vector3 GetUnClampedPoint(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Gets a point along the line at the specified length without using LineStartClamp or LineEndClamp
Declaration
public Vector3 GetUnClampedPoint(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Get the UnClamped world length of the line
Declaration
protected abstract float GetUnClampedWorldLengthInternal()
Returns
Get the UnClamped world length of the line
Declaration
protected abstract float GetUnClampedWorldLengthInternal()
Returns
Gets the up vector at a normalized length along line (used for rotation)
Declaration
protected virtual Vector3 GetUpVectorInternal(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Gets the up vector at a normalized length along line (used for rotation)
Declaration
protected virtual Vector3 GetUpVectorInternal(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Gets the velocity along the line
Declaration
public Vector3 GetVelocity(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Gets the velocity along the line
Declaration
public Vector3 GetVelocity(float normalizedLength)
Parameters
Type |
Name |
Description |
Single |
normalizedLength |
|
Returns
Declaration
protected virtual void LateUpdate()
Declaration
protected virtual void LateUpdate()
Declaration
protected virtual void OnEnable()
Declaration
protected virtual void OnEnable()
Sets a point in the line
This function is not guaranteed to have an effect
Declaration
public void SetPoint(int pointIndex, Vector3 point)
Parameters
Type |
Name |
Description |
Int32 |
pointIndex |
|
Vector3 |
point |
|
Sets a point in the line
This function is not guaranteed to have an effect
Declaration
public void SetPoint(int pointIndex, Vector3 point)
Parameters
Type |
Name |
Description |
Int32 |
pointIndex |
|
Vector3 |
point |
|
Declaration
protected abstract void SetPointInternal(int pointIndex, Vector3 point)
Parameters
Type |
Name |
Description |
Int32 |
pointIndex |
|
Vector3 |
point |
|
Declaration
protected abstract void SetPointInternal(int pointIndex, Vector3 point)
Parameters
Type |
Name |
Description |
Int32 |
pointIndex |
|
Vector3 |
point |
|
Declaration
public void UpdateMatrix()
Declaration
public void UpdateMatrix()
Implements
MonoBehaviour