# 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)

*** ** * ** ***


```
public final 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/androidx/xr/scenecore/VertexAttributeDescriptor#offset()` is set to `https://developer.android.com/reference/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/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/androidx/xr/scenecore/VertexAttributeDescriptor#type()` is incompatible with the given `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#attribute()`, or if `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#offset()` is not `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#AUTO_OFFSET()` and is not between 0 and `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#MAX_OFFSET()`. |

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/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. |
| `static final int` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#MAX_OFFSET() = 32767` The maximum allowed byte offset for a vertex attribute. |

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/VertexAttribute` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#getAttribute()()` The `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttribute` semantic of the attribute. |
| `final int` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#getOffset()()` The byte offset of the attribute from the start of the vertex data. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeType` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#getType()()` The `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeType` data type of the attribute. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor#toString()()` |

## Constants

### AUTO_OFFSET

```
public static final int 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.

### MAX_OFFSET

```
public static final int MAX_OFFSET = 32767
```

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)

```
public VertexAttributeDescriptor(
    @NonNull VertexAttribute attribute,
    @NonNull VertexAttributeType type,
    @IntRange(from = -1, to = 32767) int offset
)
```

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

## Public methods

### equals

```
public boolean equals(Object other)
```

### getAttribute

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

```
public final @NonNull VertexAttribute getAttribute()
```

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

### getOffset

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

```
public final int getOffset()
```

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

### getType

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

```
public final @NonNull VertexAttributeType getType()
```

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

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```