Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
3d vector class with lots of operators and methods. More...
#include <Vector3d.h>
Public Member Functions | |
vector3d | crossProduct (const vector3d &p) const |
f32 | dotProduct (const vector3d &other) const |
Returns the dot product with another vector. | |
const f32 * | get () const |
f32 * | get () |
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 |
vector3d & | normalize () |
Normalizes the vector. | |
bool | operator!= (const vector3d &other) const |
vector3d | operator* (const vector3d &other) const |
vector3d | operator* (const f32 v) const |
vector3d & | operator*= (const vector3d &other) |
vector3d & | operator*= (const f32 v) |
vector3d | operator+ (const vector3d &other) const |
vector3d & | operator+= (const vector3d &other) |
vector3d | operator- (const vector3d &other) const |
vector3d | operator- () const |
vector3d & | operator-= (const vector3d &other) |
vector3d | operator/ (const f32 v) const |
vector3d | operator/ (const vector3d &other) const |
vector3d & | operator/= (const f32 v) |
vector3d & | operator/= (const vector3d &other) |
vector3d & | operator= (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. |
3d vector class with lots of operators and methods.
core::vector3d::vector3d | ( | ) |
Referenced by crossProduct(), operator*(), operator+(), operator-(), and operator/().
core::vector3d::vector3d | ( | const vector3d & | other | ) |
Calculates the cross product with another vector
p,: | vector to multiply with. |
References vector3d(), X, Y, and Z.
Referenced by core::matrix4::buildViewMatrix(), core::plane3d::getIntersectionWithPlane(), core::quaternion::operator*(), and render::Camera::setDirection().
Returns the dot product with another vector.
Referenced by core::matrix4::buildShadowMatrix(), core::matrix4::buildViewMatrix(), core::line3d::getClosestPoint(), core::plane3d::getDistanceTo(), core::plane3d::getIntersectionWithLine(), core::plane3d::getIntersectionWithPlane(), core::plane3d::isFrontFacing(), core::plane3d::recalculateD(), render::Camera::setDirection(), and core::matrix4::transformPlane().
f32 * core::vector3d::get | ( | ) |
References X.
Referenced by render::Shader::setParamerter().
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().
Returns squared distance from an other point. Here, the vector is interpreted as point in 3 dimensional space.
Referenced by core::line3d::getLengthSQ(), and isBetweenPoints().
f32 core::vector3d::getLength | ( | ) | const |
Returns length of the vector.
References core::sqrt(), X, Y, and Z.
Referenced by core::line3d::getClosestPoint(), core::plane3d::getIntersectionWithPlane(), core::matrix4::getScale(), normalize(), and setLength().
f32 core::vector3d::getLengthSQ | ( | ) | const |
Returns squared length of the vector. This is useful because it is much faster then getLength().
Referenced by isBetweenPoints().
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.
begin,: | Beginning vector to compare between. |
end,: | Ending vector to compare between. |
References getDistanceFromSQ(), and getLengthSQ().
Referenced by core::line3d::isPointBetweenStartAndEnd().
vector3d & core::vector3d::normalize | ( | ) |
Normalizes the vector.
References core::EPSILON, getLength(), X, Y, and Z.
Referenced by core::matrix4::buildShadowMatrix(), core::matrix4::buildViewMatrix(), render::ShaderParamData::getCurrentLightDirectionObjectSpace(), render::ShaderParamData::getCurrentLightDirectionViewSpace(), render::ShaderParamData::getCurrentLightPositionObjectSpace(), render::Camera::setDirection(), and core::plane3d::setPlane().
bool core::vector3d::operator!= | ( | const vector3d & | other | ) | const |
References core::EPSILON, X, Y, and Z.
References vector3d(), X, Y, and Z.
References vector3d(), X, Y, and Z.
References vector3d(), X, Y, and Z.
vector3d core::vector3d::operator- | ( | ) | const |
References vector3d(), X, Y, and Z.
References vector3d(), X, Y, and Z.
bool core::vector3d::operator== | ( | const vector3d & | other | ) | const |
References core::EPSILON, 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.
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] |
NEGATIVE_UNIT_Z is a const vector3d that defines the 3d unit vector for the negative z-axis.
Referenced by scene::Node::getAbsoluteDirection(), scene::Node::getDirection(), render::RenderManager::render(), render::RenderManager::renderSingleRenderable(), and render::Camera::updateView().
const vector3d core::vector3d::ORIGIN_3D = vector3d(0.0f, 0.0f, 0.0f) [static] |
ORIGIN_3D is a const vector3d that defines the 3d origin vector for the 3d space.
Referenced by physics::CollisionPoint::CollisionPoint(), sound::Sound::initProperties(), sound::Listener::initProperties(), scene::Node::initProperties(), physics::Joint::initProperties(), physics::BodyData::initProperties(), physics::Body::initProperties(), render::Camera::setDirection(), render::ShaderParamData::ShaderParamData(), physics::Shape::Shape(), and physics::BodyData::unloadImpl().
const vector3d core::vector3d::UNIT_SCALE = vector3d(1.0f, 1.0f, 1.0f) [static] |
Referenced by physics::BoxShape::BoxShape(), and scene::Node::initProperties().
const vector3d core::vector3d::UNIT_X = vector3d(1.0f, 0.0f, 0.0f) [static] |
UNIT_X is a const vector3d that defines the 3d unit vector for the x-axis.
Referenced by scene::Node::getAbsoluteRight(), scene::Node::getRight(), render::RenderManager::render(), render::RenderManager::renderSingleRenderable(), scene::Node::rotateX(), render::Camera::rotateX(), and render::Camera::setDirection().
const vector3d core::vector3d::UNIT_Y = vector3d(0.0f, 1.0f, 0.0f) [static] |
UNIT_Y is a const vector3d that defines the 3d unit vector for the y-axis.
Referenced by physics::CollisionPoint::CollisionPoint(), scene::Node::getAbsoluteUp(), scene::Node::getUp(), render::Camera::initProperties(), physics::PlaneShape::PlaneShape(), render::RenderManager::render(), render::RenderManager::renderSingleRenderable(), scene::Node::rotateY(), render::Camera::rotateY(), render::Camera::setDirection(), and render::Camera::updateView().
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().
Referenced by core::aabox3d::addInternalPoint(), core::matrix4::buildShadowMatrix(), core::matrix4::buildViewMatrix(), crossProduct(), dotProduct(), core::quaternion::fromAngleAxis(), core::quaternion::fromDegreeAxis(), get(), getDistanceFrom(), getDistanceFromSQ(), core::aabox3d::getEdges(), getLength(), getLengthSQ(), core::matrix4::getScale(), core::matrix4::inverseRotateVect(), core::matrix4::inverseTranslateVector(), invert(), core::aabox3d::isEmpty(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), resource::Serializer::readObject(), core::aabox3d::repair(), core::matrix4::rotateVector(), set(), core::quaternion::set(), core::quaternion::setDegrees(), render::Camera::setDirection(), core::matrix4::setInverseRotationRadians(), core::matrix4::setInverseTranslation(), setLength(), scene::Node::setPosition(), render::Overlay::setPosition(), physics::Shape::setPosition(), core::matrix4::setRotationRadians(), scene::Node::setScale(), core::matrix4::setScale(), core::matrix4::setTranslation(), sound::Sound::setVelocity(), sound::Listener::setVelocity(), core::quaternion::toEulerAngles(), core::quaternion::toEulerDegrees(), core::matrix4::transformVector(), core::matrix4::translateVector(), render::Model::updateImpl(), and resource::Serializer::writeObject().
Referenced by core::aabox3d::addInternalPoint(), core::matrix4::buildShadowMatrix(), core::matrix4::buildViewMatrix(), crossProduct(), dotProduct(), core::quaternion::fromAngleAxis(), core::quaternion::fromDegreeAxis(), getDistanceFrom(), getDistanceFromSQ(), core::aabox3d::getEdges(), getLength(), getLengthSQ(), core::matrix4::getScale(), core::matrix4::inverseRotateVect(), core::matrix4::inverseTranslateVector(), invert(), core::aabox3d::isEmpty(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), resource::Serializer::readObject(), core::aabox3d::repair(), core::matrix4::rotateVector(), set(), core::quaternion::set(), core::quaternion::setDegrees(), render::Camera::setDirection(), core::matrix4::setInverseRotationRadians(), core::matrix4::setInverseTranslation(), setLength(), scene::Node::setPosition(), render::Overlay::setPosition(), physics::Shape::setPosition(), core::matrix4::setRotationRadians(), scene::Node::setScale(), core::matrix4::setScale(), core::matrix4::setTranslation(), sound::Sound::setVelocity(), sound::Listener::setVelocity(), core::quaternion::toEulerAngles(), core::quaternion::toEulerDegrees(), core::matrix4::transformVector(), core::matrix4::translateVector(), render::Model::updateImpl(), and resource::Serializer::writeObject().
Referenced by core::aabox3d::addInternalPoint(), core::matrix4::buildShadowMatrix(), core::matrix4::buildViewMatrix(), crossProduct(), dotProduct(), core::quaternion::fromAngleAxis(), core::quaternion::fromDegreeAxis(), getDistanceFrom(), getDistanceFromSQ(), core::aabox3d::getEdges(), getLength(), getLengthSQ(), core::matrix4::getScale(), core::matrix4::inverseRotateVect(), core::matrix4::inverseTranslateVector(), invert(), core::aabox3d::isEmpty(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), resource::Serializer::readObject(), core::aabox3d::repair(), core::matrix4::rotateVector(), set(), core::quaternion::set(), core::quaternion::setDegrees(), render::Camera::setDirection(), core::matrix4::setInverseRotationRadians(), core::matrix4::setInverseTranslation(), setLength(), scene::Node::setPosition(), physics::Shape::setPosition(), core::matrix4::setRotationRadians(), scene::Node::setScale(), core::matrix4::setScale(), core::matrix4::setTranslation(), sound::Sound::setVelocity(), sound::Listener::setVelocity(), core::quaternion::toEulerAngles(), core::quaternion::toEulerDegrees(), core::matrix4::transformVector(), core::matrix4::translateVector(), render::Model::updateImpl(), and resource::Serializer::writeObject().
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by
Doxygen
(1.7.4)
|