<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PerClothVertexData",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:22RealityFoundationCloth03PerC10VertexDataV"
  },
  "title" : "PerClothVertexData"
}
-->

# PerClothVertexData

A generic type that stores per-vertex data in a buffer.

```
struct PerClothVertexData<ElementType>
```

## Topics

### Accessing vertex data

[`var vertexCount: Int`](/documentation/RealityKit/PerClothVertexData/vertexCount)

The number of vertices this structure holds data for.

[`func withElements<Result>((Span<ElementType>) -> Result) -> Result`](/documentation/RealityKit/PerClothVertexData/withElements(_:))

Provides read-only access to the per-vertex data within a callback.

[`func withMutableElements<Result>((inout MutableSpan<ElementType>) -> Result) -> Result`](/documentation/RealityKit/PerClothVertexData/withMutableElements(_:))

Provides mutable access to the per-vertex data within a callback.

### Setting vertex values

[`func set(vertexIndices: [UInt32], value: ElementType)`](/documentation/RealityKit/PerClothVertexData/set(vertexIndices:value:))

Sets the data for the given vertex indices to a common value.

[`func setAll(value: ElementType)`](/documentation/RealityKit/PerClothVertexData/setAll(value:))

Sets the data for all vertices to a common value.

[`func reset()`](/documentation/RealityKit/PerClothVertexData/reset()-1nlsc)

Resets the per-vertex data of each vertex to the default position constraint.

[`func reset()`](/documentation/RealityKit/PerClothVertexData/reset()-403m8)

Resets the per-vertex data of each vertex to a zero-force external force.

[`func reset()`](/documentation/RealityKit/PerClothVertexData/reset()-4x5xi)

Resets the per-vertex data of each vertex to the default motion type.

### Instance Methods

[`func reset()`](/documentation/RealityKit/PerClothVertexData/reset())

Resets the per-vertex data of each vertex to the default position constraint.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)