<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PhysicsBodyComponent/init(shapes:density:material:mode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation20PhysicsBodyComponentV6shapes7density8material4modeACSayAA13ShapeResourceCG_SfAA0c8MaterialK0CSgAA0cD4ModeOtcfc"
  },
  "title" : "init(shapes:density:material:mode:)"
}
-->

# init(shapes:density:material:mode:)

Creates a physics body component deriving mass properties from shape and
density.

```
@MainActor @preconcurrency init(shapes: [ShapeResource], density: Float, material: PhysicsMaterialResource? = nil, mode: PhysicsBodyMode = .dynamic)
```

## Parameters

`shapes`

The shape for which to estimate the mass, rotational inertia,
and center of mass.

`density`

The density of the object in kilograms per cubic meter.

`material`

The material properties, like friction.

`mode`

The simulation mode that indicates how a body responds to
forces.

---

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)