#include <Vector4.h>
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 &) |
4-component vector. This is used to represent a point in 3D homogenous (perspective) space, and is also useful to represent an rgb color with alpha.
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.
|
inline |
Default Constructor.
|
inline |
Constructor from an array of numbers.
|
inline |
Constructor from an array of numbers.
|
inline |
Constructor that sets all 4 numbers
|
inline |
vector[0] is x, vector[1] is y, vector[2] is z, vector[3] is w.
|
inline |
vector[0] is x, vector[1] is y, vector[2] is z, vector[3] is w.
|
inline |
Returns a ponter that can be passed to OpenGL
Referenced by DD::Image::ParticlesSprite::draw_quad(), DD::Image::Primitive::draw_solid_vertex(), DD::Image::LightOp::shade_GL(), and DD::Image::ComplexLightOp::shade_GL().
|
inline |
Change all of xyzw.
Referenced by DD::Image::Mesh::create_point_uvs(), DD::Image::LightOp::shade_GL(), DD::Image::ComplexLightOp::shade_GL(), and DD::Image::ParticlesSprite::tessellateSprite().
|
inline |
Divides xyz by w and returns that
Referenced by DD::Image::CameraOp::draw_handle().
|
inline |
Just ignores the w. This is correct for a distance where w==0.
|
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.
|
inline |
Divides all 4 numbers.
Component-wise multiplication, useful for colors.
Component-wise division, useful for colors.
|
inline |
Component-wise subtraction.
|
friend |
Writes it in nuke/tcl notation, with nested curly braces
©2024 The Foundry Visionmongers, Ltd. All Rights Reserved. |