Conforms to NSObject
Declared in OGWKinematicsAspect.h

Overview

A delegate can implement this protocol to be notified when the OGWKinematicsAspect has updated velocity and position.

Tasks

Did Integrate Position

Instance Methods

aspect:kinematicsDidIntegratePosition:velocity:axis:

This selector is performed twice, once for each axis. The X axis is integrated first. Delegates can implement this selector to perform additional contact resolution.

- (void)aspect:(OGWKinematicsAspect *)aspect kinematicsDidIntegratePosition:(GWPoint *const)position velocity:(GWVector)velocity axis:(OGWAxis)axis

Parameters

aspect

The OGWKinematicsAspect sending the selector.

position

The updated position after the current OGWAxis has been integrated. This position may be different from entity.position, and is only applied to entity.position after both axis have been integrated.

velocity

The current velocity the kinematics aspect is applying to position.

axis

The axis the kinematics aspect did integrate. The X axis is integrated before the Y axis. When this parameter is OGWAxisX then the position->y has not been integrated yet.

Discussion

Note: If the delegate needs to make changes to the position as a result of contact resolution, the position parameter should be modified rather than the entity.position property. The entity.position property is updated only after both axis have been integrated. In other words, if you need to look at the entity’s previous position, you can use entity.position and compare it with the position passed into the selector to determine the distance between the two points. Of course you could also reverse integrate position with the negated velocity.

Declared In

OGWKinematicsAspect.h