XR_ANDROID_spatial_component_subsumed_by

Name String

XR_ANDROID_spatial_component_subsumed_by

Uzantı Türü

Örnek uzantısı

Kayıtlı Uzantı Numarası

792

Düzeltme

1

Onay durumu

Onaylanmadı

Uzantı ve Sürüm Bağımlılıkları

XR_EXT_spatial_entity
ve
XR_EXT_spatial_plane_tracking

Son Değiştirilme Tarihi

2025-08-19

IP Durumu

Bilinen IP hak talebi yok.

Katkıda bulunanlar

Brian Chen, Google
Kyle Chen, Google
Levana Chen, Google
Nihav Jain, Google
Spencer Quin, Google

Genel Bakış

Bu uzantı, XR_EXT_spatial_entity üzerine kuruludur ve XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT için yeni bir bileşen sağlayarak mevcut öğeyi kapsayan XrSpatialEntityIdEXT öğesini kullanıma sunar.

Çalışma zamanı, izlenen 2 düzlemin aslında aynı olduğunu algılayacak kadar ortam bilgisi edindiğinde, düzlemlerden birinin kimliğine sahip XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID bileşeni diğerine eklenir. Bundan sonra uygulamanın yalnızca XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID bileşenine sahip olmayan öğeyi işlemesi gerekir.

Bu uzantı, uygulamanın XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID bileşenine sahip tüm öğeleri filtrelemek için XrSpatialDiscoverySnapshotCreateInfoEXT'ye zincirleyebileceği yeni bir filtre de sunar.

İzinler

Bu uzantı, ortamdaki düzlemleri takip ettiğinden Android uygulamalarının manifest dosyalarında android.permission.SCENE_UNDERSTANDING_COARSE izninin listelenmesi gerekir. android.permission.SCENE_UNDERSTANDING_COARSE izni tehlikeli bir izin olarak kabul edilir.

(koruma düzeyi: tehlikeli)

Çalışma Zamanı Desteği

Çalışma zamanı bir düzlemi diğerine dahil edebiliyorsa xrEnumerateSpatialCapabilityComponentTypesEXT içinde XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID öğesini XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT özelliği için desteklenen bir bileşen olarak numaralandırarak bunu belirtmelidir .

XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID eklenmiş öğenin tüm bileşen verileri, onu kapsayan öğeyle aynı olmalıdır.

Subsumed By Component

Bileşen verileri

XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID, verileri için XrSpatialEntityIdEXT yapısını kullanır. Bu yapı, kapsayan öğenin kimliğini temsil eder.

Verileri sorgulamak için bileşen listesi yapısı

XrSpatialComponentSubsumedByListANDROID yapısı şu şekilde tanımlanır:

typedef struct XrSpatialComponentSubsumedByListANDROID {
    XrStructureType          type;
    void*                    next;
    uint32_t                 subsumedUniqueIdCount;
    XrSpatialEntityIdEXT*    subsumedUniqueIds;
} XrSpatialComponentSubsumedByListANDROID;

Üye Açıklamaları

  • type, bu yapının XrStructureType'ıdır.
  • next, NULL veya bir yapı zincirindeki sonraki yapının işaretçisidir.
  • subsumedUniqueIdCount, subsumedUniqueIds dizisindeki öğelerin sayısını açıklayan bir uint32_t'dir.
  • subsumedUniqueIds, XrSpatialEntityIdEXT dizisidir .

Uygulama, XrSpatialComponentDataQueryResultEXT zincirinin sonrasına XR_TYPE_SPATIAL_COMPONENT_SUBSUMED_BY_LIST_ANDROID ekleyerek XrSpatialSnapshotEXT içindeki uzamsal öğelerin XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID bileşenini sorgulayabilir.

Çalışma zamanı, XR_TYPE_SPATIAL_COMPONENT_SUBSUMED_BY_LIST_ANDROID, XrSpatialComponentDataQueryResultEXT :: next öğesinin sonraki zincirindeyse ancak XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID, XrSpatialComponentDataQueryConditionEXT :: componentTypes öğesine dahil değilse xrQuerySpatialComponentDataEXT öğesinden XR_ERROR_VALIDATION_FAILURE döndürmelidir.

Çalışma zamanı, subsumedUniqueIdCount değeri XrSpatialComponentDataQueryResultEXT :: entityIdCountOutput değerinden küçükse xrQuerySpatialComponentDataEXT işlevinden XR_ERROR_SIZE_INSUFFICIENT değerini döndürmelidir.

Geçerli Kullanım (Dolaylı)

  • XR_ANDROID_spatial_component_subsumed_by uzantısı, XrSpatialComponentSubsumedByListANDROID kullanılmadan önce etkinleştirilmelidir.
  • type XR_TYPE_SPATIAL_COMPONENT_SUBSUMED_BY_LIST_ANDROID olmalıdır.
  • next zorunlu olarak NULL veya bir yapı zincirindeki sonraki yapıya yönelik geçerli bir işaretçi olmalıdır.
  • subsumedUniqueIds must be a pointer to an array of subsumedUniqueIdCount XrSpatialEntityIdEXT values
  • subsumedUniqueIdCount parametresi değerinden büyük olmalıdır.0

Yapılandırma

XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID, XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT özelliği için XrSpatialCapabilityComponentTypesEXT :: componentTypes içinde numaralandırılmışsa uygulama, numaralandırmayı bu bileşeni destekleyen özelliğin XrSpatialCapabilityConfigurationBaseHeaderEXT türetilmiş yapısının XrSpatialCapabilityConfigurationBaseHeaderEXT :: enabledComponents listesine dahil ederek özelliği etkinleştirebilir.

Kapsanan Varlıkları Filtreleme

XrSpatialDiscoveryUniqueEntitiesFilterANDROID yapısı şu şekilde tanımlanır:

typedef struct XrSpatialDiscoveryUniqueEntitiesFilterANDROID {
    XrStructureType    type;
    const void*        next;
} XrSpatialDiscoveryUniqueEntitiesFilterANDROID;

Üye Açıklamaları

  • type, bu yapının XrStructureType'ıdır.
  • next, NULL veya bir yapı zincirindeki sonraki yapının işaretçisidir.

Uygulama, başka bir varlık tarafından kapsanmayan varlıkların bulunduğu bir anlık görüntü almak için XrSpatialDiscoverySnapshotCreateInfoEXT next zincirine XrSpatialDiscoveryUniqueEntitiesFilterANDROID ekleyebilir.

Uygulamalar , XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID bileşenini XrSpatialDiscoverySnapshotCreateInfoEXT :: componentTypes içine dahil ederken XrSpatialDiscoveryUniqueEntitiesFilterANDROID'i XrSpatialDiscoverySnapshotCreateInfoEXT'e zincirlerse çalışma zamanı kesinlikle XR_ERROR_VALIDATION_FAILURE değerini döndürmelidir .

Uygulama, XrSpatialDiscoveryUniqueEntitiesFilterANDROID'i XrSpatialDiscoverySnapshotCreateInfoEXT'ye zincirliyorsa ancak XrSpatialDiscoverySnapshotCreateInfoEXT :: componentTypes içinde herhangi bir bileşen listelemiyorsa çalışma zamanı, spatialContext için yapılandırılan özellikler için XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID bileşenine sahip olanlar hariç, XrSpatialCapabilityConfigurationBaseHeaderEXT :: enabledComponents içinde numaralandırılmış bileşen kümesine sahip olan tüm uzamsal öğeleri anlık görüntüye dahil etmelidir.

Geçerli Kullanım (Dolaylı)

Örnek kod

Düzlem İzleme Özelliğini Yapılandırma

Aşağıdaki örnek kodda, XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID özelliğini destekleyen XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT özelliğiyle uzamsal bağlamın nasıl oluşturulacağı gösterilmektedir .

// Check runtime supported capabilities
uint32_t capabilityCount = 0;
CHK_XR(xrEnumerateSpatialCapabilitiesEXT(instance, systemId, 0, &capabilityCount, nullptr));
std::vector<XrSpatialCapabilityEXT> capabilities(capabilityCount);
CHK_XR(xrEnumerateSpatialCapabilitiesEXT(instance, systemId, capabilityCount, &capabilityCount, capabilities.data()));

if (std::find(capabilities.begin(), capabilities.end(), XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT) == capabilities.end()) {
  return;
}

// Enumerate supported components for plane tracking capability
XrSpatialCapabilityComponentTypesEXT planeComponents{
  .type = XR_TYPE_SPATIAL_CAPABILITY_COMPONENT_TYPES_EXT,
};
CHK_XR(xrEnumerateSpatialCapabilityComponentTypesEXT(instance, systemId, XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT, &planeComponents));
std::vector<XrSpatialComponentTypeEXT> planeCapabilityComponents(planeComponents.componentTypeCountOutput);
planeComponents.componentTypeCapacityInput = planeCapabilityComponents.size();
planeComponents.componentTypes = planeCapabilityComponents.data();
CHK_XR(xrEnumerateSpatialCapabilityComponentTypesEXT(instance, systemId, XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT, &planeComponents));

const auto supportsComponent = [&planeCapabilityComponents](XrSpatialComponentTypeEXT component) {
  return std::find(planeCapabilityComponents.begin(), planeCapabilityComponents.end(), component) != planeCapabilityComponents.end();
};


std::vector<XrSpatialComponentTypeEXT> planeTrackingComponents {
  XR_SPATIAL_COMPONENT_TYPE_BOUNDED_2D_EXT,
  XR_SPATIAL_COMPONENT_TYPE_PLANE_ALIGNMENT_EXT,
};

if (supportsComponent(XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID)) {
  planeTrackingComponents.push_back(XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID);
}

// Create capability config for plane tracking
XrSpatialCapabilityConfigurationPlaneTrackingEXT planeTrackingConfig {
  .type = XR_TYPE_SPATIAL_CAPABILITY_CONFIGURATION_PLANE_TRACKING_EXT,
  .next = nullptr,
  .capability = XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT,
  .enabledComponentCount = (uint32_t)planeTrackingComponents.size(),
  .enabledComponents = planeTrackingComponents.data(),
};

// Create spatial context
std::vector<const XrSpatialCapabilityConfigurationBaseHeaderEXT*> capabilityConfigs;
capabilityConfigs.push_back(reinterpret_cast<const XrSpatialCapabilityConfigurationBaseHeaderEXT*>(&planeTrackingConfig));

XrSpatialContextCreateInfoEXT contextCreateInfo {
  .type = XR_TYPE_SPATIAL_CONTEXT_CREATE_INFO_EXT,
  .next = nullptr,
  .capabilityConfigCount = (uint32_t)capabilityConfigs.size(),
  .capabilityConfigs = capabilityConfigs.data(),
};

CHK_XR(xrCreateSpatialContextAsyncEXT(session, &contextCreateInfo, &future))

// Completes creating spatial context
XrCreateSpatialContextCompletionEXT contextCompletion{
XR_TYPE_CREATE_SPATIAL_CONTEXT_COMPLETION_EXT};

CHK_XR(xrCreateSpatialContextCompleteEXT(session, future, &contextCompletion))

Bileşen Verilerini Sorgulama

Aşağıdaki örnek kodda, XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID ile yapılandırılmış bağlamdan XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT bileşen verilerinin nasıl sorgulanacağı gösterilmektedir .

// previously created
XrSpatialSnapshotEXT snapshot;

// Query subsumed_by components
std::array<XrSpatialComponentTypeEXT, 1> enabledComponents = {
  XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID
};

XrSpatialComponentDataQueryConditionEXT queryCond {
  .type = XR_TYPE_SPATIAL_COMPONENT_DATA_QUERY_CONDITION_EXT,
  .componentTypeCount = 1,
  .componentTypes     = enabledComponents.data(),
};

XrSpatialComponentDataQueryResultEXT queryResult {
  .type = XR_TYPE_SPATIAL_COMPONENT_DATA_QUERY_RESULT_EXT,
};

CHK_XR(xrQuerySpatialComponentDataEXT(
           snapshot, &queryCond, &queryResult));

// Query again with allocated memory
std::vector<XrSpatialEntityIdEXT> subsumedUniqueIds;
subsumedUniqueIds.resize(queryResult.entityIdCountOutput);
XrSpatialComponentSubsumedByListANDROID subsumedByList {
  .type = XR_TYPE_SPATIAL_COMPONENT_SUBSUMED_BY_LIST_ANDROID,
  .subsumedUniqueIdCount = static_cast<uint32_t>(subsumedUniqueIds.size()),
  .subsumedUniqueIds = subsumedUniqueIds.data(),
};

queryResult.next = &subsumedByList;
CHK_XR(xrQuerySpatialComponentDataEXT(
           snapshot, &queryCond, &queryResult));

for (uint32_t i = 0; i < queryResult.entityIdCountOutput; ++i) {
  // Plane was subsumed, remove it from processing logic
  // removeEntityFromProcessingLogic(queryResult.entityIds[i], /*replaceWith=*/ subsumedByList.subsumedUniqueIds[i]);
}

// Cleanup
xrDestroySpatialSnapshotEXT(snapshot);

Kapsanan öğeleri filtreleme

Aşağıdaki örnek kodda, XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID bileşeni eklenmiş öğelerin filtre kullanılarak keşif anlık görüntüsünden nasıl filtreleneceği ve kapsayan öğelerin öğe kimliğinin nasıl sorgulanacağı gösterilmektedir.

// Init filter
XrSpatialDiscoveryUniqueEntitiesFilterANDROID filter {
  .type = XR_TYPE_SPATIAL_DISCOVERY_UNIQUE_ENTITIES_FILTER_ANDROID,
};

// Chain filter to the snapshot create info
// WARNING: Chaining the filter while include subsumed_by component in the
// componentTypes is invalid
XrSpatialDiscoverySnapshotCreateInfoEXT discoverySnapshotCreateInfo {
  .type = XR_TYPE_SPATIAL_DISCOVERY_SNAPSHOT_CREATE_INFO_EXT,
  .next = &filter
};

XrFutureEXT future {XR_NULL_FUTURE_EXT};
CHK_XR(xrCreateSpatialDiscoverySnapshotAsyncEXT(spatialContext, &discoverySnapshotCreateInfo, &future))

waitUntilReady(future);

// Complete async operation.
XrCreateSpatialDiscoverySnapshotCompletionInfoEXT
  createSnapshotCompletionInfo {
    .type   = XR_TYPE_CREATE_SPATIAL_DISCOVERY_SNAPSHOT_COMPLETION_INFO_EXT,
    .baseSpace = space,
    .time      = updateTime,
    .future    = future,
  };

XrCreateSpatialDiscoverySnapshotCompletionEXT completion {
  .type = XR_TYPE_CREATE_SPATIAL_DISCOVERY_SNAPSHOT_COMPLETION_EXT,
};

CHK_XR(xrCreateSpatialDiscoverySnapshotCompleteEXT(
           spatialContext, &createSnapshotCompletionInfo,
           &completion));

if(completion.futureResult != XR_SUCCESS) return;

// Subsumed entities has already been filtered out in this snapshot,
// now query the various components of the entities.

// Cleanup
xrDestroySpatialSnapshotEXT(completion.snapshot);

Yeni Yapılar

Yeni Enum Sabitleri

  • XR_ANDROID_SPATIAL_COMPONENT_SUBSUMED_BY_EXTENSION_NAME
  • XR_ANDROID_spatial_component_subsumed_by_SPEC_VERSION
  • XrSpatialComponentTypeEXT'yi genişletme :

    • XR_SPATIAL_COMPONENT_TYPE_SUBSUMED_BY_ANDROID
  • XrStructureType uzatma :

    • XR_TYPE_SPATIAL_COMPONENT_SUBSUMED_BY_LIST_ANDROID
    • XR_TYPE_SPATIAL_DISCOVERY_UNIQUE_ENTITIES_FILTER_ANDROID

Sayılar

Sürüm Geçmişi

  • 1. düzeltme, 19.11.2025 (Brian Chen)

    • İlk uzantı açıklaması.