Tanoda
LocalSphere.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 System.Collections;
10using System.Collections.Generic;
11using UnityEngine;
12
13namespace Leap.Unity.Geometry {
14
15 [System.Serializable]
16 public struct LocalSphere {
17
18 public Vector3 center;
19 public float radius;
20
21 public LocalSphere(Vector3 center, float radius) {
22 this.center = center;
23 this.radius = radius;
24 }
25 public LocalSphere(float radius) {
26 this.center = Vector3.zero;
27 this.radius = radius;
28 }
29
30 public Sphere With(Transform transform) {
31 return new Sphere(this, transform);
32 }
33
34 public static LocalSphere Default() {
35 return new LocalSphere(default(Vector3), 1f);
36 }
37
38 }
39
40}
Sphere With(Transform transform)
Definition: LocalSphere.cs:30
LocalSphere(Vector3 center, float radius)
Definition: LocalSphere.cs:21
static LocalSphere Default()
Definition: LocalSphere.cs:34