Skip to content

Instantly share code, notes, and snippets.

@nryota
nryota / VRNeck3DoF.cs
Created December 1, 2017 04:04
ポジトラなしのVRデバイスで回転時の違和感を減らすスクリプト
/*
VRNeck3DoF Ver.0.1 - zlib License
(C) NISHIDA Ryota, ship of EYLN http://dev.eyln.com
Oculus GoなどのポジショントラッキングがないVRデバイスで、
カメラ位置を1点に固定せず、疑似的な首を軸とした回転でカメラ位置を補正することで
視界のゆがみ、違和感を軽減します。
VRNeck3DoFをAddCompornentしたGameObjectの下にMainCameraを配置してください。
※OculusRiftで動作テストしているため、実際の各デバイスで正常動作するかは未確認です。
@nryota
nryota / MeshTest
Last active August 1, 2017 08:46
UnityでMeshを毎フレーム生成する場合の解放処理の比較テスト
// UnityでMeshを毎フレーム生成する場合の解放処理の比較テスト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeshTest : MonoBehaviour
{
public enum Mode
{
// イベント整理券PDF出力プログラム Ver.0.2
// Written by n_ryota, http://dev.eyln.com
import processing.pdf.*;
String titleName = "■ Title"; // 展示名
String areaName = "Area X"; // 展示場所名
String logoFile = "logo.png"; // ロゴ画像ファイル名(dataフォルダ下)
int ticketStartMinute = 60 * 12; // 開始時刻(分)
int ticketAddMinute = 5; // 体験時間(分)
int bookingNum = 2; // 同一時間帯でダブらせる人数
// OculusFinger Ver.0.21 - zlib License
// (C) NISHIDA Ryota, ship of EYLN http://dev.eyln.com
using UnityEngine;
using System.Collections.Generic;
public class OculusFinger : MonoBehaviour {
[TooltipAttribute("Awake時に現在のFingerTypeにあわせて自動設定を行うか")]
public bool isAwakeAutoSetup = true;
[TooltipAttribute("Oculus Touchによるタッチ入力を有効にするか")]
Vive Grip
https://www.assetstore.unity3d.com/en/#!/content/62324
Requires Unity 5.3.4 or higher.
Vive Grip helps you to highlight, grab, and interact with game objects using the HTC Vive.
It leverages Unity's physics engine with a simple interface that abstracts the powerful ConfigurableJoint component.
Examples are included for creating weighted objects, levers, dials, guns, and more.
The code has a focus on readability and abstraction.