diff --git a/docfx/articles/en/toc.yml b/docfx/articles/en/toc.yml index 38eadbd93..6535cf4e5 100644 --- a/docfx/articles/en/toc.yml +++ b/docfx/articles/en/toc.yml @@ -47,5 +47,5 @@ href: vrm1/vrm1_expression.md - name: 🚧LookAt href: vrm1/vrm1_lookat.md - - name: 🚧FirstPerson + - name: FirstPerson href: vrm1/vrm1_firstperson.md diff --git a/docfx/articles/en/vrm1/vrm1_firstperson.md b/docfx/articles/en/vrm1/vrm1_firstperson.md index 87914de13..19189eff5 100644 --- a/docfx/articles/en/vrm1/vrm1_firstperson.md +++ b/docfx/articles/en/vrm1/vrm1_firstperson.md @@ -1,5 +1,37 @@ ---- -title: 🚧FirstPerson -weight: 50 ---- +The VR First Person settings. +1. Load +2. Get VRM10Controller +3. Call `controller.Vrm.FirstPerson.SetupAsync` +4. Add the result of `controller.Vrm.FirstPerson.SetupAsync` to `RuntimeGltfInstance` +5. ShowMeshes + +```cs +async Task LoadAsync(string path) +{ + var data = new GlbFileParser(path).Parse(); + if (!Vrm10Data.TryParseOrMigrate(data, true, out Vrm10Data vrm)) + { + throw new System.Exception("vrm parse error !"); + } + using (var loader = new Vrm10Importer(vrm)) + { + // 1. + var instance = await loader.LoadAsync(); + + // 2. + var controller = instance.GetComponent(); + + // 3. + var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject); + + // 4. + instance.AddRenderers(created); + + // 5. + instance.ShowMeshes(); + + return instance; + } +} +``` diff --git a/docfx/articles/ja/toc.yml b/docfx/articles/ja/toc.yml index 286dbd3d0..647ca117e 100644 --- a/docfx/articles/ja/toc.yml +++ b/docfx/articles/ja/toc.yml @@ -47,5 +47,5 @@ href: vrm1/vrm1_expression.md - name: 🚧LookAt href: vrm1/vrm1_lookat.md - - name: 🚧FirstPerson + - name: FirstPerson href: vrm1/vrm1_firstperson.md diff --git a/docfx/articles/ja/vrm1/vrm1_firstperson.md b/docfx/articles/ja/vrm1/vrm1_firstperson.md index 87914de13..43f1a8be6 100644 --- a/docfx/articles/ja/vrm1/vrm1_firstperson.md +++ b/docfx/articles/ja/vrm1/vrm1_firstperson.md @@ -1,5 +1,37 @@ ---- -title: 🚧FirstPerson -weight: 50 ---- +VR向け FirstPerson 設定の初期化手順です。 +1. Load する +2. VRM10Controller を取得する +3. `controller.Vrm.FirstPerson.SetupAsync` を呼び出す +4. `controller.Vrm.FirstPerson.SetupAsync` した結果新規に作成されたモデルを `RuntimeGltfInstance` に渡す +5. ShowMeshes + +```cs +async Task LoadAsync(string path) +{ + var data = new GlbFileParser(path).Parse(); + if (!Vrm10Data.TryParseOrMigrate(data, true, out Vrm10Data vrm)) + { + throw new System.Exception("vrm parse error !"); + } + using (var loader = new Vrm10Importer(vrm)) + { + // 1. + var instance = await loader.LoadAsync(); + + // 2. + var controller = instance.GetComponent(); + + // 3. + var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject); + + // 4. + instance.AddRenderers(created); + + // 5. + instance.ShowMeshes(); + + return instance; + } +} +```