The class Vector4f inherits from the templated class of Vector4, and the template parameters are specified. Each element in the Vector4f object will be a float. More...
#include <vector.h>
Public Member Functions | |
| Vector4f () | |
| Contructs a Vector4f object, all elements initialized to 0. | |
| Vector4f (float x, float y, float z, float w) | |
| Contructs a Vector4f object and sets the floats x, y, z and w to the elements. | |
| Vector4f (const Vector2f &other, float z=0, float w=0) | |
| Contructs a Vector4f object by copying the elements of another existing vector2f object, appending two zeros as the last two elements. | |
| Vector4f (const Vector3f &other, float w=0) | |
| Contructs a Vector4f object by copying the elements of another existing vector3f object, appending a zero as the fourth elements. | |
| Vector4f (const Vector4f &other) | |
| Contructs a Vector4f object by copying the elements of another existing vector4f object. | |
Public Member Functions inherited from cil::Vector4< float, Vector4f > | |
| Vector4 () | |
| Contructs a Vector4 object with 4 elements, all initialized to 0. | |
| void | set (float x, float y, float z, float w) |
| Sets the values of the four elements of current Vector4 object. | |
Public Member Functions inherited from cil::Vector< float, Vector4f > | |
| Vector (int size) | |
| Constructs a Vector object with a specified number of elements. | |
| const float & | operator[] (int index) const |
| Provides read-only access to the element at a specific index(position) within the Vector object. | |
| float & | operator[] (int index) |
| Provides read-write access to the element at a specific index(position) within the Vector object. | |
| const float & | operator[] (char key) const |
| Provides read-only access to a element within the Vector object using a character key. | |
| float & | operator[] (char key) |
| Provides read-write access to a element within the Vector object using a character key. | |
| Vector & | operator+= (const Vector &other) |
| Performs element-wise addition between the current Vector and another vector. | |
| Vector< float, Vector4f > & | operator-= (const Vector &other) |
| Performs element-wise subtraction between the current Vector and another vector. | |
| Vector< float, Vector4f > & | operator*= (float factor) |
| Performs scalar multiplication between the current Vector and a floating-point factor. | |
| Vector< float, Vector4f > & | operator/= (float factor) |
| Performs scalar division between the current Vector and a floating-point factor. | |
| Vector4f | operator+ (const Vector4f &other) const |
| Returns a Vector object that is formed by element-wise addition between the current Vector and another vector. | |
| Vector4f | operator- (const Vector4f &other) const |
| Returns a Vector object that is formed by element-wise subtraction between the current Vector and another vector. | |
| Vector4f | operator- () const |
| Returns a Vector object that is formed by changing the sign of each element of the current vector. | |
| float | operator* (const Vector4f &other) const |
| Returns a Vector object that is formed by element-wise multiplication between the current Vector and another vector. | |
| Vector4f | operator* (float factor) const |
| Returns a Vector object that is formed by multiplying each element of the current vector by the factor. | |
| Vector4f | operator/ (float factor) const |
| Returns a Vector object that is formed by dividing each element of the current vector by the factor. | |
| float | squaredLength () const |
| Returns the squared length of the current Vector. | |
| float | length () const |
| Returns the length of the current Vector. | |
| bool | setLength (float len) |
| Changes the length of the current Vector and returns a boolean value indicating success. | |
| bool | normalize () |
| Normalize the current Vector and returns a boolean value indicating success. | |
Public Member Functions inherited from cil::Tuple< float > | |
| Tuple (int size) | |
| Constructs a Tuple object with a specified number of elements, and initialize all elements to 0. | |
| virtual | ~Tuple () |
| int | size () const |
| Gets the number of elements of the Tuple. | |
| float * | data () |
| Gets the data array of the Tuple. | |
| const float * | data () const |
| Gets the data array of the Tuple, and the data could not be modified upon which this function is called. | |
| void | setData (const float *data) |
| Sets the data array of the Variant. | |
| Tuple< float > & | operator= (const Tuple &other) |
| Copys the data of another Tuple to the one on which the operator is invoked. | |
| bool | operator== (const Tuple &other) const |
| Compares the Tuple with another one, and returns true if they are equal, otherwise returns false. | |
| bool | operator!= (const Tuple &other) const |
| Compares the Tuple with another one, and returns false if they are equal, otherwise returns true. | |
Public Member Functions inherited from cil::Variant | |
| Variant () | |
| virtual | ~Variant () |
| const std::string & | type () const |
Additional Inherited Members | |
Protected Attributes inherited from cil::Tuple< float > | |
| float * | m_data |
| The data array of the Tuple. | |
| int | m_size |
| The number of elements that the data array of the Tuple holds. | |
Protected Attributes inherited from cil::Variant | |
| std::string | m_type |
The class Vector4f inherits from the templated class of Vector4, and the template parameters are specified. Each element in the Vector4f object will be a float.
| cil::Vector4f::Vector4f | ( | ) |
Contructs a Vector4f object, all elements initialized to 0.
| cil::Vector4f::Vector4f | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | w ) |
Contructs a Vector4f object and sets the floats x, y, z and w to the elements.
| cil::Vector4f::Vector4f | ( | const Vector2f & | other, |
| float | z = 0, | ||
| float | w = 0 ) |
Contructs a Vector4f object by copying the elements of another existing vector2f object, appending two zeros as the last two elements.
| cil::Vector4f::Vector4f | ( | const Vector3f & | other, |
| float | w = 0 ) |
Contructs a Vector4f object by copying the elements of another existing vector3f object, appending a zero as the fourth elements.