Contents

sphere(radius:in:restitution:)

Creates a sphere with the specified radius that the player tosses during gameplay.

Declaration

static func sphere(radius: Float, in unit: UnitLength = .meters, restitution: Float? = nil) -> TossableRepresentation

Parameters

  • radius:

    The radius of the sphere.

  • unit:

    The unit of measurement for the radius.

  • restitution:

    The coefficient of restitution, in the range [0, 1].

Discussion

Higher restitution values indicate materials that conserve kinetic energy during collisions, causing objects to bounce off each other elastically. Lower values suggest materials that absorb kinetic energy, resulting in less bounce and more energy loss upon impact.

See Also

Creating geometric shapes