Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Vector3d Class Reference

#include <vector3d.h>

List of all members.

Public Methods

 Vector3d (double _x, double _y, double _z)
 Vector3d ()
Vector3d operator= (const Vector3d &v)
Vector3d operator-= (const Vector3d &v)
Vector3d operator+= (const Vector3d &v)
Vector3d operator *= (const Vector3d &v)
Vector3d operator/= (const Vector3d &v)
Vector3d operator *= (double)
Vector3d operator/= (double)
Vector3d operator= (const Quaternion &q)
Vector3d rotate (const Vector3d &v, double ang)
 Rotate in any given axis.

double module (void)
double distToPlane (const Point3d &p, const Vector3d &n)
 Distance to a given plane.

double distToLine (const Point3d &p, const Vector3d &d)
 Distance to a given line.

Vector3d normalized (void)
 Returns the current vector, normalized.

void normalize (void)
 Normalize current vector.

string toString (void)
 Converts the Vector3d to a string.

Get components
double X ()
double Y ()
double Z ()

Protected Attributes

double x
double y
double z

Friends

class BoundingBox
bool operator== (const Vector3d &a, const Vector3d &b)
Vector3d operator^ (const Vector3d &a, const Vector3d &b)
double operator * (const Vector3d &a, const Vector3d &b)
Vector3d operator- (const Vector3d &a, const Vector3d &b)
Vector3d operator+ (const Vector3d &a, const Vector3d &b)
Vector3d operator/ (const Vector3d &a, double n)
Vector3d operator * (const Vector3d &a, double n)
Vector3d operator/ (double n, const Vector3d &a)
Vector3d operator * (double n, const Vector3d &a)
Vector3d operator- (const Vector3d &v)
Vector3d operator * (const Matrix3x3 &M, const Vector3d &v)
Vector3d operator * (const Vector3d &v, const Matrix3x3 &M)
Quaternion operator * (const Vector3d &v, const Quaternion &q)
Quaternion operator * (const Quaternion &q, const Vector3d &v)


Detailed Description

A Vector in a 3d coordinate system, with the product and dividion with doubles, product, sum, difference of vectors, assignation to string, and conversion to polar systems.

Point3d is an alias of Vector3d.

Definition at line 42 of file vector3d.h.


Constructor & Destructor Documentation

Vector3d::Vector3d double    _x,
double    _y,
double    _z
[inline]
 

Definition at line 35 of file vector3d.cc.

References x, y, and z.

Vector3d::Vector3d   [inline]
 

A convenience contructor, content is unknown

Definition at line 49 of file vector3d.h.

Referenced by normalized(), and rotate().


Member Function Documentation

double Vector3d::distToLine const Point3d &    p,
const Vector3d &    d
[inline]
 

Distance to a given line.

Definition at line 143 of file vector3d.cc.

References module(), and Point3d.

double Vector3d::distToPlane const Point3d &    p,
const Vector3d &    n
[inline]
 

Distance to a given plane.

Definition at line 135 of file vector3d.cc.

References normalize(), and Point3d.

double Vector3d::module void    [inline]
 

Definition at line 79 of file vector3d.cc.

References x, y, and z.

Referenced by distToLine(), Cylinder::newCycle(), normalize(), normalized(), and Collision::resolveGroundCollision().

void Vector3d::normalize void    [inline]
 

Normalize current vector.

Definition at line 88 of file vector3d.cc.

References module(), x, y, and z.

Referenced by Cylinder::applyVelocity(), Cylinder::Cylinder(), distToPlane(), Collision::resolveGroundCollision(), rotate(), and Cylinder::undoVelocity().

Vector3d Vector3d::normalized void    [inline]
 

Returns the current vector, normalized.

Definition at line 83 of file vector3d.cc.

References module(), Vector3d(), x, y, and z.

Referenced by Quaternion::Quaternion().

Vector3d Vector3d::operator *= double    [inline]
 

Definition at line 67 of file vector3d.cc.

References x, y, and z.

Vector3d Vector3d::operator *= const Vector3d &    v
 

Vector3d Vector3d::operator+= const Vector3d &    v [inline]
 

Definition at line 57 of file vector3d.cc.

References x, y, and z.

Vector3d Vector3d::operator-= const Vector3d &    v [inline]
 

Definition at line 62 of file vector3d.cc.

References x, y, and z.

Vector3d Vector3d::operator/= double    [inline]
 

Definition at line 72 of file vector3d.cc.

References x, y, and z.

Vector3d Vector3d::operator/= const Vector3d &    v
 

Vector3d Vector3d::operator= const Quaternion   q [inline]
 

Definition at line 195 of file vector3d.cc.

References Quaternion::getAxis().

Vector3d Vector3d::operator= const Vector3d &    v [inline]
 

Definition at line 52 of file vector3d.cc.

References x, y, and z.

Vector3d Vector3d::rotate const Vector3d &    v,
double    ang
[inline]
 

Rotate in any given axis.

Rotates current vector over a given axis, a given ammount. The formula used is a solved version of quaternion rotations.

Definition at line 99 of file vector3d.cc.

References cos(), normalize(), sin(), Vector3d(), x, y, and z.

string Vector3d::toString void    [inline]
 

Converts the Vector3d to a string.

Definition at line 41 of file vector3d.cc.

References x, y, and z.

Referenced by Collision::resolveGroundCollision(), GraphicClient::Run(), and BoundingBox::toString().

double Vector3d::X   [inline]
 

Definition at line 123 of file vector3d.cc.

References x.

Referenced by Cylinder::Cylinder(), Cylinder::newCycle(), Quaternion::operator=(), Quaternion::Quaternion(), and Collision::resolveGroundCollision().

double Vector3d::Y   [inline]
 

Definition at line 127 of file vector3d.cc.

References y.

Referenced by Cylinder::Cylinder(), Cylinder::newCycle(), Quaternion::operator=(), Quaternion::Quaternion(), and Collision::resolveGroundCollision().

double Vector3d::Z   [inline]
 

Definition at line 131 of file vector3d.cc.

References z.

Referenced by Cylinder::checkGroundCollision(), Cylinder::newCycle(), Quaternion::operator=(), Quaternion::Quaternion(), and Collision::resolveGroundCollision().


Friends And Related Function Documentation

friend class BoundingBox [friend]
 

Definition at line 85 of file vector3d.h.

Quaternion operator * const Quaternion   q,
const Vector3d &    v
[friend]
 

Definition at line 117 of file quaternion.cc.

Quaternion operator * const Vector3d &    v,
const Quaternion   q
[friend]
 

Definition at line 124 of file quaternion.cc.

Vector3d operator * const Vector3d &    v,
const Matrix3x3   M
[friend]
 

Definition at line 137 of file matrix3x3.cc.

Vector3d operator * const Matrix3x3   M,
const Vector3d &    v
[friend]
 

Definition at line 131 of file matrix3x3.cc.

Vector3d operator * double    n,
const Vector3d &    a
[friend]
 

Definition at line 186 of file vector3d.cc.

Vector3d operator * const Vector3d &    a,
double    n
[friend]
 

Definition at line 179 of file vector3d.cc.

double operator * const Vector3d &    a,
const Vector3d &    b
[friend]
 

Definition at line 157 of file vector3d.cc.

Vector3d operator+ const Vector3d &    a,
const Vector3d &    b
[friend]
 

Definition at line 167 of file vector3d.cc.

Vector3d operator- const Vector3d &    v [friend]
 

Definition at line 175 of file vector3d.cc.

Vector3d operator- const Vector3d &    a,
const Vector3d &    b
[friend]
 

Definition at line 171 of file vector3d.cc.

Vector3d operator/ double    n,
const Vector3d &    a
[friend]
 

Definition at line 190 of file vector3d.cc.

Vector3d operator/ const Vector3d &    a,
double    n
[friend]
 

Definition at line 183 of file vector3d.cc.

bool operator== const Vector3d &    a,
const Vector3d &    b
[friend]
 

Definition at line 152 of file vector3d.cc.

Vector3d operator^ const Vector3d &    a,
const Vector3d &    b
[friend]
 

Definition at line 161 of file vector3d.cc.


Member Data Documentation

double Vector3d::x [protected]
 

The coordinate of the vector (or point)

Definition at line 45 of file vector3d.h.

Referenced by BoundingBox::contains(), module(), normalize(), normalized(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), operator^(), rotate(), toString(), Vector3d(), and X().

double Vector3d::y [protected]
 

The coordinate of the vector (or point)

Definition at line 45 of file vector3d.h.

Referenced by BoundingBox::contains(), module(), normalize(), normalized(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), operator^(), rotate(), toString(), Vector3d(), and Y().

double Vector3d::z [protected]
 

The coordinate of the vector (or point)

Definition at line 45 of file vector3d.h.

Referenced by BoundingBox::contains(), module(), normalize(), normalized(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), operator^(), rotate(), toString(), Vector3d(), and Z().


The documentation for this class was generated from the following files:
Generated on Mon Jun 17 19:54:19 2002 for Svas Server by doxygen1.2.16