---
title: "index(ofSpatialLocation:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlvoxelarray/index(ofspatiallocation:)"
---

# index(ofSpatialLocation:)

Returns voxel information corresponding to the specified point in the world coordinate space of the asset from which the voxel array was created.

## Declaration

```swift
func index(ofSpatialLocation location: vector_float3) -> MDLVoxelIndex
```

## Parameters

- `location`: A point in the world coordinate space of the asset from which the voxel array was created.

## Return Value

Return Value An index describing both the location of the voxel within the three-dimensional grid of the voxel array and its relationship to the volume of the object modeled by the voxel array.

## Discussion

Discussion The coordinate space for spatial locations of voxels is the world space of the asset from which the voxel array was created, or for voxel arrays created with the init(data:boundingBox:voxelExtent:) initializer, the bounding box specified at initialization.

## See Also

### Relating Voxels to Scene Space

- [boundingBox](modelio/mdlvoxelarray/boundingbox.md)
- [spatialLocation(ofIndex:)](modelio/mdlvoxelarray/spatiallocation(ofindex:).md)
- [voxelBoundingBox(atIndex:)](modelio/mdlvoxelarray/voxelboundingbox(atindex:).md)
