Cubios::Math::Vec2
Constructors
Vec2
Summary
Constructs a two-component vector object
Synopsis
Arguments
- x - x component value
- y - y component value
Synopsis
Arguments
- vec - a source vector
Synopsis
Arguments
- p - a pointer to an array of floating point values
Synopsis
Synopsis
Arguments
- p - a pointer to an array of floating point values
Synopsis
Public Members
X
Summary
X component of a vector
Y
Summary
Y component of a vector
Operators
Summary
Addition of two vectors
Synopsis
Summary
Subtraction of two vectors
Synopsis
Summary
Multiply a vector by a number
Synopsis
Summary
Negation of a vector
Synopsis
Summary
Dot product of two vectors
Synopsis
Summary
Other operations
Synopsis
Public Methods
Set
Summary
Sets values to a vector
Arguments
- x - x component value
- y - y component value
Synopsis
Arguments
- vec - the vector that holds values to be set
Synopsis
Arguments
- p - a pointer to an array of floating point values
Synopsis
Len
Summary
Returns a length of the vector
Synopsis
Norm
Summary
Performs vector normalization
Synopsis
IsEqual
Summary
Checks an equality of with a given vector
Arguments
- v - vector to compare with
- tol - comparison tolerance
Output
True if vectors are tolerantly equal, otherwise false
Synopsis
Compare
Summary
Performs fuzzy comparison of vectors
Arguments
- v - vector to compare with
- tol - comparison tolerance
Output
- -1 if current vector is shorter
- 0 if vectors are identical
- 1 if current vector is longer
Synopsis