AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
RestrictToBounds.cs
Go to the documentation of this file.
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
// Licensed under the MIT License. See LICENSE in the project root for license information.
3
4
using
UnityEngine
;
5
6
namespace
HoloToolkit
.Unity
7
{
11
[RequireComponent(typeof(Transform))]
12
public
class
RestrictToBounds
: MonoBehaviour
13
{
14
public
Vector3
Min
;
15
public
Vector3
Max
;
16
17
void
Update()
18
{
19
this.transform.localPosition =
MathExtensions
.
ClampComponentwise
(this.transform.localPosition,
this
.Min,
this
.Max);
20
}
21
}
22
}
HoloToolkit.Unity.RestrictToBounds.Max
Vector3 Max
Definition:
RestrictToBounds.cs:15
HoloToolkit.Unity.RestrictToBounds.Min
Vector3 Min
Definition:
RestrictToBounds.cs:14
HoloToolkit.Unity.MathExtensions
Extension methods and helper functions for various math data
Definition:
MathfExtensions.cs:11
HoloToolkit.Unity.RestrictToBounds
Keeps a game object within configured bounds
Definition:
RestrictToBounds.cs:12
HoloToolkit
UnityEngine
HoloToolkit.Unity.MathExtensions.ClampComponentwise
static Vector3 ClampComponentwise(Vector3 value, Vector3 min, Vector3 max)
Definition:
MathfExtensions.cs:55
Assets
HoloToolkit-Examples
Medical
Scripts
RestrictToBounds.cs
Generated by
1.8.12