forked from gradientspace/frame3Sharp
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSystemMouseCursorController.cs
65 lines (50 loc) · 1.43 KB
/
SystemMouseCursorController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using UnityEngine;
using System;
using System.Collections;
using g3;
namespace f3 {
public class SystemMouseCursorController : ICursorController
{
FContext context;
protected Ray3f CurrentWorldRay;
public Ray3f CurrentCursorWorldRay()
{
return CurrentWorldRay;
}
protected Ray3f CurrentUIRay;
public Ray3f CurrentCursorOrthoRay()
{
return CurrentUIRay;
}
public bool HasSecondPosition { get { return false; } }
public Ray3f SecondWorldRay() {
throw new NotImplementedException("VRMouseCursorController.SecondWorldRay: not supported!");
}
public SystemMouseCursorController(FContext context)
{
this.context = context;
}
// Use this for initialization
public void Start ()
{
}
public void Update ()
{
// just convert current system mouse position into ray
CurrentWorldRay = ((Camera)context.ActiveCamera).ScreenPointToRay(Input.mousePosition);
CurrentUIRay = ((Camera)context.OrthoUICamera).ScreenPointToRay(Input.mousePosition);
}
public void ResetCursorToCenter()
{
// invalid for system cursor
}
public void HideCursor()
{
// invalid for system cursor
}
public void ShowCursor()
{
// invalid for system cursor
}
}
}