ARVRAnchor¶
Inherits: Spatial < Node < Object
Un punto de anclaje en el espacio AR.
Descripción¶
The ARVRAnchor
point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them.
This node is mapped to one of the anchors through its unique ID. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized.
Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view.
Propiedades¶
|
Métodos¶
get_anchor_name ( ) const |
|
get_is_active ( ) const |
|
get_mesh ( ) const |
|
get_plane ( ) const |
|
get_size ( ) const |
Señales¶
mesh_updated ( Mesh mesh )
Emitida cuando la malla asociada al ancla cambia o cuando se dispone de ella. Esto es especialmente importante para la topología que está siendo constantemente mesh_updated
.
Descripciones de Propiedades¶
int anchor_id
Default |
|
Setter |
set_anchor_id(value) |
Getter |
get_anchor_id() |
La identificación del ancla. Puedes establecer esto antes de que el ancla misma exista. El primer ancla obtiene un ID de 1
, el segundo un ID de 2
, etc. Cuando se quitan las anclas, el motor puede asignar el ID correspondiente a las nuevas anclas. La situación más común en la que las anclas "desaparecen" es cuando el servidor AR identifica que dos anclas representan partes diferentes del mismo plano y las fusiona.
Descripciones de Métodos¶
String get_anchor_name ( ) const
Devuelve el nombre dado a este anclaje.
bool get_is_active ( ) const
Devuelve true
si el ancla está siendo rastreada y false
si no se conoce actualmente ninguna ancla con esta identificación.
Mesh get_mesh ( ) const
If provided by the ARVRInterface, this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes.
Plane get_plane ( ) const
Devuelve un avión alineado con nuestro ancla; útil para pruebas de intersección.
Vector3 get_size ( ) const
Devuelve el tamaño estimado del avión que fue detectado. Digamos que cuando el ancla se relaciona con una mesa en el mundo real, este es el tamaño estimado de la superficie de esa mesa.