Public Member Functions | |
float & | operator[] (int i) |
const float & | operator[] (int i) const |
const float * | array () const |
Vector4 () | |
Vector4 (const float v[4]) | |
Vector4 (const double v[4]) | |
Vector4 (float a, float b, float c=0, float d=1) | |
void | set (float a, float b, float c=0, float d=1) |
Vector4 (const Vector3 &v, float d=1) | |
void | set (const Vector3 &v, float d=1) |
Vector3 | divide_w () const |
Vector3 | truncate_w () const |
Vector4 | operator* (float d) const |
Vector4 & | operator*= (float d) |
Vector4 | operator/ (float d) const |
Vector4 & | operator/= (float d) |
Vector4 | operator* (const Vector4 &v) const |
Vector4 & | operator*= (const Vector4 &v) |
Vector4 | operator/ (const Vector4 &v) const |
Vector4 & | operator/= (const Vector4 &v) |
Vector4 | operator+ (const Vector4 &v) const |
Vector4 & | operator+= (const Vector4 &v) |
Vector4 | operator- () const |
Vector4 | operator- (const Vector4 &v) const |
Vector4 & | operator-= (const Vector4 &v) |
bool | operator== (const Vector4 &v) const |
bool | operator!= (const Vector4 &v) const |
bool | operator== (float d) const |
bool | operator!= (float d) const |
bool | operator< (const Vector4 &v) const |
Fairly arbitrary operator so you can store these in ordered arrays. | |
void | append (Hash &) const |
Public Attributes | |
float | x |
float | y |
float | z |
float | w |
Friends | |
std::ostream & | operator<< (std::ostream &o, const Vector4 &) |
This object is NOT compatible with the SbVec4 template in the Inventor library. Several of the operators ignore the w and treat this as a Vector3. This was done as it made use of this in the 3D system much easier.
DD::Image::Vector4::Vector4 | ( | ) | [inline] |
The default constructor leaves garbage in x,y,z,w!
DD::Image::Vector4::Vector4 | ( | const float | v[4] | ) | [inline] |
Constructor from an array of numbers.
DD::Image::Vector4::Vector4 | ( | const double | v[4] | ) | [inline] |
Constructor from an array of numbers.
DD::Image::Vector4::Vector4 | ( | float | a, | |
float | b, | |||
float | c = 0 , |
|||
float | d = 1 | |||
) | [inline] |
Constructor that sets all 4 numbers
float& DD::Image::Vector4::operator[] | ( | int | i | ) | [inline] |
vector[0] is x, vector[1] is y, vector[2] is z, vector[3] is w.
const float& DD::Image::Vector4::operator[] | ( | int | i | ) | const [inline] |
vector[0] is x, vector[1] is y, vector[2] is z, vector[3] is w.
const float* DD::Image::Vector4::array | ( | ) | const [inline] |
Returns a ponter that can be passed to OpenGL
Referenced by DD::Image::ParticlesSprite::draw_quad(), DD::Image::Iop::shade_GL(), DD::Image::LightOp::shade_GL(), and DD::Image::ComplexLightOp::shade_GL().
void DD::Image::Vector4::set | ( | float | a, | |
float | b, | |||
float | c = 0 , |
|||
float | d = 1 | |||
) | [inline] |
Vector3 DD::Image::Vector4::divide_w | ( | ) | const [inline] |
Divides xyz by w and returns that
Vector3 DD::Image::Vector4::truncate_w | ( | ) | const [inline] |
Just ignores the w. This is correct for a distance where w==0.
Vector4 DD::Image::Vector4::operator* | ( | float | d | ) | const [inline] |
Multiplies all 4 numbers. This will multiply a distance. However if w is non-zero, the resulting 3D point will not move, because x/w will not change.
Vector4 DD::Image::Vector4::operator/ | ( | float | d | ) | const [inline] |
Divides all 4 numbers.
Vector4 DD::Image::Vector4::operator- | ( | ) | const [inline] |
Component-wise subtraction.
void Vector4::append | ( | Hash & | hash | ) | const |
Add this to the Hash object.
References DD::Image::Hash::append().
std::ostream& operator<< | ( | std::ostream & | o, | |
const Vector4 & | ||||
) | [friend] |
Writes it in nuke/tcl notation, with nested curly braces
©2009 The Foundry Visionmongers, Ltd. All Rights Reserved. |