-
Notifications
You must be signed in to change notification settings - Fork 5
/
App.cs
38 lines (32 loc) · 945 Bytes
/
App.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
using StereoKit;
namespace StereoKitApp
{
public class App
{
public SKSettings Settings => new SKSettings {
appName = "StereoKit Template",
assetsFolder = "Assets",
displayPreference = DisplayMode.MixedReality
};
Pose cubePose = new Pose(0, 0, -0.5f, Quat.Identity);
Model cube;
Matrix floorTransform = Matrix.TS(new Vec3(0, -1.5f, 0), new Vec3(30, 0.1f, 30));
Material floorMaterial;
public void Init()
{
// Create assets used by the app
cube = Model.FromMesh(
Mesh.GenerateRoundedCube(Vec3.One * 0.1f, 0.02f),
Default.MaterialUI);
floorMaterial = new Material(Shader.FromFile("floor.hlsl"));
floorMaterial.Transparency = Transparency.Blend;
}
public void Step()
{
if (SK.System.displayType == Display.Opaque)
Default.MeshCube.Draw(floorMaterial, floorTransform);
UI.Handle("Cube", ref cubePose, cube.Bounds);
cube.Draw(cubePose.ToMatrix());
}
}
}