Tanoda
LocalPlane.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
[System.Serializable]
20
public
struct
LocalPlane
{
21
22
public
Vector3
position
;
23
public
Vector3
normal
;
24
25
public
LocalPlane
(Vector3
position
, Vector3
normal
) {
26
this.position =
position
;
27
this.normal =
normal
;
28
}
29
30
public
Plane
With
(Transform t) {
31
return
new
Plane
(
position
,
normal
, t);
32
}
33
34
}
35
36
public
static
class
LocalPlaneExtensions {
37
42
public
static
LocalPlane ToWorldPlane(
this
Rect rect) {
43
var pose = rect.pose;
44
return
new
LocalPlane(pose.position, pose.rotation * Rect.PLANE_NORMAL);
45
}
46
51
public
static
LocalPlane ToLocalPlane(
this
Rect rect) {
52
var pose = rect.pose;
53
return
new
LocalPlane(Vector3.zero, Rect.PLANE_NORMAL);
54
}
55
56
}
57
58
}
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.LocalPlane
A transformless Plane defined by a position and normal vector.
Definition:
LocalPlane.cs:20
Leap.Unity.Geometry.LocalPlane.position
Vector3 position
Definition:
LocalPlane.cs:22
Leap.Unity.Geometry.LocalPlane.normal
Vector3 normal
Definition:
LocalPlane.cs:23
Leap.Unity.Geometry.LocalPlane.With
Plane With(Transform t)
Definition:
LocalPlane.cs:30
Leap.Unity.Geometry.LocalPlane.LocalPlane
LocalPlane(Vector3 position, Vector3 normal)
Definition:
LocalPlane.cs:25
Leap.Unity.Geometry.Plane
Definition:
Plane.cs:17
Source
Assets
Plugins
LeapMotion
Core
Scripts
Geometry
LocalShapes
LocalPlane.cs
Generated by
1.9.3