-
Notifications
You must be signed in to change notification settings - Fork 0
/
CameraState.cs
71 lines (63 loc) · 1.59 KB
/
CameraState.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
66
67
68
69
70
71
// Decompiled with JetBrains decompiler
// Type: SimpleCamera.CameraState
// Assembly: SimpleCamera, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
using System;
namespace SimpleCamera
{
public class CameraState
{
public double tarx;
public double tary;
public double yaw;
public double pitch;
public double roll;
public double distance;
public double camx
{
get
{
return this.tarx + Math.Cos(this.pitch) * -Math.Cos(this.yaw) * this.distance / 32.0;
}
set
{
this.tarx += value - this.camx;
}
}
public double camy
{
get
{
return this.tary + Math.Cos(this.pitch) * -Math.Sin(this.yaw) * this.distance / 32.0;
}
set
{
this.tary += value - this.camy;
}
}
public CameraState(double tarx, double tary, double yaw, double pitch, double roll, double distance)
{
this.tarx = tarx;
this.tary = tary;
this.yaw = yaw;
this.pitch = pitch;
this.roll = roll;
this.distance = distance;
}
public CameraState()
{
}
public void apply(CameraManager cam)
{
cam.targetX = (float) this.tarx;
cam.targetY = (float) this.tary;
cam.yaw = (float) this.yaw;
cam.pitch = (float) this.pitch;
cam.roll = (float) this.roll;
cam.distance = (float) this.distance;
}
public override string ToString()
{
return "CameraState{" + (object) this.tarx + "," + (object) this.tary + "}";
}
}
}