Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Public Attributes | Static Public Attributes
core::vector3d Class Reference

3d vector class with lots of operators and methods. More...

#include <Vector3d.h>

List of all members.

Public Member Functions

vector3d crossProduct (const vector3d &p) const
f32 dotProduct (const vector3d &other) const
 Returns the dot product with another vector.
const f32get () const
f32get ()
f32 getDistanceFrom (const vector3d &other) const
f32 getDistanceFromSQ (const vector3d &other) const
f32 getLength () const
 Returns length of the vector.
f32 getLengthSQ () const
void invert ()
 Inverts the vector.
bool isBetweenPoints (const vector3d &begin, const vector3d &end) const
vector3dnormalize ()
 Normalizes the vector.
bool operator!= (const vector3d &other) const
vector3d operator* (const vector3d &other) const
vector3d operator* (const f32 v) const
vector3doperator*= (const vector3d &other)
vector3doperator*= (const f32 v)
vector3d operator+ (const vector3d &other) const
vector3doperator+= (const vector3d &other)
vector3d operator- (const vector3d &other) const
vector3d operator- () const
vector3doperator-= (const vector3d &other)
vector3d operator/ (const f32 v) const
vector3d operator/ (const vector3d &other) const
vector3doperator/= (const f32 v)
vector3doperator/= (const vector3d &other)
vector3doperator= (const vector3d &other)
bool operator== (const vector3d &other) const
void set (const f32 nx, const f32 ny, const f32 nz)
void set (const vector3d &other)
void setLength (f32 newLength)
 Sets the length of the vector to a new value.
 vector3d (f32 nx, f32 ny, f32 nz)
 vector3d (const vector3d &other)
 vector3d ()

Public Attributes

f32 X
f32 Y
f32 Z

Static Public Attributes

static const vector3d NEGATIVE_UNIT_X = vector3d(-1.0f, 0.0f, 0.0f)
 NEGATIVE_UNIT_X is a const vector3d that defines the 3d unit vector for the negative x-axis.
static const vector3d NEGATIVE_UNIT_Y = vector3d(0.0f, -1.0f, 0.0f)
 NEGATIVE_UNIT_Y is a const vector3d that defines the 3d unit vector for the negative y-axis.
static const vector3d NEGATIVE_UNIT_Z = vector3d(0.0f, 0.0f, -1.0f)
 NEGATIVE_UNIT_Z is a const vector3d that defines the 3d unit vector for the negative z-axis.
static const vector3d ORIGIN_3D = vector3d(0.0f, 0.0f, 0.0f)
 ORIGIN_3D is a const vector3d that defines the 3d origin vector for the 3d space.
static const vector3d UNIT_SCALE = vector3d(1.0f, 1.0f, 1.0f)
static const vector3d UNIT_X = vector3d(1.0f, 0.0f, 0.0f)
 UNIT_X is a const vector3d that defines the 3d unit vector for the x-axis.
static const vector3d UNIT_Y = vector3d(0.0f, 1.0f, 0.0f)
 UNIT_Y is a const vector3d that defines the 3d unit vector for the y-axis.
static const vector3d UNIT_Z = vector3d(0.0f, 0.0f, 1.0f)
 UNIT_Z is a const vector3d that defines the 3d unit vector for the z-axis.

Detailed Description

3d vector class with lots of operators and methods.


Constructor & Destructor Documentation

core::vector3d::vector3d ( )
core::vector3d::vector3d ( f32  nx,
f32  ny,
f32  nz 
)
core::vector3d::vector3d ( const vector3d other)

Member Function Documentation

vector3d core::vector3d::crossProduct ( const vector3d p) const

Calculates the cross product with another vector

Parameters:
p,:vector to multiply with.
Returns:
Crossproduct of this vector with p.

References vector3d(), X, Y, and Z.

Referenced by core::matrix4::buildViewMatrix(), core::plane3d::getIntersectionWithPlane(), core::quaternion::operator*(), and render::Camera::setDirection().

f32 core::vector3d::dotProduct ( const vector3d other) const
const f32 * core::vector3d::get ( ) const

References X.

f32 * core::vector3d::get ( )

References X.

Referenced by render::Shader::setParamerter().

f32 core::vector3d::getDistanceFrom ( const vector3d other) const

Returns distance from an other point. Here, the vector is interpreted as point in 3 dimensional space.

References core::sqrt(), X, Y, and Z.

Referenced by core::line3d::getLength().

f32 core::vector3d::getDistanceFromSQ ( const vector3d other) const

Returns squared distance from an other point. Here, the vector is interpreted as point in 3 dimensional space.

References X, Y, and Z.

Referenced by core::line3d::getLengthSQ(), and isBetweenPoints().

f32 core::vector3d::getLength ( ) const
f32 core::vector3d::getLengthSQ ( ) const

Returns squared length of the vector. This is useful because it is much faster then getLength().

References X, Y, and Z.

Referenced by isBetweenPoints().

void core::vector3d::invert ( )

Inverts the vector.

References X, Y, and Z.

bool core::vector3d::isBetweenPoints ( const vector3d begin,
const vector3d end 
) const

Returns if this vector interpreted as a point is on a line between two other points. It is assumed that the point is on the line.

Parameters:
begin,:Beginning vector to compare between.
end,:Ending vector to compare between.
Returns:
true if this vector is between begin and end. false if not.

References getDistanceFromSQ(), and getLengthSQ().

Referenced by core::line3d::isPointBetweenStartAndEnd().

vector3d & core::vector3d::normalize ( )
bool core::vector3d::operator!= ( const vector3d other) const

References core::EPSILON, X, Y, and Z.

vector3d core::vector3d::operator* ( const vector3d other) const

References vector3d(), X, Y, and Z.

vector3d core::vector3d::operator* ( const f32  v) const

References vector3d(), X, Y, and Z.

vector3d & core::vector3d::operator*= ( const vector3d other)

References X, Y, and Z.

vector3d & core::vector3d::operator*= ( const f32  v)

References X, Y, and Z.

vector3d core::vector3d::operator+ ( const vector3d other) const

References vector3d(), X, Y, and Z.

vector3d & core::vector3d::operator+= ( const vector3d other)

References X, Y, and Z.

vector3d core::vector3d::operator- ( const vector3d other) const

References vector3d(), X, Y, and Z.

vector3d core::vector3d::operator- ( ) const

References vector3d(), X, Y, and Z.

vector3d & core::vector3d::operator-= ( const vector3d other)

References X, Y, and Z.

vector3d core::vector3d::operator/ ( const f32  v) const

References vector3d(), X, Y, and Z.

vector3d core::vector3d::operator/ ( const vector3d other) const

References vector3d(), X, Y, and Z.

vector3d & core::vector3d::operator/= ( const f32  v)

References X, Y, and Z.

vector3d & core::vector3d::operator/= ( const vector3d other)

References X, Y, and Z.

vector3d & core::vector3d::operator= ( const vector3d other)

References X, Y, and Z.

bool core::vector3d::operator== ( const vector3d other) const

References core::EPSILON, X, Y, and Z.

void core::vector3d::set ( const vector3d other)

References X, Y, and Z.

void core::vector3d::set ( const f32  nx,
const f32  ny,
const f32  nz 
)

References X, Y, and Z.

Referenced by core::aabox3d::getEdges(), core::aabox3d::reset(), and core::line3d::set().

void core::vector3d::setLength ( f32  newLength)

Sets the length of the vector to a new value.

References core::EPSILON, getLength(), X, Y, and Z.


Member Data Documentation

const vector3d core::vector3d::NEGATIVE_UNIT_X = vector3d(-1.0f, 0.0f, 0.0f) [static]

NEGATIVE_UNIT_X is a const vector3d that defines the 3d unit vector for the negative x-axis.

const vector3d core::vector3d::NEGATIVE_UNIT_Y = vector3d(0.0f, -1.0f, 0.0f) [static]

NEGATIVE_UNIT_Y is a const vector3d that defines the 3d unit vector for the negative y-axis.

Referenced by physics::Joint::initProperties().

const vector3d core::vector3d::NEGATIVE_UNIT_Z = vector3d(0.0f, 0.0f, -1.0f) [static]
const vector3d core::vector3d::ORIGIN_3D = vector3d(0.0f, 0.0f, 0.0f) [static]
const vector3d core::vector3d::UNIT_SCALE = vector3d(1.0f, 1.0f, 1.0f) [static]
const vector3d core::vector3d::UNIT_X = vector3d(1.0f, 0.0f, 0.0f) [static]
const vector3d core::vector3d::UNIT_Y = vector3d(0.0f, 1.0f, 0.0f) [static]
const vector3d core::vector3d::UNIT_Z = vector3d(0.0f, 0.0f, 1.0f) [static]

UNIT_Z is a const vector3d that defines the 3d unit vector for the z-axis.

Referenced by scene::Node::rotateZ(), render::Camera::rotateZ(), and render::Camera::setDirection().


The documentation for this class was generated from the following files:

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by Doxygen (1.7.4)