This commit is contained in:
ousttrue
2021-09-09 12:23:20 +00:00
parent 6b41086ca1
commit cdef8be014
7 changed files with 169 additions and 15 deletions

View File

@@ -404,6 +404,38 @@ ex. Material, Texture, AnimationClip, Mesh.</p>
</table>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vrm-c/UniVRM/new/master/apiSpec/new?filename=UniGLTF_RuntimeGltfInstance_AddRenderers_System_Collections_Generic_IEnumerable_Renderer__.md&amp;value=---%0Auid%3A%20UniGLTF.RuntimeGltfInstance.AddRenderers(System.Collections.Generic.IEnumerable%7BRenderer%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L129">View Source</a>
</span>
<a id="UniGLTF_RuntimeGltfInstance_AddRenderers_" data-uid="UniGLTF.RuntimeGltfInstance.AddRenderers*"></a>
<h4 id="UniGLTF_RuntimeGltfInstance_AddRenderers_System_Collections_Generic_IEnumerable_Renderer__" data-uid="UniGLTF.RuntimeGltfInstance.AddRenderers(System.Collections.Generic.IEnumerable{Renderer})">AddRenderers(IEnumerable&lt;Renderer&gt;)</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AddRenderers(IEnumerable&lt;Renderer&gt; renderers)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;<span class="xref">Renderer</span>&gt;</td>
<td><span class="parametername">renderers</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vrm-c/UniVRM/new/master/apiSpec/new?filename=UniGLTF_RuntimeGltfInstance_AttachTo_GameObject_UniGLTF_ImporterContext_.md&amp;value=---%0Auid%3A%20UniGLTF.RuntimeGltfInstance.AttachTo(GameObject%2CUniGLTF.ImporterContext)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
@@ -461,7 +493,7 @@ ex. Material, Texture, AnimationClip, Mesh.</p>
<a href="https://github.com/vrm-c/UniVRM/new/master/apiSpec/new?filename=UniGLTF_RuntimeGltfInstance_Dispose.md&amp;value=---%0Auid%3A%20UniGLTF.RuntimeGltfInstance.Dispose%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L163">View Source</a>
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L168">View Source</a>
</span>
<a id="UniGLTF_RuntimeGltfInstance_Dispose_" data-uid="UniGLTF.RuntimeGltfInstance.Dispose*"></a>
<h4 id="UniGLTF_RuntimeGltfInstance_Dispose" data-uid="UniGLTF.RuntimeGltfInstance.Dispose">Dispose()</h4>
@@ -476,7 +508,7 @@ ex. Material, Texture, AnimationClip, Mesh.</p>
<a href="https://github.com/vrm-c/UniVRM/new/master/apiSpec/new?filename=UniGLTF_RuntimeGltfInstance_EnableUpdateWhenOffscreen.md&amp;value=---%0Auid%3A%20UniGLTF.RuntimeGltfInstance.EnableUpdateWhenOffscreen%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L137">View Source</a>
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L142">View Source</a>
</span>
<a id="UniGLTF_RuntimeGltfInstance_EnableUpdateWhenOffscreen_" data-uid="UniGLTF.RuntimeGltfInstance.EnableUpdateWhenOffscreen*"></a>
<h4 id="UniGLTF_RuntimeGltfInstance_EnableUpdateWhenOffscreen" data-uid="UniGLTF.RuntimeGltfInstance.EnableUpdateWhenOffscreen">EnableUpdateWhenOffscreen()</h4>
@@ -491,7 +523,7 @@ ex. Material, Texture, AnimationClip, Mesh.</p>
<a href="https://github.com/vrm-c/UniVRM/new/master/apiSpec/new?filename=UniGLTF_RuntimeGltfInstance_ShowMeshes.md&amp;value=---%0Auid%3A%20UniGLTF.RuntimeGltfInstance.ShowMeshes%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L129">View Source</a>
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L134">View Source</a>
</span>
<a id="UniGLTF_RuntimeGltfInstance_ShowMeshes_" data-uid="UniGLTF.RuntimeGltfInstance.ShowMeshes*"></a>
<h4 id="UniGLTF_RuntimeGltfInstance_ShowMeshes" data-uid="UniGLTF.RuntimeGltfInstance.ShowMeshes">ShowMeshes()</h4>
@@ -506,7 +538,7 @@ ex. Material, Texture, AnimationClip, Mesh.</p>
<a href="https://github.com/vrm-c/UniVRM/new/master/apiSpec/new?filename=UniGLTF_RuntimeGltfInstance_TransferOwnership_VRMShaders_TakeResponsibilityForDestroyObjectFunc_.md&amp;value=---%0Auid%3A%20UniGLTF.RuntimeGltfInstance.TransferOwnership(VRMShaders.TakeResponsibilityForDestroyObjectFunc)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L154">View Source</a>
<a href="https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs/#L159">View Source</a>
</span>
<a id="UniGLTF_RuntimeGltfInstance_TransferOwnership_" data-uid="UniGLTF.RuntimeGltfInstance.TransferOwnership*"></a>
<h4 id="UniGLTF_RuntimeGltfInstance_TransferOwnership_VRMShaders_TakeResponsibilityForDestroyObjectFunc_" data-uid="UniGLTF.RuntimeGltfInstance.TransferOwnership(VRMShaders.TakeResponsibilityForDestroyObjectFunc)">TransferOwnership(TakeResponsibilityForDestroyObjectFunc)</h4>

View File

@@ -102,7 +102,7 @@
<a href="vrm1/vrm1_lookat.html" name="" title="&#128679;LookAt">&#128679;LookAt</a>
</li>
<li>
<a href="vrm1/vrm1_firstperson.html" name="" title="&#128679;FirstPerson">&#128679;FirstPerson</a>
<a href="vrm1/vrm1_firstperson.html" name="" title="FirstPerson">FirstPerson</a>
</li>
</ul>
</li>

View File

@@ -5,9 +5,9 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>&#128679;FirstPerson </title>
<title>Recommended camera layer settings </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="&#128679;FirstPerson ">
<meta name="title" content="Recommended camera layer settings ">
<meta name="generator" content="docfx 2.58.2.0">
<link rel="shortcut icon" href="../../../favicon.ico">
@@ -68,6 +68,57 @@
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="">
<p>The VR First Person settings.</p>
<ol>
<li>Load</li>
<li>Get VRM10Controller</li>
<li>Call <code>controller.Vrm.FirstPerson.SetupAsync</code></li>
<li>Add the result of <code>controller.Vrm.FirstPerson.SetupAsync</code> to <code>RuntimeGltfInstance</code></li>
<li>ShowMeshes</li>
</ol>
<pre><code class="lang-cs">async Task&lt;RuntimeGltfInstance&gt; LoadAsync(string path)
{
var data = new GlbFileParser(path).Parse();
if (!Vrm10Data.TryParseOrMigrate(data, true, out Vrm10Data vrm))
{
throw new System.Exception(&quot;vrm parse error !&quot;);
}
using (var loader = new Vrm10Importer(vrm))
{
// 1.
var instance = await loader.LoadAsync();
// 2.
var controller = instance.GetComponent&lt;VRM10Controller&gt;();
// 3.
var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject);
// 4.
instance.AddRenderers(created);
// 5.
instance.ShowMeshes();
return instance;
}
}
</code></pre>
<h1 id="recommended-camera-layer-settings">Recommended camera layer settings</h1>
<p>Suppose your scene has a camera that represents a head-mounted display and other cameras.</p>
<ul>
<li>FIRSTPERSON_ONLY_LAYER(The gameObject that specifies this layer disappears from other cameras)</li>
<li>THIRDPERSON_ONLY_LAYER(The gameObject that specifies this layer disappears from the head-mounted display)</li>
</ul>
<p>Stops drawing the avatar from the head-mounted display perspective and makes it visible to other cameras.</p>
<p>Example: Stop drawing the avatar's head so you can see the front</p>
<p>VRM reserves layers named <code>VRMFirstPersonOnly</code> and<code> VRMThirdPersonOnly</code>.</p>
<p>Please set <code>VRMFirstPersonOnly</code> and<code> VRMThirdPersonOnly</code> to <code>Project Settings</code>-<code>Tags and Layers</code>.</p>
<p>In the sample, we assign <code>9</code> and<code> 10</code> to each.</p>
<h1 id="specify-layer-at-initialization">Specify layer at initialization</h1>
<p>It can be specified with an additional argument.</p>
<pre><code class="lang-cs">var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject, firstPersonOnlyLayer: 9, thirdPersonOnlyLayer: 10);
</code></pre>
</article>
</div>

View File

@@ -102,7 +102,7 @@
<a href="vrm1/vrm1_lookat.html" name="" title="&#128679;LookAt">&#128679;LookAt</a>
</li>
<li>
<a href="vrm1/vrm1_firstperson.html" name="" title="&#128679;FirstPerson">&#128679;FirstPerson</a>
<a href="vrm1/vrm1_firstperson.html" name="" title="FirstPerson">FirstPerson</a>
</li>
</ul>
</li>

View File

@@ -5,9 +5,9 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>&#128679;FirstPerson </title>
<title>Runtime &#12395; FirstPerson &#27231;&#33021;&#12434;&#26377;&#21177;&#12395;&#12377;&#12427; </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="&#128679;FirstPerson ">
<meta name="title" content="Runtime &#12395; FirstPerson &#27231;&#33021;&#12434;&#26377;&#21177;&#12395;&#12377;&#12427; ">
<meta name="generator" content="docfx 2.58.2.0">
<link rel="shortcut icon" href="../../../favicon.ico">
@@ -67,7 +67,62 @@
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="">
<h1 id="runtime-に-firstperson-機能を有効にする">Runtime に FirstPerson 機能を有効にする</h1>
<p>VR向け FirstPerson 設定の初期化手順です。</p>
<ol>
<li>Load する</li>
<li>VRM10Controller を取得する</li>
<li><code>controller.Vrm.FirstPerson.SetupAsync</code> を呼び出す</li>
<li><code>controller.Vrm.FirstPerson.SetupAsync</code> した結果新規に作成されたモデルを <code>RuntimeGltfInstance</code> に渡す</li>
<li>ShowMeshes</li>
</ol>
<pre><code class="lang-cs">async Task&lt;RuntimeGltfInstance&gt; LoadAsync(string path)
{
var data = new GlbFileParser(path).Parse();
if (!Vrm10Data.TryParseOrMigrate(data, true, out Vrm10Data vrm))
{
throw new System.Exception(&quot;vrm parse error !&quot;);
}
using (var loader = new Vrm10Importer(vrm))
{
// 1.
var instance = await loader.LoadAsync();
// 2.
var controller = instance.GetComponent&lt;VRM10Controller&gt;();
// 3.
var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject);
// 4.
instance.AddRenderers(created);
// 5.
instance.ShowMeshes();
return instance;
}
}
</code></pre>
<h1 id="vrmの推奨する-vr-向けのカメラ構成">VRMの推奨する VR 向けのカメラ構成</h1>
<p>ヘッドマウントディスプレイを表すカメラ と その他のカメラという2種類のカメラを想定ます。
それぞれに対して、</p>
<ul>
<li>FIRSTPERSON_ONLY_LAYER(このレイヤーを指定した gameObject はその他のカメラから消えます)</li>
<li>THIRDPERSON_ONLY_LAYER(このレイヤーを指定した gameObject はヘッドマウントディスプレイから消えます)</li>
</ul>
<p>を定義します。
これにより、ヘッドマウント視点のアバターの描画を抑止しつつ、他者からは見えるようにします。</p>
<p>例: アバターの頭の描画を抑止して前が見えるようにする</p>
<p>VRMは、<code>VRMFirstPersonOnly</code><code>VRMThirdPersonOnly</code> という名前のレイヤーを予約しています。</p>
<p><code>Project Settings</code> - <code>Tags and Layers</code><code>VRMFirstPersonOnly</code><code>VRMThirdPersonOnly</code>
設定してください。
サンプルでは、それぞれに <code>9</code><code>10</code> を割り当ています。</p>
<h1 id="初期化時に-layer-を明示する">初期化時に layer を明示する</h1>
<p>追加の引数で指定できます。</p>
<pre><code class="lang-cs">var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject, firstPersonOnlyLayer: 9, thirdPersonOnlyLayer: 10);
</code></pre>
</article>
</div>

View File

@@ -1704,7 +1704,7 @@
"output": {
".html": {
"relative_path": "api/UniGLTF.RuntimeGltfInstance.html",
"hash": "eHkbZD5qmhSKC6q0kZPr8QVmRWj8uA+a5P7cfiiphog="
"hash": "gWyc7mMox2UaSNxFo/HEu/XqOB9fwW1rtxOwKdE8U9A="
}
},
"is_incremental": false,
@@ -4536,7 +4536,7 @@
"output": {
".html": {
"relative_path": "articles/en/toc.html",
"hash": "0xAo3eJaAstFH1Iz+d8jAM0gyJczjnYoEjCtsT7Q4Os="
"hash": "5SFySDDewMpsCJjylz+AKeVrnC9aGai+Y1uGm6jexBE="
}
},
"is_incremental": false,
@@ -4644,7 +4644,7 @@
"output": {
".html": {
"relative_path": "articles/en/vrm1/vrm1_firstperson.html",
"hash": "4NfjpLOrTfDhpNmmSkSO/omiBDMQWeqXpUTD729ViOY="
"hash": "cOtWAwizRgVjhSi6kHzQGtB8IUFw8JRkuYc1C5pfLHU="
}
},
"is_incremental": false,
@@ -4779,7 +4779,7 @@
"output": {
".html": {
"relative_path": "articles/ja/toc.html",
"hash": "lpMPaG+LLg4loS9KCp9yllBcKY/sM/ySq4Iq4Z9VNRw="
"hash": "YdQkjc9A5Mqz1tzE8e15klA5+qQQIV/VLtdZ0fOO9TQ="
}
},
"is_incremental": false,
@@ -4887,7 +4887,7 @@
"output": {
".html": {
"relative_path": "articles/ja/vrm1/vrm1_firstperson.html",
"hash": "BKH5xsdfhWLdmzBCikXDa2v3+hQhYuv91dUNCWHxEh0="
"hash": "nYQW8tRWciP5m+I5CS8ZpOjikypFjHDSwwjsCqFG1Wk="
}
},
"is_incremental": false,

View File

@@ -11619,6 +11619,22 @@ references:
commentId: T:UniGLTF.RuntimeGltfInstance
fullName: UniGLTF.RuntimeGltfInstance
nameWithType: RuntimeGltfInstance
- uid: UniGLTF.RuntimeGltfInstance.AddRenderers(System.Collections.Generic.IEnumerable{Renderer})
name: AddRenderers(IEnumerable<Renderer>)
href: api/UniGLTF.RuntimeGltfInstance.html#UniGLTF_RuntimeGltfInstance_AddRenderers_System_Collections_Generic_IEnumerable_Renderer__
commentId: M:UniGLTF.RuntimeGltfInstance.AddRenderers(System.Collections.Generic.IEnumerable{Renderer})
name.vb: AddRenderers(IEnumerable(Of Renderer))
fullName: UniGLTF.RuntimeGltfInstance.AddRenderers(System.Collections.Generic.IEnumerable<Renderer>)
fullName.vb: UniGLTF.RuntimeGltfInstance.AddRenderers(System.Collections.Generic.IEnumerable(Of Renderer))
nameWithType: RuntimeGltfInstance.AddRenderers(IEnumerable<Renderer>)
nameWithType.vb: RuntimeGltfInstance.AddRenderers(IEnumerable(Of Renderer))
- uid: UniGLTF.RuntimeGltfInstance.AddRenderers*
name: AddRenderers
href: api/UniGLTF.RuntimeGltfInstance.html#UniGLTF_RuntimeGltfInstance_AddRenderers_
commentId: Overload:UniGLTF.RuntimeGltfInstance.AddRenderers
isSpec: "True"
fullName: UniGLTF.RuntimeGltfInstance.AddRenderers
nameWithType: RuntimeGltfInstance.AddRenderers
- uid: UniGLTF.RuntimeGltfInstance.AnimationClips
name: AnimationClips
href: api/UniGLTF.RuntimeGltfInstance.html#UniGLTF_RuntimeGltfInstance_AnimationClips