diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/xrinputsource | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/api/xrinputsource')
-rw-r--r-- | files/ja/web/api/xrinputsource/gripspace/index.html | 97 | ||||
-rw-r--r-- | files/ja/web/api/xrinputsource/handedness/index.html | 77 | ||||
-rw-r--r-- | files/ja/web/api/xrinputsource/index.html | 109 | ||||
-rw-r--r-- | files/ja/web/api/xrinputsource/profiles/index.html | 85 |
4 files changed, 368 insertions, 0 deletions
diff --git a/files/ja/web/api/xrinputsource/gripspace/index.html b/files/ja/web/api/xrinputsource/gripspace/index.html new file mode 100644 index 0000000000..45e0b9a0c9 --- /dev/null +++ b/files/ja/web/api/xrinputsource/gripspace/index.html @@ -0,0 +1,97 @@ +--- +title: XRInputSource.gripSpace +slug: Web/API/XRInputSource/gripSpace +tags: + - API + - AR + - Augmented Reality + - Experimental + - Property + - Reference + - VR + - Virtual Reality + - WebXR + - WebXR Device API + - XRInputSession + - gripSpace +translation_of: Web/API/XRInputSource/gripSpace +--- +<div>{{securecontext_header}}{{APIRef("WebXR")}}</div> + +<p class="summary"><span class="seoSummary">{{domxref("XRInputSource")}} の <strong><code>gripSpace</code></strong> 読み取り専用プロパティは、ネイティブの原点がユーザーの手(またはその一部)に保持しているように見える仮想オブジェクトのレンダリングに使用するポーズを追跡する {{domxref("XRSpace")}} を返します。</span> 例えば、ユーザーが仮想の真っ直ぐな棒を持っている場合、この <code>XRSpace</code> のネイティブの原点は、ユーザーの拳のおおよその重心にあります。</p> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="syntaxbox notranslate">var <var>xrSpace</var> = <em>xrInputSource</em>.gripSpace;</pre> + +<h3 id="Value" name="Value">値</h3> + +<p>仮想空間での入力デバイスの位置と向きを表す {{domxref("XRSpace")}} オブジェクト。 デバイスの画像をシーンにレンダリングするのに適しています。 入力ソースが本質的に追跡できない場合、<code>gripSpace</code> は <code>null</code> です。 例えば、{{domxref("XRInputSource.targetRayMode", "targetRayMode")}} が <code>tracked-pointer</code> である入力のみが <code>gripSpace</code> を提供します。</p> + +<p>コントローラーがまっすぐな棒のような形をしていて、ユーザーの拳で握られていると想像してみてください。 グリップ空間の本来の原点は、ユーザーの拳の重心にあり、ユーザーの手の位置を追跡します。</p> + +<div style="width: 42em;"> +<div style="width: 20em; float: left;"> +<figure style="background: #eee; padding: 0.5em; border: 1px solid #aaa; border-radius: 1em; max-width: 504px; padding: 1em; margin: 1em auto;"> +<figcaption><strong>左手のグリップ空間の座標系。</strong></figcaption> + +<div style="background-color: #FFF;"><img alt="グリップ空間が、世界に対するプレーヤーの手のローカル座標系をどのように示しているかを示す図。" src="https://mdn.mozillademos.org/files/17260/GripSpace-LeftHand-Light.svg" style="width: 100%;"></div> +</figure> +</div> + +<div style="width: 20em; float: right;"> +<figure style="background: #eee; padding: 0.5em; border: 1px solid #aaa; border-radius: 1em; max-width: 504px; padding: 1em; margin: 1em auto;"> +<figcaption><strong>右手のグリップ空間の座標系。</strong></figcaption> + +<div style="background-color: #FFF;"><img alt="グリップ空間が、世界に対するプレーヤーの手のローカル座標系をどのように示しているかを示す図。" src="https://mdn.mozillademos.org/files/17261/GripSpace-RightHand-Light.svg" style="width: 100%;"></div> +</figure> +</div> +</div> + +<p class="cleared">上の図に示すように、座標系は次のように方向付けられています。</p> + +<ul> + <li>x 軸は、ユーザーの手のひらに垂直であり、手の甲から外側に伸びる方向は、コントローラーがユーザーの右手にある場合は +X 、コントローラーが左手にある場合は -X です。</li> + <li>z 軸は、棒の長さに沿い、ユーザーの手のひらに平行で、グリップの長さに沿います。 -Z はユーザーの親指の方向であり、+Z は反対方向です。</li> + <li>y 軸は、他の2つの軸間の関係によって示されます。 いつものように、それは他の2つの軸の外積です(X 軸と Z 軸の両方から90°離れています)。</li> +</ul> + +<h2 id="Examples" name="Examples">例</h2> + +<p>この例では、フレームレンダリングコールバックから取得した <code>gripSpace</code> を使用して、仮想環境でのコントローラーの位置と向きを表すメッシュをレンダリングします。</p> + +<pre class="brush: js notranslate">for (let source in xrSession.inputSources) { + if (source.gripSpace) { + let gripPose = frame.getPose(source.gripSpace, xrRefSpace); + + if (gripPose) { + myDrawMeshUsingTransform(controllerMesh, gripPose.transform.matrix); + } + } +} +</pre> + +<p>このループは、<code>gripSpace</code> の値を持つ各入力ソースについて、<code>gripSpace</code> によって記述される位置と向きを表す {{domxref("XRPose")}} を取得します。 有効なポーズが返された場合、メソッド <code>myDrawMeshUsingTransform()</code> を呼び出して、グリップポーズの変換行列を使用して変換されたコントローラーのメッシュを描画します。</p> + +<h2 id="Specifications" name="Specifications">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">状態</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('WebXR','#dom-xrinputsource-gripspace','XRInputSource.gripSpace')}}</td> + <td>{{Spec2('WebXR')}}</td> + <td>初期定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + + + +<p>{{Compat("api.XRInputSource.gripSpace")}}</p> diff --git a/files/ja/web/api/xrinputsource/handedness/index.html b/files/ja/web/api/xrinputsource/handedness/index.html new file mode 100644 index 0000000000..1095db5452 --- /dev/null +++ b/files/ja/web/api/xrinputsource/handedness/index.html @@ -0,0 +1,77 @@ +--- +title: XRInputSource.handedness +slug: Web/API/XRInputSource/handedness +tags: + - API + - AR + - Controller + - Handedness + - Input + - Property + - Read-only + - Reference + - VR + - WebXR + - WebXR API + - WebXR Device API + - XR + - XRInputSource + - hand + - left + - right +translation_of: Web/API/XRInputSource/handedness +--- +<p>{{APIRef("WebXR")}}{{securecontext_header}}</p> + +<p>{{domxref("XRInputSource")}} の <strong><code>handedness</code></strong> 読み取り専用プロパティは、WebXR 入力ソースがユーザーのどの手に関連付けられているか、またはまったく関連付けられていないかを示します。</p> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="syntaxbox notranslate">let <em>hand</em> = <em>xrInputSource</em>.handedness;</pre> + +<h3 id="Value" name="Value">値</h3> + +<p>入力コントローラーがユーザーの片方の手にあるかどうか、もしそうならどちらの手にあるかを示す {{domxref("DOMString")}}。 {{domxref("XRHandedness")}} 列挙型に由来する値は、次のいずれかです。</p> + +<p>{{page("/ja/docs/Web/API/XRHandedness", "Values")}}</p> + +<h2 id="Usage_notes" name="Usage_notes">使用上の注意</h2> + +<p>入力ソースがユーザーの手に関連付けられたデバイスでない場合(握られているか、取り付けられているか、着用されているかに関係なく)、<code>handedness</code> の値は <code>none</code> です。 これは、例えば、ヘッドセットに組み込まれたコントロールや、頭や体に取り付けられた入力デバイスなど、ハンドヘルドではない入力ソースを示している場合があります。</p> + +<h2 id="Examples" name="Examples">例</h2> + +<p>{{page("/ja/docs/Web/API/XRHandedness", "Examples")}}</p> + +<h2 id="Specifications" name="Specifications">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">状態</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('WebXR','#dom-xrinputsource-handedness','XRInputSource.handedness')}}</td> + <td>{{Spec2('WebXR')}}</td> + <td>初期定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + +<div class="hidden"> +<p>The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> +</div> + +<p>{{Compat("api.XRInputSource.handedness")}}</p> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li><a href="/ja/docs/Web/API/WebXR_Device_API">WebXR Device API</a></li> + <li><a href="/ja/docs/Web/API/WebXR_Device_API/Inputs">入力と入力ソース</a></li> + <li><a href="/ja/docs/Web/WebXR%20Device%20API/Gamepads">WebXR アプリケーションでのゲームパッドの使用</a></li> +</ul> diff --git a/files/ja/web/api/xrinputsource/index.html b/files/ja/web/api/xrinputsource/index.html new file mode 100644 index 0000000000..3e963169d6 --- /dev/null +++ b/files/ja/web/api/xrinputsource/index.html @@ -0,0 +1,109 @@ +--- +title: XRInputSource +slug: Web/API/XRInputSource +tags: + - API + - AR + - Augmented Reality + - Experimental + - Input + - Interface + - Reference + - VR + - Virtual Reality + - WebXR + - WebXR Device API + - XRInputSource + - control +translation_of: Web/API/XRInputSource +--- +<div>{{securecontext_header}}{{APIRef("WebXR Device API")}}</div> + +<p><span class="seoSummary"><a href="/ja/docs/Web/API/WebXR_Device_API">WebXR Device API</a> の <strong><code>XRInputSource</code></strong> インターフェースは、ユーザーの WebXR 互換の仮想現実または拡張現実のシステムの一部であるコントロール入力の単一ソースを記述します。</span> デバイスは使用されているプラットフォームに固有ですが、それが向けられている方向を提供し、ユーザーがデバイスを使用してアクションを実行することをトリガーにした場合、オプションでイベントを生成することができます。</p> + +<h2 id="Properties" name="Properties">プロパティ</h2> + +<dl> + <dt>{{domxref("XRInputSource.gamepad", "gamepad")}} {{ReadOnlyInline}}{{experimental_inline}}</dt> + <dd> + <p>XR 入力ソースのボタンと軸の状態を説明する {{domxref("Gamepad")}} オブジェクト(ゲームパッドまたは同等のデバイスの場合)。 デバイスがゲームパッドのようなデバイスでない場合、このプロパティの値は <code>NULL</code> です。</p> + + <div class="note"><strong>注</strong>: <code>XRInputSource</code> は <a href="/ja/docs/Web/API/Gamepad_API">Gamepad API</a> の {{domxref("Gamepad")}} インターフェイスを使用しますが、この入力デバイスは WebXR ハードウェアに厳密に関連付けられており、汎用のゲームデバイスではありません。</div> + </dd> + <dt>{{domxref('XRInputSource.gripSpace', 'gripSpace')}}{{readonlyInline}}</dt> + <dd><code>handedness</code> で示された手に持っているように見えるオブジェクトをレンダリングするために使用するポーズを原点が追跡する {{domxref("XRSpace")}}。この空間の向きは、手がオブジェクトをつかんでいる角度を示します。 この空間の使用方法の詳細については、{{domxref("XRInputSource.gripSpace", "gripSpace")}} のメイン記事をお読みください。</dd> + <dt>{{domxref('XRInputSource.handedness', 'handedness')}}{{readonlyInline}}</dt> + <dd>この <code>XRInputSource</code> によって表されるデバイスを使用している手がある場合はそれを示す {{domxref("DOMString")}}。 値は、<code>left</code>、<code>right</code>、または <code>none</code> になります。</dd> + <dt>{{domxref('XRInputSource.profiles', 'profiles')}}{{readonlyInline}}</dt> + <dd>DOMString オブジェクトの配列。 それぞれが、この入力ソースの望ましい視覚的表現と振る舞いを説明する入力プロファイルの名前を指定します。</dd> + <dt>{{domxref('XRInputSource.targetRayMode', 'targetRayMode')}}{{readonlyInline}}</dt> + <dd> + <p>ターゲット光線を生成するために使用する方法を <code>gaze</code>、<code>tracked-pointer</code>、または <code>screen</code> で示す <code>DOMString</code>。</p> + </dd> + <dt>{{domxref('XRInputSource.targetRaySpace', 'targetRaySpace')}}{{readonlyInline}}</dt> + <dd>ターゲット光線の原点とそれが伸びる方向を定義する {{domxref("XRSpace")}} オブジェクト。 この空間は、<code>targetRayMode</code> で定義された方法を使用して確立されます。</dd> +</dl> + +<h2 id="Methods" name="Methods"><br> + メソッド</h2> + +<p><em><code>XRInputSource</code> インターフェイスはメソッドを定義しません。</em></p> + +<h2 id="Usage_notes" name="Usage_notes">使用上の注意</h2> + +<h3 id="Actions_and_the_target_ray" name="Actions_and_the_target_ray">アクションとターゲット光線</h3> + +<p>デバイスがそれが向けられている方向を示す場合、これは<strong>ターゲット光線</strong>(target ray)を使用して行われます。 これは、デバイスの位置から、デバイスが向けられている方向に外側に伸びる光線です。</p> + +<div style="width: 42em;"> +<figure style="background: #eee; padding: 0.5em; border: 1px solid #aaa; border-radius: 1em; max-width: 504px; padding: 1em; margin: 1em auto;"> +<figcaption><strong>ハンドコントローラから放出されるターゲット光線。</strong></figcaption> +<img alt="ハンドコントローラーから放出されるターゲット光線を示すスクリーンショット" src="https://mdn.mozillademos.org/files/17089/example-target-ray.gif" style="width: 100%;"></figure> +</div> + +<p class="cleared">デバイスにトリガーまたは他のスクイーズ可能な入力(ユーザーが拳を握ったことを認識するハンドジェスチャーデバイスなど)が含まれている場合、そのアクションは<strong>プライマリースクイーズアクション</strong>(primary squeeze action)と呼ばれます。 プライマリースクイーズアクションは、オブジェクトをつかんだり、ツールや武器のトリガーを押したりするなど、実際のグリップアクションに対応している必要があります。 ユーザーがトリガーを押したりグリップを締め付けたりするなどしてスクイーズアクションが開始されると、{{domxref("XRSession.squeezestart_event", "squeezestart")}} イベントが <code>XRSession</code> に送信されます。 アクションが完了し、ユーザーがトリガーまたはグリップを放すと、{{domxref("XRSession.squeeze_event", "squeeze")}} イベントが送信されます。 この後に {{domxref("XRSession.squeezeend_event", "squeezeend")}} が続き、アクションが完了ではなく中止された場合にも送信されます。</p> + +<p>デバイスにボタンまたはその他の押すことができる入力コントロールがある場合、それは<strong>プライマリ入力ソース</strong>(primary input source)であり、このボタンは<strong>プライマリーアクション</strong>(primary action)です。 プライマリーアクションは、ユーザーがボタンを押すか、タッチパッドまたはサムスティックのトップボタンをクリックするか、ボタンのようなアクションを呼び出す手のジェスチャーまたは音声コマンドを使用するときに発生する可能性があります。 プライマリーアクションが開始されると、{{domxref("XRSession.selectstart_event", "selectstart")}} イベントが {{domxref("XRSession")}} に送信されます。 アクションが完了すると(ユーザーがボタンを離したときなど)、{{domxref("XRSession.select_event", "select")}} イベントが送信されます。 最後に、それが完了すると、またはユーザーがアクションを中止すると、{{domxref("XRSession.selectend_event", "selectend")}} イベントがセッションオブジェクトに送信されます。</p> + +<p>アクションは、ユーザーがデバイス固有の方法で中止するか、アクションが完了する前に入力デバイスが切断された場合に中止される可能性があります。</p> + +<h3 id="Local_coordinate_system" name="Local_coordinate_system">ローカル座標系</h3> + +<p>各入力ソースには独自のローカル座標系があります。 これは、入力の座標系を世界座標系にマッピングするために使用する {{domxref("XRSpace")}} である {{domxref("XRInputSource.gripSpace", "gripSpace")}} プロパティによって記述されます。 次に、グリップ空間の座標系を使用してオブジェクトをレンダリングし、ユーザーの手に持っているように見せることができます。</p> + +<p><img alt="GripSpace プロパティで定義された座標系を示す図" src="https://mdn.mozillademos.org/files/17215/xr-hand-axes.svg" style="height: 472px; width: 450px;"></p> + +<p>入力ソースの座標系の詳細については、{{domxref("XRInputSource.gripSpace", "gripSpace")}} プロパティについて詳しく説明している記事を参照してください。</p> + +<h2 id="Specifications" name="Specifications">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">状態</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('WebXR','#xrinputsource-interface','XRInputSource')}}</td> + <td>{{Spec2('WebXR')}}</td> + <td>初期定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + + + +<p>{{Compat("api.XRInputSource")}}</p> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li><a href="/ja/docs/Web/API/WebXR_Device_API">WebXR Device API</a></li> + <li><a href="/ja/docs/Web/API/WebXR_Device_API/Inputs">入力と入力ソース</a></li> + <li><a href="/ja/docs/Web/WebXR%20Device%20API/Gamepads">WebXR アプリケーションでのゲームパッドの使用</a></li> + <li>{{domxref("XRInputSourceArray")}}</li> + <li>{{domxref("XRSpace")}}</li> +</ul> diff --git a/files/ja/web/api/xrinputsource/profiles/index.html b/files/ja/web/api/xrinputsource/profiles/index.html new file mode 100644 index 0000000000..4672470024 --- /dev/null +++ b/files/ja/web/api/xrinputsource/profiles/index.html @@ -0,0 +1,85 @@ +--- +title: XRInputSource.profiles +slug: Web/API/XRInputSource/profiles +tags: + - API + - AR + - Configuration + - Input + - Property + - Read-only + - Reference + - VR + - Virtual + - WebXR + - WebXR API + - WebXR Device API + - XR + - XRInputSource + - augmented + - profile +translation_of: Web/API/XRInputSource/profiles +--- +<p>{{APIRef("WebXR")}}{{securecontext_header}}</p> + +<p><span class="seoSummary">{{domxref("XRInputSource")}} の <strong><code>profiles</code></strong> 読み取り専用プロパティは、文字列の配列を返します。 各文字列は、入力ソースの構成プロファイルを記述します。</span> プロファイル文字列は、具体性の高い順にリストされ、最も具体的なプロファイルが最初にリストされます。</p> + +<div class="blockIndicator note"> +<p><strong>注</strong>: WebXR セッションがインラインモードの場合、<code>profiles</code> リストは常に空です。</p> +</div> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="syntaxbox notranslate">let <em>profileList</em> = <em>xrInputSource</em>.profiles;</pre> + +<h3 id="Value" name="Value">値</h3> + +<p><code>XRInputSource</code> オブジェクトが表す入力デバイスの構成プロファイルをそれぞれ記述した {{domxref("DOMString")}} オブジェクトの配列。 各入力プロファイルは、入力ソースの好ましい視覚的表現と振る舞いを指定します。</p> + +<h2 id="Usage_notes" name="Usage_notes">使用上の注意</h2> + +<h3 id="Input_profile_names" name="Input_profile_names">入力プロファイル名</h3> + +<p>入力プロファイル名は、入力ソースが使用するように構成できる視覚的表現と振る舞いを説明する文字列です。 各文字列は、</p> + +<ul> + <li>スペースはありません。 代わりに、単語はハイフン("-")文字で区切られます。</li> + <li>プラットフォームがそれを利用可能にする場合、USB のベンダー ID と製品 ID が提供される場合がありますが、信頼することはできません。</li> + <li>特定のデバイスを一意に識別しません。 むしろ、製品が使用できる構成を識別します。</li> + <li>該当する場合、デバイスの handedness に関する情報を提供しません。</li> +</ul> + +<p>WebXR 入力プロファイルレジストリー(<a href="https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/registry">WebXR Input Profiles Registry</a>)は、デバイス開発者とブラウザー開発者が、使用するブラウザーや他の{{Glossary("user agent","ユーザーエージェント")}}に関係なく、特定のデバイスが同じプロファイル文字列を報告するようにするために使用します。</p> + +<h2 id="Specifications" name="Specifications">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">状態</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('WebXR','#dom-xrinputsource-profiles','XRInputSource.profiles')}}</td> + <td>{{Spec2('WebXR')}}</td> + <td>初期定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + +<div class="hidden"> +<p>The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> +</div> + +<p>{{Compat("api.XRInputSource.profiles")}}</p> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li><a href="/ja/docs/Web/API/WebXR_Device_API">WebXR Device API</a></li> + <li><a href="/ja/docs/Web/API/WebXR_Device_API/Inputs">入力と入力ソース</a></li> + <li><a href="/ja/docs/Web/WebXR%20Device%20API/Gamepads">WebXR アプリケーションでのゲームパッドの使用</a></li> +</ul> |