Tanoda
MovePoseExample.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
UnityEngine
;
10
11
namespace
Leap.Unity.Interaction.Examples
{
12
13
public
class
MovePoseExample
: MonoBehaviour {
14
15
public
Transform
target
;
16
private
Pose
_selfToTargetPose =
Pose
.
identity
;
17
18
private
void
OnEnable() {
19
_selfToTargetPose = this.transform.ToPose().
inverse
*
target
.transform.ToPose();
20
}
21
22
private
void
Start() {
23
#if UNITY_2017_2_OR_NEWER
24
if
(
Physics
.autoSyncTransforms) {
25
Debug
.LogWarning(
26
"Physics.autoSyncTransforms is enabled. This will cause Interaction "
27
+
"Buttons and similar elements to 'wobble' when this script is used to "
28
+
"move a parent transform. You can modify this setting in "
29
+
"Edit->Project Settings->Physics."
);
30
}
31
#endif
32
}
33
34
private
void
Update() {
35
target
.transform.SetPose(this.transform.ToPose() * _selfToTargetPose);
36
}
37
38
}
39
40
}
Debug
UnityEngine.Debug Debug
Definition:
TanodaServer.cs:19
Leap.Unity.Interaction.Examples.MovePoseExample
Definition:
MovePoseExample.cs:13
Leap.Unity.Interaction.Examples.MovePoseExample.target
Transform target
Definition:
MovePoseExample.cs:15
Leap.Unity.Interaction.Examples
Definition:
MovePoseExample.cs:11
Leap.Unity.ModelType.Physics
@ Physics
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Leap.Unity.Pose
A position and rotation. You can multiply two poses; this acts like Matrix4x4 multiplication,...
Definition:
Pose.cs:21
Leap.Unity.Pose.inverse
Pose inverse
Definition:
Pose.cs:37
Leap.Unity.Pose.identity
static readonly Pose identity
Definition:
Pose.cs:35
Source
Assets
Plugins
LeapMotion
Modules
InteractionEngine
Examples
2. Basic UI
MovePoseExample.cs
Generated by
1.9.3