Public Member Functions | |
float & | operator[] (int i) |
const float & | operator[] (int i) const |
const float * | array () const |
Vector3 (const float v[3]) | |
Vector3 (const double v[3]) | |
Vector3 (float a, float b, float c) | |
void | set (float a, float b, float c) |
Vector3 | operator* (float d) const |
Vector3 & | operator*= (float d) |
Vector3 | operator* (double d) const |
Vector3 & | operator*= (double d) |
Vector3 | operator/ (float d) const |
Vector3 & | operator/= (float d) |
Vector3 | operator* (const Vector3 &v) const |
Vector3 & | operator*= (const Vector3 &v) |
Vector3 | operator/ (const Vector3 &v) const |
Vector3 & | operator/= (const Vector3 &v) |
Vector3 | operator+ (const Vector3 &v) const |
Vector3 & | operator+= (const Vector3 &v) |
Vector3 | operator- (const Vector3 &v) const |
Vector3 & | operator-= (const Vector3 &v) |
Vector3 | operator- () const |
bool | operator== (const Vector3 &v) const |
bool | operator!= (const Vector3 &v) const |
bool | operator== (float d) const |
bool | operator!= (float d) const |
bool | operator< (const Vector3 &v) const |
Fairly arbitrary operator so you can store these in ordered arrays. | |
float | length () const |
float | lengthSquared () const |
Same as this dot this, length() squared. | |
float | distanceBetween (const Vector3 &v) const |
float | distanceSquared (const Vector3 &v) const |
float | dot (const Vector3 &v) const |
Vector3 | cross (const Vector3 &v) const |
float | normalize () |
float | fast_normalize () |
void | negate () |
float | distanceFromPlane (float A, float B, float C, float D) const |
Vector3 | reflect (const Vector3 &N) |
Vector3 | minimum (const Vector3 &a) const |
Vector3 | maximum (const Vector3 &a) const |
void | append (Hash &) const |
Public Attributes | |
float | x |
float | y |
float | z |
Friends | |
std::ostream & | operator<< (std::ostream &o, const Vector3 &) |
3-component vector, used to represent a point or distance in 3D space.
This object is in general compatible with the SbVec3 template in the Inventor library. However it allows direct access to the x,y,z members, which imho makes math using this much easier to read.
|
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.
|
inline |
vector[0] is x, vector[1] is y, vector[2] is z.
|
inline |
Returns a ponter that can be passed to OpenGL
Referenced by DD::Image::Primitive::draw_normal(), DD::Image::Triangle::draw_solid_face(), DD::Image::Primitive::draw_solid_face(), DD::Image::Primitive::draw_solid_vertex(), and DD::Image::Primitive::draw_wireframe_vertex().
|
inline |
Change all of xyz.
Referenced by DD::Image::Material::engine(), DD::Image::Scene::Scene(), and DD::Image::Mesh::validate().
|
inline |
Multiplies all 3 numbers. This will scale the length().
|
inline |
Divides all 3 numbers. This will scale the length().
Component-wise multiplication, useful for colors.
Component-wise division, useful for colors.
|
inline |
Also known as the absolute value or magnitude of the vector.
Referenced by DD::Image::Matrix4::extractAndRemoveScalingAndShear(), DD::Image::Random::randomUnitVector(), DD::Image::Random::randomUnitVectorXY(), and DD::Image::Random::randomVector().
|
inline |
Same as (this-v).length()
|
inline |
Same as (this-v).lengthSquared()
|
inline |
Dot product. Twice the area of the triangle between the vectors.
Referenced by DD::Image::Plane::distance(), DD::Image::Matrix4::extractAndRemoveScalingAndShear(), DD::Image::ComplexLightOp::get_color(), DD::Image::LightOp::get_shadowing(), and DD::Image::Plane::Plane().
Cross product. This is a vector at right angles to the vectors with a length equal to the product of the lengths.
Referenced by DD::Image::Plane::Plane().
|
inline |
Change the vector to be unit length. Returns the original length.
Referenced by DD::Image::Mesh::get_face_normal(), DD::Image::ComplexLightOp::get_L_vector(), DD::Image::LightOp::get_L_vector(), DD::Image::LightOp::get_shadowing(), DD::Image::Plane::Plane(), DD::Image::Triangle::validate(), and DD::Image::Mesh::vertex_normal().
|
inline |
Uwe Behrens' fast-normalize method. Approximate normalization, returns approximate length.
Referenced by DD::Image::Primitive::draw_normal(), DD::Image::ComplexLightOp::get_L_vector(), DD::Image::LightOp::get_L_vector(), and DD::Image::Mesh::validate().
|
inline |
Modifies it in-place, does not return the new value.
|
friend |
Writes it in nuke/tcl notation, with nested curly braces
©2020 The Foundry Visionmongers, Ltd. All Rights Reserved. |