forked from alvani/Unity-glTF-Exporter
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathGlTF_Perspective.cs
39 lines (38 loc) · 1.16 KB
/
GlTF_Perspective.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
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
public class GlTF_Perspective : GlTF_Camera {
public float aspect_ratio;
public float yfov;//": 37.8492,
public float zfar;//": 100,
public float znear;//": 0.01
public GlTF_Perspective() { type = "perspective"; }
public override void Write ()
{
/*
"camera_0": {
"perspective": {
"yfov": 45,
"zfar": 3162.76,
"znear": 12.651
},
"type": "perspective"
}
*/
Indent(); jsonWriter.Write ("{\n");
IndentIn();
Indent(); jsonWriter.Write ("\"perspective\": {\n");
IndentIn();
Indent(); jsonWriter.Write ("\"aspect_ratio\": "+aspect_ratio.ToString()+",\n");
Indent(); jsonWriter.Write ("\"yfov\": "+yfov.ToString()+",\n");
Indent(); jsonWriter.Write ("\"zfar\": "+zfar.ToString()+",\n");
Indent(); jsonWriter.Write ("\"znear\": "+znear.ToString()+",\n");
Indent(); jsonWriter.Write("\"name\": \"" + name + "\"\n");
IndentOut();
Indent(); jsonWriter.Write ("},\n");
Indent(); jsonWriter.Write ("\"type\": \"perspective\"\n");
IndentOut();
Indent(); jsonWriter.Write ("}");
}
}
#endif