Public Member Functions | |
| __construct ($x=0.0, $y=0.0, $z=0.0, $w=0.0) | |
| set ($x, $y, $z, $w) | |
| setArray ($a) | |
| get ($index) | |
| getArray () | |
| x () | |
| y () | |
| z () | |
| w () | |
| length () | |
| add (Vector4 $v) | |
| sub (Vector4 $v) | |
| mult (Vector4 $v) | |
| cross (Vector4 $v) | |
| multScalar ($s) | |
| normalize () | |
| __toString () | |
Protected Attributes | |
| $x | |
| $y | |
| $z | |
| $w | |
| Vector4::__construct | ( | $ | x = 0.0, |
|
| $ | y = 0.0, |
|||
| $ | z = 0.0, |
|||
| $ | w = 0.0 | |||
| ) |
Default constructor setting the initial values of the vector.
| $x | First coordinate. | |
| $y | Second coordinate. | |
| $z | Third coordinate. | |
| $w | Fourth (homogeneous) coordinate. |
| Vector4::set | ( | $ | x, | |
| $ | y, | |||
| $ | z, | |||
| $ | w | |||
| ) |
Set the values of this vector.
| $x | First coordinate. | |
| $y | Second coordinate. | |
| $z | Third coordinate. | |
| $w | Fourth (homogeneous) coordinate. |
| Vector4::setArray | ( | $ | a | ) |
Set the values of this vector given by an array.
| $a | Array with three or four elements. |
| Vector4::get | ( | $ | index | ) |
Return a coordinate of the vector.
| $index | Index of the coordinate in interval [0; 3]. |
| Vector4::getArray | ( | ) |
Return all coordinates of the vector.
| Vector4::x | ( | ) |
Return first coordinate of the vector.
| Vector4::y | ( | ) |
Return second coordinate of the vector.
| Vector4::z | ( | ) |
Return third coordinate of the vector.
| Vector4::w | ( | ) |
Return fourth coordinate of the vector.
| Vector4::length | ( | ) |
Length of this vector.
| Vector4::add | ( | Vector4 $ | v | ) |
Sum of this and a second vector.
| $v | Second vector. |
| Vector4::sub | ( | Vector4 $ | v | ) |
Difference of this and a second vector.
| $v | Second vector. |
| Vector4::mult | ( | Vector4 $ | v | ) |
Scalar product of this and a second vector.
| $v | Second vector. |
| Vector4::cross | ( | Vector4 $ | v | ) |
Cross product of this and a second vector. It uses only the first three coordinates.
| $v | Second vector. |
| Vector4::multScalar | ( | $ | s | ) |
Product of this and a scalar.
| $s | Scalar. |
| Vector4::normalize | ( | ) |
Divide this vector by it's length to make it unit length.
| Vector4::__toString | ( | ) |
Return the vector as human-readable string representation.
Vector4::$x [protected] |
First coordinate of the vector.
Vector4::$y [protected] |
Second coordinate of the vector.
Vector4::$z [protected] |
Third coordinate of the vector.
Vector4::$w [protected] |
Fourth coordinate of the vector.
1.5.6