Tanoda
LocalSegment2.cs
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) Ultraleap, Inc. 2011-2020. *
3
* *
4
* Use subject to the terms of the Apache License 2.0 available at *
5
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6
* between Ultraleap and you, your company or other organization. *
7
******************************************************************************/
8
9
using
Leap
.
Unity
.
Infix
;
10
using
System.Collections;
11
using
System.Collections.Generic;
12
using
UnityEngine
;
13
14
namespace
Leap.Unity.Geometry
{
15
16
public
struct
LocalSegment2
{
17
18
public
Vector2
a
,
b
;
19
20
public
LocalSegment2
(Vector2
a
, Vector2
b
) {
21
this.a =
a
;
22
this.b =
b
;
23
}
24
29
public
float
Parameterize
(Vector2 pointOnSegment) {
30
if
((
a
-
b
).sqrMagnitude <
float
.Epsilon)
return
0f;
31
return
(pointOnSegment -
a
).magnitude / (
b
-
a
).magnitude;
32
}
33
34
//public LocalSegment3 WithZ(float z) {
35
// return new LocalSegment3(a.WithZ(z), b.WithZ(z));
36
//}
37
38
}
39
40
}
Leap.Unity.Geometry
Definition:
Bezier.cs:11
Leap.Unity.Infix
Definition:
Infix.cs:14
Leap.Unity
Definition:
AssetFolderPropertyDrawer.cs:15
Leap
Definition:
AssetFolderPropertyDrawer.cs:15
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Leap.Unity.Geometry.LocalSegment2
Definition:
LocalSegment2.cs:16
Leap.Unity.Geometry.LocalSegment2.b
Vector2 b
Definition:
LocalSegment2.cs:18
Leap.Unity.Geometry.LocalSegment2.a
Vector2 a
Definition:
LocalSegment2.cs:18
Leap.Unity.Geometry.LocalSegment2.Parameterize
float Parameterize(Vector2 pointOnSegment)
Given a point on the segment, parameterizes that point into a value such that a + (b - a)....
Definition:
LocalSegment2.cs:29
Leap.Unity.Geometry.LocalSegment2.LocalSegment2
LocalSegment2(Vector2 a, Vector2 b)
Definition:
LocalSegment2.cs:20
Source
Assets
Plugins
LeapMotion
Core
Scripts
Geometry
LocalShapes
LocalSegment2.cs
Generated by
1.9.3