本文へスキップ

カメラ

説明

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

プロパティ

プロパティタイプデフォルト説明
typestring'perspective'Type of projection used for rendering. Allowed values: 'perspective', 'orthogonal'. Only relevant when xrCameraType is set to '3dOnly'.
nearClipnumber0.1The distance from the camera of the near clip plane, i.e. the closest distance to the camera at which scene objects are visible.
farClipnumber2000The distance from the camera of the far clip plane, i.e. the farthest distance to the camera at which scene objects are visible.
zoomnumber1Zoom factor of the camera. Only relevant when xrCameraType is set to '3dOnly'.
fovnumber80Field of view, in degrees. Only relevant when xrCameraType is set to '3dOnly' and type is set to 'perspective'.
leftnumber-1Camera frustum left plane. Only relevant when xrCameraType is set to '3dOnly' and type is set to 'orthogonal'.
rightnumber1Camera frustum right plane. Only relevant when xrCameraType is set to '3dOnly' and type is set to 'orthogonal'.
topnumber1Camera frustum top plane. Only relevant when xrCameraType is set to '3dOnly' and type is set to 'orthogonal'.
bottomnumber-1Camera frustum bottom plane. Only relevant when xrCameraType is set to '3dOnly' and type is set to 'orthogonal'.
directionstring'front'Whether to use either 'front' or 'back' camera for AR. Only relevant for 'world' or 'face' camera. Must set to 'back' to enable SLAM tracking.
xrCameraTypestring'3dOnly'Type of camera to use. Allowed values: 'world', 'face', '3dOnly'.
uvTypestring'standard'Specifies which uvs are returned in the facescanning and faceloading events. Allowed values: 'standard', 'projected'. Only relevant when xrCameraType is set to 'face'.
leftHandedAxesbooleanfalseIf true, use left-handed coordinates: X-right, Y-up, and Z-forward. Otherwise, X-left, Y-up, and Z-forward.
disableWorldTrackingbooleanfalseIf true, turn off SLAM tracking for efficiency. Must be set to false to enable VPS.
enableLightingbooleanfalseIf true, return an estimate of lighting information
scalestring'responsive'Allowed values: 'responsive', 'absolute'. 'responsive' will return values so that the camera on frame 1 is at the origin defined via XR8.XrController.updateCameraProjectionMatrix(). 'absolute' will return the camera, image targets, etc in meters. When using 'absolute', the x-position, z-position, and rotation of the starting pose will respect the parameters set in XR8.XrController.updateCameraProjectionMatrix() once scale has been estimated. The y-position will depend on the camera's physical height from the ground plane. Must be set to 'responsive' to enable VPS.
enableWorldPointsbooleanfalseIf true, return the map points used for tracking
enableVpsbooleanfalseIf true, look for Project Locations and a mesh. The mesh that is returned has no relation to Project Locations and will be returned even if no Project Locations are configured. Must enable responsive scale and world tracking to enabled VPS. Only relevant when xrCameraType is set to 'world'
mirroredDisplaybooleanfalseIf true, flip the rendering left-right
meshGeometryFacebooleanfalseWhether to show face mesh geometry. Only relevant when xrCameraType is set to 'face'.
meshGeometryEyesbooleanfalseWhether to show eye mesh geometry. Only relevant when xrCameraType is set to 'face'.
meshGeometryIrisbooleanfalseWhether to show iris mesh geometry. Only relevant when xrCameraType is set to 'face'.
meshGeometryMouthbooleanfalseWhether to show mouth mesh geometry. Only relevant when xrCameraType is set to 'face'.
enableEarsbooleanfalseIf true, runs ear detection simultaneously with Face Effects and returns ear attachment points. Only relevant when xrCameraType is set to 'face'.
maxDetectionsnumber1The maximum number of faces to detect. Allowed values: 1, 2, or 3. Only relevant when xrCameraType is set to 'face'.

機能

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,
meshGeometryFace: true,
meshGeometryEyes: false,
meshGeometryIris: false,
meshGeometryMouth: 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)