Instance Method


Creates a warp geometry grid of a specific size and warp translation, in pointers to point arrays.


- (instancetype)initWithColumns:(NSInteger)cols rows:(NSInteger)rows sourcePositions:(const vector_float2 *)sourcePositions destPositions:(const vector_float2 *)destPositions;



The number of columns in the grid.


The number of rows in the grid.


The geometry's source positions or nil.


The geometry's destination positions or nil.

Return Value

A new warp geometry grid object.


You supply the source and destination position as pointers to row-major arrays of normalized vector_float2 coordinates. The number of horizontal coordinates is the column count plus one and the number of vertical coordinates is the row count plus one. Passing nil as either of the position arguments results in an identity warp with vertices distributed evenly throughout the geometry. Passing nil to both sourcePositions and destPositions gives a result identical to gridWithColumns:rows:.

See Also

Creating a Warp Geometry Grid

+ gridWithColumns:rows:

Creates a warp geometry grid of a specified size.

+ grid

Initializes a new empty grid.

- initWithCoder:

Tells you when to intialize a grid that was loaded from an archive.