Class LineSketchObject
Provides methods to interact with a line game object in the scene.
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
LineSketchObject
Assembly: VRSketchingGeometry.dll
Syntax
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer), typeof(MeshCollider))]
public class LineSketchObject : SketchObject, ISelectable, IHighlightable, ISerializableComponent, IGroupable, IBrushable
Fields
LinearSplineMesh
Linierly interpolated spline for displaying a segment only two control points
Declaration
protected SplineMesh LinearSplineMesh
Field Value
lineDiameter
Declaration
protected float lineDiameter
Field Value
| Type |
Description |
| System.Single |
|
meshCollider
Collider for the mesh of the spline
Declaration
protected MeshCollider meshCollider
Field Value
| Type |
Description |
| UnityEngine.MeshCollider |
|
meshFilter
Mesh filter for the mesh of the spline
Declaration
protected MeshFilter meshFilter
Field Value
| Type |
Description |
| UnityEngine.MeshFilter |
|
minimumControlPointDistance
The minimal distance a new control point has to have to the last control point.
This is used by addControlPointContinuous.
Declaration
public float minimumControlPointDistance
Field Value
| Type |
Description |
| System.Single |
|
sphereObject
Object to be displayed for a line of a single control point
Declaration
[SerializeField]
protected GameObject sphereObject
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
SplineMesh
The instance of the smoothly interpolated Catmul-Rom spline mesh
Declaration
protected SplineMesh SplineMesh
Field Value
Methods
Awake()
Declaration
protected override void Awake()
Overrides
ChooseDisplayMethod()
Determines how to display the spline depending on the number of control points that are present.
Declaration
protected virtual void ChooseDisplayMethod()
DeleteControlPoints(GameObject, Vector3, Single)
Checks if gameObject is a LineSketchObject, then deletes control points of this LineSketchObject within radius
Declaration
public static void DeleteControlPoints(GameObject gameObject, Vector3 point, float radius)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
gameObject |
LineSketchObject of which control points should be deleted.
|
| UnityEngine.Vector3 |
point |
Point in world space.
|
| System.Single |
radius |
Radius in world space.
|
GetBrush()
Declaration
Returns
GetControlPoints()
Get the control points in local space.
Declaration
public List<Vector3> GetControlPoints()
Returns
| Type |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
|
GetData()
Declaration
protected LineSketchObjectData GetData()
Returns
getNumberOfControlPoints()
Declaration
public int getNumberOfControlPoints()
Returns
| Type |
Description |
| System.Int32 |
|
MakeSplineMesh(Int32, Vector3)
Factory method for instantiating a SplineMesh.
Declaration
protected virtual SplineMesh MakeSplineMesh(int interpolationSteps, Vector3 lineDiameter)
Parameters
| Type |
Name |
Description |
| System.Int32 |
interpolationSteps |
|
| UnityEngine.Vector3 |
lineDiameter |
|
Returns
SetBrush(Brush)
Declaration
public void SetBrush(Brush brush)
Parameters
| Type |
Name |
Description |
| Brush |
brush |
|
SetControlPoints(List<Vector3>)
Set all control points. Control points are expected to be in world space.
Declaration
public void SetControlPoints(List<Vector3> controlPoints)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
controlPoints |
|
SetControlPointsLocalSpace(List<Vector3>)
Set all control points. Control points are expected to be in local space.
Declaration
public void SetControlPointsLocalSpace(List<Vector3> controlPoints)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
controlPoints |
|
SetInterpolationSteps(Int32)
Set the number of interpolation steps between two control points.
A higher number makes the line smoother.
Declaration
public virtual void SetInterpolationSteps(int steps)
Parameters
| Type |
Name |
Description |
| System.Int32 |
steps |
|
SetLineCrossSection(List<Vector3>, List<Vector3>, Single)
Declaration
public virtual void SetLineCrossSection(List<Vector3> crossSection, List<Vector3> crossSectionNormals, float diameter)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
crossSection |
|
| System.Collections.Generic.List<UnityEngine.Vector3> |
crossSectionNormals |
|
| System.Single |
diameter |
|
SetLineDiameter(Single)
Declaration
public virtual void SetLineDiameter(float diameter)
Parameters
| Type |
Name |
Description |
| System.Single |
diameter |
|
Implements