One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicsMaterialResource

class · iOS 13.0+ · SDK 27.1

@MainActor @preconcurrency class PhysicsMaterialResource

Material properties, like friction, of a physically simulated object.

Members (3)

get · iOS 13.0+

default

TypeScript
static get default(): Promise<PhysicsMaterialResource>
Swift declaration
@MainActor @preconcurrency static let `default`: PhysicsMaterialResource

A default material resource.

static · iOS 13.4+

generate

TypeScript
static generateStaticFrictionDynamicFrictionRestitution(staticFriction: number, dynamicFriction: number, restitution: number): Promise<PhysicsMaterialResource>
Swift declaration
@MainActor @preconcurrency static func generate(staticFriction: Float, dynamicFriction: Float, restitution: Float) -> PhysicsMaterialResource

Creates a new material with the specified static friction, dynamic friction, and restitution. - Parameters: - staticFriction: The static (stationary) friction coefficient in the range [0, ∞). - dynamicFriction: The dynamic (moving) friction coefficient in the range [0, ∞). - restitution: The coefficient of restitution (bounciness) in the range [0, 1].

static · iOS 13.0+

generate

TypeScript
static generateFrictionRestitution(friction?: number, restitution?: number): Promise<PhysicsMaterialResource>
Swift declaration
@MainActor @preconcurrency static func generate(friction: Float = 0.8, restitution: Float = 0.8) -> PhysicsMaterialResource

Generates a new material with the given characteristics. - Parameters: - friction: The coefficient of friction, in the range `[0, infinity)`. - restitution: The coefficient of restitution, in the range `[0, 1]`. Use values at the high end of the range to indicate materials that experience elastic collisions, meaning that objects bounce off each other and kinetic energy is conserved after a collision. Use low values to indicate materials that lose kinetic energy when they collide. - Returns: A physics material resource.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →