Class

ShapeResource

A representation of a shape.

Declaration

class ShapeResource

Topics

Transforming a Shape

func offsetBy(rotation: simd_quatf) -> ShapeResource

Creates a new shape resource by applying a rotation.

func offsetBy(translation: SIMD3<Float>) -> ShapeResource

Creates a new shape resource by applying a translation.

func offsetBy(rotation: simd_quatf, translation: SIMD3<Float>) -> ShapeResource

Creates a new shape resource by applying a rotation and a translation.

Generating Boxes

static func generateBox(size: SIMD3<Float>) -> ShapeResource

Creates a box shape with the specified extent.

Generating Spheres

static func generateSphere(radius: Float) -> ShapeResource

Creates a sphere shape with the specified radius.

Generating Capsules

static func generateCapsule(height: Float, radius: Float) -> ShapeResource

Creates a capsule shape with the specified height and radius.

Generating Generaly Convex Shapes

static func generateConvex(from: [SIMD3<Float>]) -> ShapeResource

Creates a convex shape from the given points.

static func generateConvex(from: MeshResource) -> ShapeResource

Creates a convex shape from the given mesh.

class MeshResource

A high-level representation of a collection of vertices and edges that define a shape.

Comparing Shapes

static func == (ShapeResource, ShapeResource) -> Bool

Indicates whether two shapes are equal.

static func != (ShapeResource, ShapeResource) -> Bool

Indicates whether two shapes are not equal.

func hash(into: inout Hasher)

Hashes the essential components of the shape by feeding them into the given hash function.

var hashValue: Int

The hashed value of the shape.

Relationships

Conforms To

See Also

Setting Collision Shapes

var shapes: [ShapeResource]

A collection of shape resources that collectively represent the outer dimensions of an entity for the purposes of collision detection.