This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stereokit.hlsli> | |
//--color:color = 1,1,1,1 | |
//--tex_scale = 1 | |
//--diffuse = white | |
float4 color; | |
float tex_scale; | |
Texture2D diffuse : register(t0); | |
SamplerState diffuse_s : register(s0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function will restore the StereoKit theme used in versions prior to | |
// v0.3.9. | |
// This also requires the previous UI shaders, you will need to copy them and | |
// add them to your project's Assets. This file references them as: | |
// ui.hlsl - https://github.com/StereoKit/StereoKit/blob/646afeef576a2f04103b0b99e2ee932cffa814b4/StereoKitC/shaders_builtin/shader_builtin_ui.hlsl | |
// ui_quadrant.hlsl - https://github.com/StereoKit/StereoKit/blob/646afeef576a2f04103b0b99e2ee932cffa814b4/StereoKitC/shaders_builtin/shader_builtin_ui_quadrant.hlsl | |
static void ApplyTheme_SKPrevious() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stereokit.hlsli" | |
//--color:color = 1, 1, 1, 1 | |
//--grid_size = 0.004 | |
//--dot_percent = 0.1 | |
//--show_radius = 0.04 | |
float4 color; | |
float grid_size; | |
float dot_percent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using StereoKit; | |
class BinMesh { | |
const uint binMeshIdentifier = 0x06b8d800; // a nice blue color | |
const uint binMeshVersion = 0x00000001; // and then a version, should never make it to 255! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Reflection; | |
namespace StereoKit.Framework | |
{ | |
/////////////////////////////////////////// | |
abstract class InspectorAttribute : Attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pose grabBarPose = new Pose(0, 0, -0.5f, Quat.LookDir(0, 0, 1)); | |
Vec2 windowSize = Vec2.Zero; // First frame will not be in the right spot unless we know window size in advance. | |
public void Update() | |
{ | |
// Use the size of the Window to position it directly above the grab | |
// bar. Note that we're using the Pose relative Up direction instead of | |
// just the Y axis. | |
Pose windowPose = grabBarPose; | |
windowPose.position -= grabBarPose.Up * windowSize.y; | |
// Begin the window, only show the body, and don't allow the user to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using StereoKit; | |
SK.Initialize("SKRecenter"); | |
SK.Run(() => { | |
Mesh.Sphere.Draw(Material.Default, Matrix.TS(0, 0, -0.5f, 0.1f)); | |
if (Input.Key(Key.Space).IsJustActive()) { | |
// Get the head pose, and flatten the rotation to just the Y axis. | |
Pose head = Input.Head; | |
head.orientation.x = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stereokit.hlsli> | |
//--color: color = 1,1,1,1 | |
//--color2:color = 0,0,0,1 | |
//--slope = 1000 | |
//--threshold = 0.2 | |
float4 color; | |
float4 color2; | |
float threshold; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace StereoKit | |
{ | |
/// <summary>Some utility functions for converting coordinate data to and | |
/// from some commonly used tools! | |
/// | |
/// StereoKit uses a right-handed coordinate system, where +x is to the | |
/// right, +y is upwards, and -z is forward. This is the exact same | |
/// coordinate system as OpenXR, so no conversions are necessary there :) | |
/// | |
/// Unity uses a left-handed coordinate system, where +x is to the right, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace StereoKit.Framework | |
{ | |
public class StaticScene | |
{ | |
internal List<StaticSceneItem> _items = new List<StaticSceneItem>(); | |
public void AddModel(Model model, Matrix at) | |
{ |
NewerOlder