Public Member Functions | |
Base operations. | |
| float[] | array () |
| Get this vector as an array. | |
| float | index (int i) |
| Index a parameter. | |
| void | index (int i, float v) |
| Set an index. | |
| void | print () |
| Print out. | |
| void | set (float v) |
| Set all parameters to a single value. | |
| void | set (float x, float y) |
| Set the parameters and z and w to zero. | |
| void | set (float x, float y, float z) |
| Set the parameters and w to zero. | |
| void | set (float x, float y, float z, float w) |
| Set the parameters. | |
| vec2 | swizzle (int a, int b) |
| Swizzle into a 2D vector. | |
| vec3 | swizzle (int a, int b, int c) |
| Swizzle into a 3D vector. | |
| vec4 | swizzle (int a, int b, int c, int d) |
| Swizzle into a 4D vector. | |
| char[] | toString () |
| Convert to string. | |
Operations on vectors. | |
| vec4 | abs () |
| Get the absolute vector. | |
| float | absMaxAxis () |
| Get the absolute maximum axis. | |
| vec4 | ceil () |
| Return the nearest integer that is equal to or greater than a. | |
| vec4 | clamp (vec4 minVal, vec4 maxVal) |
| Return min (max (a, minVal), maxVal). | |
| vec4 | clamp (float minVal, float maxVal) |
| Return min (max (a, minVal), maxVal). | |
| bit | cmpge (vec3 b) |
| Return whether this vector is greater than or equal to b in each axis. | |
| bit | cmpg (vec3 b) |
| Return whether this vector is greater than b in each axis. | |
| bit | cmpl (vec3 b) |
| Return whether this vector is less than b in each axis. | |
| bit | cmple (vec3 b) |
| Return whether this vector is less than or equal to b in each axis. | |
| vec4 | floor () |
| Return the nearest integer that is equal to or less than a. | |
| vec4 | fract () |
| Return a - a.floor (). | |
| vec4 | max (vec4 b) |
| Select the maximum of either's axis. | |
| float | maxAxis () |
| Get the maximum axis. | |
| vec4 | min (vec4 b) |
| Select the minimum of either's axis. | |
| float | minAxis () |
| vec4 | mix (vec4 b, float t) |
| Return the linear blend of this and b (this * (1 - t) + b * t). | |
| vec4 | sign () |
| Return 1.0 if a >= 0, else -1.0. | |
Operator overloading. | |
| vec4 | add (float b) |
| Add a scalar. | |
| vec4 | add (vec2 b) |
| Add a zero-extended vector. | |
| vec4 | add (vec3 b) |
| Add a zero-extended vector. | |
| vec4 | add (vec4 b) |
| Add a vector. | |
| vec4 | addass (float b) |
| Add and assign a scalar. | |
| vec4 | addass (vec2 b) |
| Add and assign a zero-extended vector. | |
| vec4 | addass (vec3 b) |
| Add and assign a zero-extended vector. | |
| vec4 | addass (vec4 b) |
| Add and assign a vector. | |
| float | cmp (float b) |
| Compare to a scalar. | |
| float | cmp (vec2 b) |
| Compare to a zero-extended vector. | |
| float | cmp (vec3 b) |
| Compare to a zero-extended vector. | |
| float | cmp (vec4 b) |
| Compare to a vector. | |
| bit | eq (float b) |
| Determine equivalence to a scalar. | |
| bit | eq (vec2 b) |
| Determine equivalence to a zero-extended vector. | |
| bit | eq (vec3 b) |
| Determine equivalence to a zero-extended vector. | |
| bit | eq (vec4 b) |
| Determine equivalence to a vector. | |
| vec4 | mod (float b) |
| Modulus with a scalar. | |
| vec4 | mod (vec2 b) |
| Modulus with a zero-extended vector. | |
| vec4 | mod (vec3 b) |
| Modulus with a zero-extended vector. | |
| vec4 | mod (vec4 b) |
| Modulus with a vector. | |
| vec4 | mod_r (float b) |
| Modulus a scalar. | |
| vec4 | mod_r (vec2 b) |
| Modulus a zero-extended vector. | |
| vec4 | mod_r (vec3 b) |
| Modulus with a zero-extended vector. | |
| vec4 | modass (float b) |
| Modulus and assign a scalar. | |
| vec4 | modass (vec2 b) |
| Modulus and assign a zero-extended vector. | |
| vec4 | modass (vec3 b) |
| Modulus and assign a zero-extended vector. | |
| vec4 | modass (vec4 b) |
| Modulus and assign a vector. | |
| vec4 | mul (float b) |
| Multiply by a scalar. | |
| vec4 | mul (vec2 b) |
| Multiply by a zero-extended vector. | |
| vec4 | mul (vec3 b) |
| Multiply by a zero-extended vector. | |
| vec4 | mul (vec4 b) |
| Multiply by a vector. | |
| vec4 | mulass (float b) |
| Multiply and assign a scalar. | |
| vec4 | mulass (vec2 b) |
| Multiply and assign a zero-extended vector. | |
| vec4 | mulass (vec3 b) |
| Multiply and assign a zero-extended vector. | |
| vec4 | mulass (vec4 b) |
| Multiply and assign a vector. | |
| vec4 | neg () |
| Negate each axis. | |
| vec4 | sub (float b) |
| Subtract a scalar. | |
| vec4 | sub (vec2 b) |
| Subtract a zero-extended vector. | |
| vec4 | sub (vec3 b) |
| Subtract a zero-extended vector. | |
| vec4 | sub (vec4 b) |
| Subtract a vector. | |
| vec4 | sub_r (float b) |
| Subtract a scalar. | |
| vec4 | sub_r (vec2 b) |
| Subtract a zero-extended vector. | |
| vec4 | sub_r (vec3 b) |
| Subtract a zero-extended vector. | |
| vec4 | subass (float b) |
| Subtract and assign a scalar. | |
| vec4 | subass (vec2 b) |
| Subtract and assign a zero-extended vector. | |
| vec4 | subass (vec3 b) |
| Subtract and assign a zero-extended vector. | |
| vec4 | subass (vec4 b) |
| Subtract and assign a vector. | |
Static Public Member Functions | |
| vec4 | create (float x, float y) |
| Create a vector with a z and w of zero. | |
| vec4 | create (float x, float y, float z) |
| Create a vector with a w of zero. | |
| vec4 | create (float x, float y, float z, float w) |
| Create a vector. | |
Public Attributes | |
| float | x |
| X coordinate. | |
| float | y |
| Y coordinate. | |
| float | z |
| Z coordinate. | |
| float | w |
| W coordinate. | |
Related Functions | |
| (Note that these are not member functions.) | |
| vec4 | avec4 (float b) |
| Create a four-dimensional vector with all the same axes. | |
| vec4 | avec4 (float x, float y) |
| Create a four-dimensional vector with zero in z and w. | |
| vec4 | avec4 (float x, float y, float z) |
| Create a four-dimensional vector with zero in w. | |
| vec4 | avec4 (float x, float y, float z, float w) |
| Create a four-dimensional vector. | |
| vec4 | avec4 (vec2 base) |
| Create a four-dimensional vector by zero-extending a two-dimensional vector. | |
| vec4 | avec4 (vec3 base) |
| Create a four-dimensional vector by zero-extending a three-dimensional vector. | |
1.3.2