本文へスキップ

カメラ

説明

このコンポーネントにより、ユーザーはエンティティを通して世界を見ることができる。

プロパティ

ワールド・エフェクト

プロパティタイプデフォルト説明
スケールストリングレスポンシブレスポンシブ」か「アブソリュート」のどちらかだ。 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)