# VertexAttributeDescriptor

Artifact: [androidx.xr.scenecore:scenecore](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/VertexLayout.kt+class:androidx.xr.scenecore.VertexAttributeDescriptor) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class VertexAttributeDescriptor
```

<br />

*** ** * ** ***

Descriptor for a single vertex attribute.

Defines how a specific vertex attribute is structured within a vertex buffer. If the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#offset()` is set to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#AUTO_OFFSET()`, the attribute will be placed immediately after the previous attribute in the same buffer, or at the beginning of the vertex data if this is the first attribute. The offset cannot exceed `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#MAX_OFFSET()`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the given `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#type()` is incompatible with the given `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#attribute()`, or if `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#offset()` is not `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#AUTO_OFFSET()` and is not between 0 and `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#MAX_OFFSET()`. |

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#AUTO_OFFSET()` Indicates that the attribute offset should be computed automatically by placing it immediately after the previous attribute in the same buffer, or at the beginning of the vertex data if this is the first attribute. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#MAX_OFFSET() = 32767` The maximum allowed byte offset for a vertex attribute. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#VertexAttributeDescriptor(androidx.xr.scenecore.VertexAttribute,androidx.xr.scenecore.VertexAttributeType,kotlin.Int)( attribute: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttribute, type: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeType, offset: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = -1, to = 32767) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttribute` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#attribute()` The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttribute` semantic of the attribute. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = -1, to = 32767) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#offset()` The byte offset of the attribute from the start of the vertex data. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeType` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor#type()` The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeType` data type of the attribute. |

## Constants

### AUTO_OFFSET

```
const val AUTO_OFFSET: Int
```

Indicates that the attribute offset should be computed automatically by placing it immediately after the previous attribute in the same buffer, or at the beginning of the vertex data if this is the first attribute.

### MAX_OFFSET

```
const val MAX_OFFSET = 32767: Int
```

The maximum allowed byte offset for a vertex attribute.

## Public constructors

### VertexAttributeDescriptor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
VertexAttributeDescriptor(
    attribute: VertexAttribute,
    type: VertexAttributeType,
    offset: @IntRange(from = -1, to = 32767) Int = AUTO_OFFSET
)
```

| Parameters |
|---|---|
| `attribute: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttribute` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttribute` semantic of the attribute. |
| `type: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeType` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeType` data type of the attribute. |
| `offset: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = -1, to = 32767) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = AUTO_OFFSET` | The byte offset of the attribute from the start of the vertex data. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### attribute

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val attribute: VertexAttribute
```

The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttribute` semantic of the attribute.

### offset

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val offset: @IntRange(from = -1, to = 32767) Int
```

The byte offset of the attribute from the start of the vertex data.

### type

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val type: VertexAttributeType
```

The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeType` data type of the attribute.