GLKVector3

Overview

The GLKVector3 type defines a 3-component floating-point vector as well as many mathematical operations commonly used to manipulate vectors. Graphics programming uses vectors extensively to represent positions, normals, colors and other data structures.

The functions that manipulate GLKVector3 structures treat the inputs as immutable, instead returning a new vector that represent the results of the operation.

Topics

Creating Vectors

GLKVector3Make

Returns a new three-component vector created from individual component values.

GLKVector3MakeWithArray

Returns a new three-component vector created from an array of components.

Retrieving Information About a Vector

GLKVector3Length

Returns the length of a vector.

GLKVector3Distance

Returns the distance between two points.

Mathematical Operations Performed on Vectors

GLKVector3Negate

Returns a new vector created by negating the component values of another vector.

GLKVector3Normalize

Returns a new vector created by normalizing the input vector to a length of 1.0.

GLKVector3AddScalar

Returns a new vector created by adding a scalar value to each component of a vector.

GLKVector3SubtractScalar

Returns a new vector created by subtracting a scalar value from each component of a vector.

GLKVector3MultiplyScalar

Returns a new vector created by multiplying each component of a vector by a scalar value.

GLKVector3DivideScalar

Returns a new vector created by dividing each component of a vector by a scalar value.

GLKVector3Add

Returns the sum of two vectors.

GLKVector3Subtract

Returns the difference between two vectors.

GLKVector3Multiply

Returns the product of two vectors.

GLKVector3Divide

Returns a new vector created by dividing one vector by another.

GLKVector3DotProduct

Returns the dot product of two vectors.

GLKVector3CrossProduct

Returns the cross product of two vectors.

GLKVector3Lerp

Returns a new vector created by linearly interpreting between two vectors.

GLKVector3Project

Returns a new vector created by projecting a vector onto another vector.

GLKVector3Maximum

Returns a new vector whose component value at each position is the largest component value at the same position in the source vectors.

GLKVector3Minimum

Returns a new vector whose component value at each position is the smallest component value at the same position in the source vectors.

Comparison Operations

GLKVector3AllEqualToScalar

Returns a Boolean value that states whether all the components of the source vector are equal to a scalar value.

GLKVector3AllEqualToVector3

Returns a Boolean value that indicates whether each component of the first vector is equal to the corresponding component of a second vector.

GLKVector3AllGreaterThanOrEqualToScalar

Returns a Boolean value that states whether all the components of the source vector are greater than or equal to a scalar value.

GLKVector3AllGreaterThanOrEqualToVector3

Returns a Boolean value that indicates whether each component of the first vector is greater than or equal to the corresponding component of a second vector.

GLKVector3AllGreaterThanScalar

Returns a Boolean value that states whether all the components of the source vector are greater than a scalar value.

GLKVector3AllGreaterThanVector3

Returns a Boolean value that indicates whether each component of the first vector is greater than the corresponding component of a second vector.

Data Types

GLKVector3

A representation of a 3-component vector.

See Also

Math Utilties

GLKMatrixStackRef

An opaque type that represents a stack of 4 x 4 matrices, providing support for hierarchical transform modeling and similar tasks.