Inherits from NSObject
Conforms to PMTweenPhysicsSolving
Declared in PMTweenPhysicsSystem.h
PMTweenPhysicsSystem.m

Overview

PMTweenPhysicsSystem is the default class used by PMTweenPhysicsUnit to update values.

Class Methods

system

Convenience method that returns a new instance of this class.

+ (instancetype)system

Return Value

A new instance of this class.

Declared In

PMTweenPhysicsSystem.h

Instance Methods

friction

The friction value to be applied in physics calculations.

- (double)friction

Declared In

PMTweenPhysicsSystem.h

initWithVelocity:friction:

Initializes a new PMTweenPhysicsSystem object, setting up the physics system with initial values for velocity and friction.

- (instancetype)initWithVelocity:(double)velocity friction:(double)friction

Parameters

velocity

The initial velocity to use.

friction

The friction coefficient to use.

Return Value

A new instance of this class.

Declared In

PMTweenPhysicsSystem.h

pauseSystem

This method should pause the physics system, preventing any new calculations.

- (void)pauseSystem

Declared In

PMTweenPhysicsSystem.h

resetSystem

This method should reset the physics system to its initial velocity and clear the timestamp used to calculate the current step.

- (void)resetSystem

Declared In

PMTweenPhysicsSystem.h

resumeSystem

This method should resume the physics system.

- (void)resumeSystem

Declared In

PMTweenPhysicsSystem.h

reverseDirection

This method should reverse the direction of the velocity.

- (void)reverseDirection

Declared In

PMTweenPhysicsSystem.h

setFriction:

The friction value to be applied in physics calculations.

- (void)setFriction:(double)friction

Declared In

PMTweenPhysicsSystem.h

setVelocity:

The velocity value to use in physics calculations.

- (void)setVelocity:(double)velocity

Declared In

PMTweenPhysicsSystem.h

solveForPosition:currentTime:

This method updates a 1D position using physics calculations.

- (double)solveForPosition:(double)position currentTime:(NSTimeInterval)elapsedTime

Parameters

position

The current position of the physics object being modeled.

currentTime

The current timestamp.

Return Value

An updated position.

Declared In

PMTweenPhysicsSystem.h

velocity

The velocity value to use in physics calculations.

- (double)velocity

Declared In

PMTweenPhysicsSystem.h