A 3-element vector which is represented by xyz coordinates.
|
Public Member Functions |
|
| pgVec () |
| | Constructs a pgVec.
|
| | pgVec (r32 x_, r32 y_, r32 z_=0.0f) |
| | Constructs and initializes a pgVec from the specified xyz coordinates.
|
| void | set (r32 x_, r32 y_, r32 z_=0.0f) |
| | Sets all components from the specified xyz coordinates.
|
| pgVec | operator+ (const pgVec &vec) const |
| | Returns a pgVec which is the sum of this pgVec and the right hand side pgVec.
|
| void | operator+= (const pgVec &vec) |
| | Adds the right hand side pgVec to this pgVec.
|
| pgVec | operator- () const |
| | Returns a pgVec which is the negative of this pgVec.
|
| pgVec | operator- (const pgVec &vec) const |
| | Returns a pgVec which is the right hand side pgVec subtracted from this pgVec.
|
| void | operator-= (const pgVec &vec) |
| | Subtracts the right hand side pgVec from this pgVec.
|
| pgVec | operator* (r32 s) const |
| | Returns a pgVec which is this pgVec multiplied with the right hand side scalar.
|
| void | operator*= (r32 s) |
| | Multiplies this pgVec with the right hand side scalar.
|
| pgVec | operator/ (r32 s) const |
| | Returns a pgVec which is this pgVec divided by the right hand side scalar.
|
| void | operator/= (r32 s) |
| | Divides this pgVec by the right hand side scalar.
|
| r32 | length () const |
| | Returns the length of this pgVec.
|
| r32 | sqLength () const |
| | Returns the squared length of this pgVec.
|
| r32 | dist (const pgVec &vec) const |
| | Returns the distance between this pgVec and an another pgVec.
|
| r32 | sqDist (const pgVec &vec) const |
| | Returns the squared distance between this pgVec and an another pgVec.
|
| r32 | dot (const pgVec &vec) const |
| | Returns the inner product of this pgVec and an another pgVec.
|
| pgVec | cross (const pgVec &vec) const |
| | Returns the outer product of this pgVec and an another pgVec.
|
| pgVec | rotateX_r32 (r32 deg) const |
| | Returns a pgVec which is this pgVec rotated around the orthonormal x-axis.
|
| pgVec | rotateY_r32 (r32 deg) const |
| | Returns a pgVec which is this pgVec rotated around the orthonormal y-axis.
|
| pgVec | rotateZ_r32 (r32 deg) const |
| | Returns a pgVec which is this pgVec rotated around the orthonormal z-axis.
|
| pgVec | rotateX_s32 (s32 deg) const |
| | Returns a pgVec which is this pgVec rotated around the orthonormal x-axis.
|
| pgVec | rotateY_s32 (s32 deg) const |
| | Returns a pgVec which is this pgVec rotated around the orthonormal y-axis.
|
| pgVec | rotateZ_s32 (s32 deg) const |
| | Returns a pgVec which is this pgVec rotated around the orthonormal z-axis.
|
| pgVec | normalize () const |
| | Returns a pgVec which is the normalized this pgVec.
|
| pgVec | interp (const pgVec &to, r32 ratio) const |
| | Returns a pgVec which is interpolated between this pgVec and an another pgVec by the specified ratio, using linear interpolation.
|
| pgVec | slerp (const pgVec &to, r32 ratio) const |
| | Returns a pgVec which is interpolated between this pgVec and an another pgVec by the specified ratio, using spherical linear interpolation.
|
| pgVec | toLocalOf (const pgMat &mat) const |
| | Returns a pgVec which is this pgVec converted from in the world coordinate system to in the local coordinate system of the specified pgMat.
|
| pgVec | toGlobalFrom (const pgMat &mat) const |
| | Returns a pgVec which is this pgVec converted from in the local coordinate system of the specified pgMat to in the world coordinate system.
|
| pgVec | toLocalOf_noTrans (const pgMat &mat) const |
| | Returns a pgVec which is this pgVec converted from in the world coordinate system to in the local coordinate system of the specified pgMat whose translation is ignored.
|
| pgVec | toGlobalFrom_noTrans (const pgMat &mat) const |
| | Returns a pgVec which is this pgVec converted from in the local coordinate system of the specified pgMat whose translation is ignored to in the world coordinate system.
|
| void | toR32x4 (r32 *r32x4, r32 w) const |
| | Converts this pgVec to a 4-element array.
|
Static Public Member Functions |
| static pgVec | fromR32x4 (const r32 *r32x4) |
| | Returns a pgVec which is converted from a 4-element array.
|
| static void | mulR32x4 (r32 *res_r32x4, const r32 *lhs_r32x16, const r32 *rhs_r32x4) |
| | Multiplies a 16-element array by a 4-element array as a matrix and a vector respectively.
|
Public Attributes |
| r32 | x |
| | The x-coordinate.
|
| r32 | y |
| | The y-coordinate.
|
| r32 | z |
| | The z-coordinate.
|
Static Public Attributes |
| static const pgVec | ZERO |
| | The zero vector.
|
| static const pgVec | X_UNIT |
| | The orthonormal x-axis.
|
| static const pgVec | Y_UNIT |
| | The orthonormal y-axis.
|
| static const pgVec | Z_UNIT |
| | The orthonormal z-axis.
|
Friends |
| PG_API friend pgVec | operator* (r32 s, const pgVec &vec) |
| | Returns a pgVec which is the right hand side pgVec multiplied with the left hand side scalar.
|
A 3-element vector which is represented by xyz coordinates.