Type Method

vectorWithString:

Creates and returns a vector that is initialized with values provided in a string representation.

Declaration

+ (instancetype)vectorWithString:(NSString *)representation;

Parameters

representation

A string that is in one of the formats returned by the stringRepresentation method.

Discussion

Some typical string representations for vectors are:

@"[1.0 0.5 0.3]"

which specifies a vec3 vector whose components are X = 1.0, Y = 0.5, and Z = 0.3

@"[10.0 23.0]

which specifies a vec2 vector show components are X = 10.0 and Y = 23.0

See Also

Creating a Vector

+ vectorWithValues:count:

Creates and returns a vector that is initialized with the specified values.

+ vectorWithX:

Creates and returns a vector that is initialized with one value.

+ vectorWithX:Y:

Creates and returns a vector that is initialized with two values.

+ vectorWithX:Y:Z:

Creates and returns a vector that is initialized with three values.

+ vectorWithX:Y:Z:W:

Creates and returns a vector that is initialized with four values.

+ vectorWithCGAffineTransform:

Creates and returns a vector that is initialized with values provided by a CGAffineTransform structure.

+ vectorWithCGPoint:

Creates and returns a vector that is initialized with values provided by a CGPoint structure.

+ vectorWithCGRect:

Creates and returns a vector that is initialized with values provided by a CGRect structure.