Tanoda
LocalFrustum.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
9using UnityEngine;
10
11namespace Leap.Unity.Geometry {
12
13 [System.Serializable]
14 public struct LocalFrustum {
15
16 [SerializeField]
17 private float _angle;
18 public float angle {
19 get { _angle = Mathf.Clamp(_angle, -179f, 179f); return _angle; }
20 set { _angle = Mathf.Clamp(value, -179f, 179f); }
21 }
22 public float near;
23 public float far;
24
25 public static LocalFrustum Default { get {
26 return new LocalFrustum(90f, 0.10f, 0.50f);
27 }}
28
29 public LocalFrustum(float angle, float near = 0.10f, float far = 0.50f) {
30 this._angle = angle;
31 this.near = near;
32 this.far = far;
33 }
34
35 public Frustum With(Transform t) {
36 return new Frustum(angle, near, far, t);
37 }
38
39 }
40
41}
static LocalFrustum Default
Definition: LocalFrustum.cs:25
Frustum With(Transform t)
Definition: LocalFrustum.cs:35
LocalFrustum(float angle, float near=0.10f, float far=0.50f)
Definition: LocalFrustum.cs:29