PhysicsConfiguration
public struct PhysicsConfiguration
This model is used to configure a PhysicsSystem object.
-
The velocity value to use in physics calculations. An appropriate value should be chosen based on the property you wish to modify.
Declaration
Swift
public var velocity: Double -
The friction value to be applied in physics calculations. Valid values are between 0.0 and 1.0, with 0.0 denoting almost no friction, and 1.0 causing no movement to occur. Any values outside that range will be clamped by the motion object.
Declaration
Swift
public var friction: Double -
An optional restitution value from 0.0 to 1.0 which represents the elasticity of an object and is used in collision calculations, with 0.0 representing a perfectly inelastic collision (in which the object does not rebound at all during a collision), and 1.0 representing a perfectly elastic collision (in which the object rebounds with no loss of velocity). Provided values outside of that range are clamped to the closest minimum or maximum value.
Declaration
Swift
public var restitution: Double? -
This Boolean denotes whether a
PhysicsSystemobject should handle collisions between an object and the specified collision points.Declaration
Swift
public var useCollisionDetection: Bool? -
Initializer.
Declaration
Swift
public init(velocity: Double, friction: Double, restitution: Double? = nil, useCollisionDetection: Bool? = nil)Parameters
velocityThe velocity value to use in physics calculations.
frictionThe friction value to be applied in physics calculations. Valid values are between 0.0 and 1.0, with 0.0 denoting almost no friction, and 1.0 causing no movement to occur.
restitutionAn optional restitution value from 0.0 to 1.0 which represents the elasticity of an object during collisions.
useCollisionDetectionThis Boolean denotes whether a
PhysicsSystemobject should handle collisions between an object and the specified collision points.
View on GitHub