カメラ
説明
このコンポーネントにより、ユーザーはエンティティを通し て世界を見ることができる。
プロパティ
ワールド・エフェクト
プロパティ | タイプ | デフォルト | 説明 |
---|---|---|---|
スケール | ストリング | レスポンシブ | レスポンシブ」か「アブソリュート」のどちらかだ。 responsiveは、フレーム1のカメラがXR8.XrController.updateCameraProjectionMatrix()で定義した原点になるように値を返します。 absoluteはカメラ、イメージターゲットなどをメートル単位で返す。 absoluteを使用する場合、スケールが推定されると、開始ポーズのx-position、z-position、rotationは、XR8.XrController.updateCameraProjectionMatrix()で設定されたパラメータに従います。 y-positionは接地面からのカメラの物理的な高さに依存する。 |
フェイス・エフェクト
プロパティ | タイプ | デフォルト | 説明 |
---|---|---|---|
ニアクリップ | 番号 | 0.1 | ニアクリッププレーンのカメラからの距離、つまりシーンオブジェクトが見えるカメラからの最も近い距離。 |
ファークリップ | 番号 | 1000 | 遠いクリップ面のカメラからの距離、つまりシーンオブジェクトが見えるカメラからの最も遠い距離。 |
顔 | ブーリアン | 真の | 顔メッシュのジオメトリを表示するかどうか。 |
アイズ | ブーリアン | 擬似 | アイメッシュのジオメトリを表示するかどうか。 |
アイリス | ブーリアン | 擬似 | アイリスメッシュのジオメトリを表示するかどうか。 |
口 | ブーリアン | 擬似 | 口のメッシュ形状を表示するかどうか。 |
最大検出数 | 番号 | 1 | 検出する顔の最大数。 選択肢は1、2、3のいずれか。 |
イネーブル・イヤーズ | ブーリアン | 擬似 | trueの場合、Face Effectsと同時に耳検出を実行し、耳の取り付けポイントを返します。 |
機能
Get
Returns a read-only reference.
Example
ecs.Camera.get(world, component.eid)
Set
Ensures the component exists on the entity, then assigns the (optional) data to the component.
Example
ecs.Camera.set(world, component.eid, {
scale: 'responsive',
nearClip: 0.1,
farClip: 1000,
Face: true,
Eyes: false,
Iris: false,
Mouth: false,
maxDetections: 1,
enableEars: false
})
Mutate
Perform an update to the component within a callback function. Return true
to indicate no changes made.
Example
ecs.Camera.mutate(world, component.eid, (cursor) => {
cursor.scale = 'absolute';
cursor.nearClip = 0.5;
return false;
})
Remove
Removes the component from the entity.
Example
ecs.Camera.remove(world, component.eid)
Has
Returns true
if the component is present on the entity.
Example
ecs.Camera.has(world, component.eid)
Reset
Adds, or resets the component to its default state.
Example
ecs.Camera.reset(world, component.eid)
Advanced Functions
Cursor
Returns a mutable reference. Cursors are reused so only one cursor for each component can exist at a time.
Example
ecs.Camera.cursor(world, component.eid)
Acquire
Same behavior as cursor, but commit must be called after the cursor is done being used.
Example
ecs.Camera.acquire(world, component.eid)
Commit
Called after acquire. An optional third argument determines whether the cursor was mutated or not.
Example
ecs.Camera.commit(world, component.eid)
ecs.Camera.commit(world, component.eid, false)
Dirty
Mark the entity as having been mutated. Only needed in a specific case where systems are mutating data.
Example
ecs.Camera.dirty(world, component.eid)