#include <Vec3f.h>
Public Member Functions | |
Vec3f () | |
Vec3f (float x, float y, float z) | |
Vec3f (float f) | |
void | setX (float newx) |
float | x () const |
void | setY (float newy) |
float | y () const |
void | z (float newz) |
float | z () const |
float | operator[] (int i) const |
Vec3f & | operator= (const Vec3f &b) |
int | maxDim () const |
void | setMin (const Vec3f &other) |
void | setMax (const Vec3f &other) |
float | dot (const Vec3f &b) const |
Vec3f | cross (const Vec3f &b) const |
Vec3f | fabs () const |
float | length () const |
Vec3f | normal () const |
void | normalize () |
Vec3f | operator- () const |
void | operator *= (float f) |
void | scale (const Vec3f &w) |
Vec3f | scaled (const Vec3f &w) const |
void | operator/= (float f) |
Vec3f | operator+ (const Vec3f &b) const |
Vec3f & | operator+= (const Vec3f &b) |
Vec3f | operator- (const Vec3f &b) const |
Vec3f & | operator-= (const Vec3f &b) |
Vec3f | reciprocal () |
bool | operator== (const Vec3f &v) const |
bool | operator!= (const Vec3f &v) const |
Private Attributes | |
float | mValues [3] |
Friends | |
Vec3f | min (const Vec3f &a, const Vec3f &b) |
Vec3f | max (const Vec3f &a, const Vec3f &b) |
Vec3f | operator * (const Vec3f &w, float f) |
Vec3f | operator * (float f, const Vec3f &w) |
Vec3f | operator/ (const Vec3f &w, float f) |
std::ostream & | operator<< (std::ostream &o, const Vec3f &w) |
std::istream & | operator>> (std::istream &i, Vec3f &w) |
Definition at line 18 of file Vec3f.h.
Vec3f::Vec3f | ( | ) | [inline] |
Definition at line 30 of file Vec3f.h.
References mValues.
Referenced by cross(), fabs(), operator+(), operator-(), reciprocal(), and scaled().
Vec3f::Vec3f | ( | float | x, | |
float | y, | |||
float | z | |||
) | [inline] |
void Vec3f::setX | ( | float | newx | ) | [inline] |
set the x coordinate
Definition at line 50 of file Vec3f.h.
References mValues.
Referenced by Sphere::axes().
float Vec3f::x | ( | ) | const [inline] |
get the x coordinate
Definition at line 56 of file Vec3f.h.
References mValues.
Referenced by Sphere::axes(), BilliardPhysics::BilliardPhysics(), BorderCollision::collide(), Sphere::intersect(), Box::intersect(), lerp(), Matrix::Matrix(), RGBAColor::RGBAColor(), WoodShader::shade(), Box::split(), and BilliardPhysics::willHitBorder().
void Vec3f::setY | ( | float | newy | ) | [inline] |
float Vec3f::y | ( | ) | const [inline] |
get the y coordinate
Definition at line 68 of file Vec3f.h.
References mValues.
Referenced by Sphere::axes(), Sphere::intersect(), Box::intersect(), lerp(), Matrix::Matrix(), RGBAColor::RGBAColor(), WoodShader::shade(), and Box::split().
void Vec3f::z | ( | float | newz | ) | [inline] |
set the z coordinate
Definition at line 74 of file Vec3f.h.
References mValues.
Referenced by Sphere::axes(), BilliardPhysics::BilliardPhysics(), BorderCollision::collide(), Sphere::intersect(), Box::intersect(), lerp(), Matrix::Matrix(), RGBAColor::RGBAColor(), WoodShader::shade(), Box::split(), and BilliardPhysics::willHitBorder().
float Vec3f::z | ( | ) | const [inline] |
float Vec3f::operator[] | ( | int | i | ) | const [inline] |
int Vec3f::maxDim | ( | ) | const [inline] |
void Vec3f::setMin | ( | const Vec3f & | other | ) | [inline] |
void Vec3f::setMax | ( | const Vec3f & | other | ) | [inline] |
float Vec3f::dot | ( | const Vec3f & | b | ) | const [inline] |
dot product
Definition at line 125 of file Vec3f.h.
References mValues.
Referenced by BorderCollision::collide(), BallCollision::collide(), CookTorranceShader::distribution(), CameraInstructionMove::execute(), CookTorranceShader::fresnel(), CookTorranceShader::geometry(), QuadAreaLight::illuminate(), Triangle::intersect(), Sphere::intersect(), InfinitePlane::intersect(), RefractiveShader::shade(), PhongShader::shade(), MirrorShader::shade(), CookTorranceShader::shade(), PhysicalObject::updateProperties(), and BilliardPhysics::willCollide().
vector product
Definition at line 131 of file Vec3f.h.
References mValues, and Vec3f().
Referenced by Sphere::axes(), BallCollision::collide(), DepthOfFieldCamera::DepthOfFieldCamera(), CameraInstructionMove::execute(), Triangle::intersect(), Triangle::normal(), PerspectiveCamera::PerspectiveCamera(), QuadAreaLight::QuadAreaLight(), PerspectiveCamera::setDir(), DepthOfFieldCamera::setDir(), PerspectiveCamera::setUp(), DepthOfFieldCamera::setUp(), and PhysicalObject::updateProperties().
Vec3f Vec3f::fabs | ( | ) | const [inline] |
absolute value of the vector
Definition at line 139 of file Vec3f.h.
References mValues, and Vec3f().
Referenced by operator==(), DebugShader::shade(), and TableBorder::TableBorder().
float Vec3f::length | ( | ) | const [inline] |
the length of the vector
Definition at line 145 of file Vec3f.h.
Referenced by BorderCollision::collide(), BallCollision::collide(), QuadAreaLight::illuminate(), PointLight::illuminate(), normal(), normalize(), operator *(), QuadAreaLight::QuadAreaLight(), PhysicalObject::rotate(), PhysicalObject::updateProperties(), and BilliardPhysics::willCollide().
Vec3f Vec3f::normal | ( | ) | const [inline] |
Definition at line 151 of file Vec3f.h.
References EPSILON, and length().
Referenced by Triangle::axes(), Sphere::axes(), BallCollision::collide(), DepthOfFieldCamera::DepthOfFieldCamera(), CameraInstructionMove::execute(), Ray::init(), Matrix::Matrix(), Triangle::normal(), Sphere::normal(), Shader::normal(), PerspectiveCamera::PerspectiveCamera(), PhysicalObject::rotate(), PerspectiveCamera::setDir(), DepthOfFieldCamera::setDir(), PerspectiveCamera::setUp(), DepthOfFieldCamera::setUp(), and PhysicalObject::updateProperties().
void Vec3f::normalize | ( | ) | [inline] |
normalize this vector
Definition at line 158 of file Vec3f.h.
References EPSILON, and length().
Referenced by BallCollision::collide(), DepthOfFieldCamera::DepthOfFieldCamera(), QuadAreaLight::illuminate(), PointLight::illuminate(), DepthOfFieldCamera::initRay(), PerspectiveCamera::PerspectiveCamera(), QuadAreaLight::QuadAreaLight(), PerspectiveCamera::setDir(), DepthOfFieldCamera::setDir(), TexturedSmoothTriangle::setNormals(), PerspectiveCamera::setUp(), DepthOfFieldCamera::setUp(), and TexturedSmoothTriangle::TexturedSmoothTriangle().
Vec3f Vec3f::operator- | ( | ) | const [inline] |
void Vec3f::operator *= | ( | float | f | ) | [inline] |
void Vec3f::scale | ( | const Vec3f & | w | ) | [inline] |
Definition at line 187 of file Vec3f.h.
References mValues, and Vec3f().
Referenced by CookTorranceShader::shade(), and PhysicalObject::updateProperties().
void Vec3f::operator/= | ( | float | f | ) | [inline] |
Vec3f Vec3f::reciprocal | ( | ) | [inline] |
bool Vec3f::operator== | ( | const Vec3f & | v | ) | const [inline] |
bool Vec3f::operator!= | ( | const Vec3f & | v | ) | const [inline] |
std::ostream& operator<< | ( | std::ostream & | o, | |
const Vec3f & | w | |||
) | [friend] |
std::istream& operator>> | ( | std::istream & | i, | |
Vec3f & | w | |||
) | [friend] |
float Vec3f::mValues[3] [private] |
Definition at line 254 of file Vec3f.h.
Referenced by cross(), dot(), fabs(), max(), maxDim(), min(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator<<(), operator=(), operator==(), operator[](), reciprocal(), scale(), scaled(), setMax(), setMin(), setX(), setY(), Vec3f(), x(), y(), and z().