since: 2016/06/07
update: 2016/11/05
reference:
1. Setting up UE4 to work with SteamVR | Unreal Engine
2. Unreal Engine 4.12 Released!
A. SteamVR is Ready
> 確認
SteamVR 開啟後, 是處在
就緒的狀態.
-----------------------------------------------------------------------------------------------
B. 建立新專案:
> Launch Unreal Engine 4.12.0
1.
New Project >
Blueprint >
Blank
2.
Mobile / Tablet >
Scalable 3D or 2D >
No Starter Content >
Folder:
E:\RD\projects\Unreal
Name:
HelloVR
3.檢查是否
啟用支援該
VR 設備
a.
Edit >
Plugins
b.
Virtual Reality >
SteamVR 支援, 勾選
Enabled
4.
VR Preview
a. 按下 Play 鍵旁的小三角形 >
VR Preview
b.
結果:
(可戴上 VR 頭盔觀看)
-----------------------------------------------------------------------------------------------
C. 修正 VR 的地平線水平高度
1. 新增
Map 與
Blueprint 資料夾:
>
Content Brower >
Add New >
New Folder
結果: 在
Content Brower 的
Content 底下, 可以看到
Map 與
Blueprint 資料夾
2. 進入
Blueprint 資料夾, 新增二個
Blueprint 類別:
>
Content Brower >
Add New >
Blueprint Class
> Blueprint Node: Game Mode Name: VR_GameMode
> Blueprint Node: Pawn Name: VR_Pawn
結果:
3. 開啟
VR_GameMode Blueprint:
>
Details >
classes:
>
Default Pawn Class:
VR_Pawn
4. 關閉
VR_GameMode Blueprint 後, 回到關卡:
Window >
World Settings
> World Settings > GameMode:
GameMode Override: VR_GameMode
(只對目前的關卡改寫預設值)
5. 開啟
VR_Pawn Blueprint:
>
Details >
Camera:
Base Eye Height:
0.0
/* 以下為 4.12 版本 ################################################
6. 在
Components 頁籤, 新增:
SteamVRChaperone 與
Camera component
> 並確定:
camera 的 Transform Location 設為
0,0,0.
7. 關閉
VR_Pawn Blueprint 後, 回到關卡:
>
World Outliner >
Floor:
>
Transform >
Location: X:
0.0 Y:
0.0 Z:
0.0
>
World Outliner >
Player Start:
>
Transform >
Location: X:
0.0 Y:
0.0 Z:
1.0
8. 再執行一次:
VR Preview
以上為 4.12 版本 ################################################ */ /* 更新: 4.13 版本 */ 6. 在
Components 頁籤, 新增:
Capsule, Scene, Camera 與
SteamVRChaperone component
7. 點選
Capsule Components , 在右邊 Details 面板的 Shape 部分, 更改:
Capsule Half Height:
96 Capsule Radius:
16
8. 點選
Camera Components , 將它拖拉到
Scene Components 下
9. 點選
Scene Components , 在右邊 Details 面板的 Shape 部分, 更改:
Transform >
Location: 將
Z 值設為:
-110 , 然後編譯並儲存.
10. 回到關卡, 點選
floor (Static Mesh), 將其
X, Y, Z 位置皆設為:
0,0,0
11. 備註: 在 VR Preview 時, 如果覺得太接近或太遠離地板, 開啟 VR_Pawn Blueprint,
點選 Scene Component, 調整 Z 的高度值.
-----------------------------------------------------------------------------------------------
D. VR Editor: (4.12)
1.
Edit >
Editor Preferences...
2.
General > Experimental >
VR:
勾選:
Enable VR Editing
3. 結果: 多出一個啟用
VR Editor 的功能
-----------------------------------------------------------------------------------------------
E. 備註
1. 將 GameMode 套用到整個專案裡
> Level Editor > Editor > Project Settings...
> Maps & Modes
> Default Modes
> Default GameMode: VR_GameMode