Saltar al contenido principal

Cámara

Descripción

This component allows the user to view the world through the entity.

Propiedades

World Effects

PropiedadTipoPor defectoDescripción
escalastring'receptivo'Either 'responsive' or '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. La posición y dependerá de la altura física de la cámara desde el plano del suelo.

Face Effects

PropiedadTipoPor defectoDescripción
nearClipnumber0,1La distancia desde la cámara del plano de clip cercano, es decir, la distancia más cercana a la cámara a la que son visibles los objetos de la escena.
farClipnumber1000La distancia desde la cámara del plano del clip lejano, es decir, la distancia más lejana a la cámara a la que son visibles los objetos de la escena.
FacebooleantrueWhether to show face mesh geometry.
EyesbooleanfalseWhether to show eye mesh geometry.
IrisbooleanfalseWhether to show iris mesh geometry.
BocabooleanfalseWhether to show mouth mesh geometry.
maxDetectionsnumber1El número máximo de caras a detectar. Las opciones disponibles son 1, 2 ó 3.
enableEarsbooleanfalseIf true, runs ear detection simultaneously with Face Effects and returns ear attachment points.

Funciones

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)