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

Lamp::Vector3 Class Reference

三次元ベクトル More...

#include <Vector3.h>

List of all members.

Public Member Functions

 Vector3 ()
 コンストラクタ

 Vector3 (float sourceX, float sourceY, float sourceZ)
 コンストラクタ

 Vector3 (const float *const source)
 コンストラクタ

void set (float sourceX, float sourceY, float sourceZ)
 値の設定

void set (const float *const source)
 値の設定

Vector3 operator+ (const Vector3 &addVector) const
 加算

Vector3 operator- (const Vector3 &subVector) const
 減算

Vector3 operator * (float mulValue) const
 乗算

Vector3 operator+ () const
 +演算子

Vector3 operator- () const
 -演算子

Vector3operator+= (const Vector3 &addVector)
 代入加算

Vector3operator-= (const Vector3 &subVector)
 代入減算

Vector3operator *= (float mulValue)
 代入乗算

Vector3inverse ()
 逆ベクトル

Vector3abs ()
 絶対値

float dotProduct (const Vector3 &dotVector) const
 内積

Vector3 crossProduct (const Vector3 &crossVector) const
 外積

float getLength () const
 ベクトル長の取得

Vector3setLength (float length)
 ベクトル長の設定

float getSquaredLength () const
 ベクトル長の二乗を取得

Vector3normalize ()
 正規化

bool isZero () const
 ゼロベクトルかどうか

bool isUnit () const
 単位ベクトルかどうか

float maximumValue () const
 最大値

float minimumValue () const
 最小値

bool operator== (const Vector3 &target) const
 ベクトルが同じかどうか

bool epsilonEquals (const Vector3 &target, float epsilon) const
 ベクトルが同じかどうか

bool operator!= (const Vector3 &target) const
 ベクトルが同じでないかどうか

bool notEpsilonEquals (const Vector3 &target, float epsilon) const
 ベクトルが同じでないかどうか

String toString () const
 文字列化


Static Public Attributes

const Vector3 zero
 ゼロベクトル

const Vector3 unitX
 X軸単位ベクトル.

const Vector3 unitY
 Y軸単位ベクトル.

const Vector3 unitZ
 Z軸単位ベクトル.

const Vector3 unitScale
 スケール単位ベクトル


Friends

Vector3 operator * (float mulValue, const Vector3 &mulVector)
 乗算


Detailed Description

三次元ベクトル

このクラスは継承しないで下さい。

Definition at line 39 of file Vector3.h.


Constructor & Destructor Documentation

Lamp::Vector3::Vector3  )  [inline]
 

コンストラクタ

このコンストラクタは初期値の設定を行わないため値は不定です。

Definition at line 86 of file Vector3.h.

Referenced by crossProduct(), operator *(), operator+(), and operator-().

Lamp::Vector3::Vector3 float  sourceX,
float  sourceY,
float  sourceZ
[inline]
 

コンストラクタ

Parameters:
sourceX Xの初期値
sourceY Yの初期値
sourceZ Zの初期値

Definition at line 94 of file Vector3.h.

References x, y, and z.

Lamp::Vector3::Vector3 const float *const  source  )  [inline, explicit]
 

コンストラクタ

Parameters:
source 初期値配列

Definition at line 102 of file Vector3.h.

References x, y, and z.


Member Function Documentation

Vector3& Lamp::Vector3::abs  )  [inline]
 

絶対値

Returns:
絶対値にされたベクトル

Definition at line 245 of file Vector3.h.

References x, y, and z.

Vector3 Lamp::Vector3::crossProduct const Vector3 crossVector  )  const [inline]
 

外積

Parameters:
crossVector 外積をとるベクトル
Returns:
外積ベクトル

Definition at line 270 of file Vector3.h.

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

Referenced by Lamp::Math3D::calculateNormal(), Lamp::SphereIntersection::intersect(), Lamp::PlaneIntersection::intersect(), Lamp::Quaternion::operator *(), and Lamp::Camera::setLookAt().

float Lamp::Vector3::dotProduct const Vector3 dotVector  )  const [inline]
 

内積

Parameters:
dotVector 内積をとるベクトル
Returns:
内積値

Definition at line 260 of file Vector3.h.

References x, y, and z.

Referenced by Lamp::Plane::dotProduct(), Lamp::OrientedBox::getEffectiveDiameter(), Lamp::SphereIntersection::intersect(), Lamp::PlaneIntersection::intersect(), Lamp::LineIntersection::intersect(), Lamp::CapsuleIntersection::intersect(), Lamp::Plane::Plane(), Lamp::Plane::set(), Lamp::Camera::setLookAt(), Lamp::SegmentDistance::squaredDistance(), Lamp::RayDistance::squaredDistance(), Lamp::LineDistance::squaredDistance(), and Lamp::Plane::transform().

bool Lamp::Vector3::epsilonEquals const Vector3 target,
float  epsilon
const [inline]
 

ベクトルが同じかどうか

Parameters:
target 比較するベクトル
epsilon 誤差
Returns:
誤差の範囲内で同じ値であればtrueを返す

Definition at line 379 of file Vector3.h.

References Assert, x, y, and z.

Referenced by Lamp::Triangle::epsilonEquals(), Lamp::Sphere::epsilonEquals(), Lamp::Segment::epsilonEquals(), Lamp::Ray::epsilonEquals(), Lamp::Plane::epsilonEquals(), Lamp::OrientedBox::epsilonEquals(), Lamp::Line::epsilonEquals(), Lamp::Cone::epsilonEquals(), Lamp::Capsule::epsilonEquals(), Lamp::AxisAlignedBox::epsilonEquals(), Lamp::OrientedBox::isUnit(), Lamp::Segment::isZero(), Lamp::Ray::isZero(), Lamp::OrientedBox::isZero(), Lamp::Line::isZero(), Lamp::Cone::isZero(), Lamp::Capsule::isZero(), and Lamp::Camera::setLookAt().

float Lamp::Vector3::getLength  )  const [inline]
 

ベクトル長の取得

Returns:
ベクトル長

Definition at line 285 of file Vector3.h.

References x, y, and z.

Referenced by Lamp::Sphere::append(), Lamp::Camera::clippingSetup(), isUnit(), Lamp::Sphere::merge(), normalize(), setLength(), Lamp::Plane::setLength(), and Lamp::LODSceneNode::traverse().

float Lamp::Vector3::getSquaredLength  )  const [inline]
 

ベクトル長の二乗を取得

Returns:
ベクトル長の二乗

Definition at line 305 of file Vector3.h.

References x, y, and z.

Referenced by Lamp::Camera::clippingSetup(), Lamp::VectorInterpolationCompressor::compressConstant(), Lamp::IntersectionResult::getMaxRefrection(), Lamp::SphereIntersection::intersect(), Lamp::PlaneIntersection::intersect(), Lamp::CapsuleIntersection::intersect(), Lamp::VectorInterpolationCompressor::recalcLinearError(), Lamp::SegmentDistance::squaredDistance(), Lamp::RayDistance::squaredDistance(), and Lamp::LineDistance::squaredDistance().

bool Lamp::Vector3::isUnit  )  const [inline]
 

単位ベクトルかどうか

Returns:
単位ベクトルならtrueを返す

Definition at line 335 of file Vector3.h.

References getLength().

Referenced by Lamp::Quaternion::setRotationAxis(), Lamp::Matrix44::setRotationAxis(), Lamp::Matrix34::setRotationAxis(), Lamp::Matrix33::setRotationAxis(), and Lamp::DirectionalLight::traverse().

bool Lamp::Vector3::isZero  )  const [inline]
 

ゼロベクトルかどうか

Returns:
ゼロベクトルならtrueを返す

Definition at line 325 of file Vector3.h.

References x, y, and z.

Referenced by Lamp::Sphere::append(), Lamp::SphereIntersection::intersect(), Lamp::Sphere::merge(), and Lamp::SoundListener::setDirection().

float Lamp::Vector3::maximumValue  )  const [inline]
 

最大値

Returns:
最大値

Definition at line 343 of file Vector3.h.

References x, y, and z.

Referenced by Lamp::AnimationCompressor::compressScale().

float Lamp::Vector3::minimumValue  )  const [inline]
 

最小値

Returns:
最小値

Definition at line 354 of file Vector3.h.

References x, y, and z.

Vector3& Lamp::Vector3::normalize  )  [inline]
 

正規化

Returns:
正規化されたベクトル

Definition at line 313 of file Vector3.h.

References Assert, and getLength().

Referenced by Lamp::Math3D::calculateNormal(), Lamp::Matrix44::getRotationAxis(), Lamp::Matrix34::getRotationAxis(), Lamp::Matrix33::getRotationAxis(), Lamp::SphereIntersection::intersect(), Lamp::Math3D::lookAtZ(), Lamp::DirectionalLight::setDirection(), Lamp::Camera::setLookAt(), and Lamp::DirectionalLight::traverse().

bool Lamp::Vector3::notEpsilonEquals const Vector3 target,
float  epsilon
const [inline]
 

ベクトルが同じでないかどうか

Parameters:
target 比較するベクトル
epsilon 誤差
Returns:
誤差の範囲内で同じでない値であればtrueを返す

Definition at line 402 of file Vector3.h.

References Assert, x, y, and z.

Referenced by Lamp::BuildIndexedTriangleFilter::findIndex(), Lamp::Triangle::notEpsilonEquals(), Lamp::Sphere::notEpsilonEquals(), Lamp::Segment::notEpsilonEquals(), Lamp::Ray::notEpsilonEquals(), Lamp::Plane::notEpsilonEquals(), Lamp::OrientedBox::notEpsilonEquals(), Lamp::Line::notEpsilonEquals(), Lamp::Cone::notEpsilonEquals(), Lamp::Capsule::notEpsilonEquals(), and Lamp::AxisAlignedBox::notEpsilonEquals().

Vector3 Lamp::Vector3::operator * float  mulValue  )  const [inline]
 

乗算

Parameters:
mulValue 乗算する値
Returns:
乗算されたベクトル

Definition at line 163 of file Vector3.h.

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

Vector3& Lamp::Vector3::operator *= float  mulValue  )  [inline]
 

代入乗算

Parameters:
mulValue 乗算する値
Returns:
乗算されたベクトル

Definition at line 224 of file Vector3.h.

References x, y, and z.

bool Lamp::Vector3::operator!= const Vector3 target  )  const [inline]
 

ベクトルが同じでないかどうか

Parameters:
target 比較するベクトル
Returns:
同じでない値であればtrueを返す

Definition at line 392 of file Vector3.h.

References x, y, and z.

Vector3 Lamp::Vector3::operator+  )  const [inline]
 

+演算子

Returns:
ベクトルのコピー

Definition at line 184 of file Vector3.h.

Vector3 Lamp::Vector3::operator+ const Vector3 addVector  )  const [inline]
 

加算

Parameters:
addVector 加算するベクトル
Returns:
加算されたベクトル

Definition at line 139 of file Vector3.h.

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

Vector3& Lamp::Vector3::operator+= const Vector3 addVector  )  [inline]
 

代入加算

Parameters:
addVector 加算するベクトル
Returns:
加算されたベクトル

Definition at line 200 of file Vector3.h.

References x, y, and z.

Vector3 Lamp::Vector3::operator-  )  const [inline]
 

-演算子

Returns:
値の符号が反転したベクトル

Definition at line 190 of file Vector3.h.

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

Vector3 Lamp::Vector3::operator- const Vector3 subVector  )  const [inline]
 

減算

Parameters:
subVector 減算するベクトル
Returns:
減算されたベクトル

Definition at line 151 of file Vector3.h.

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

Vector3& Lamp::Vector3::operator-= const Vector3 subVector  )  [inline]
 

代入減算

Parameters:
subVector 減算するベクトル
Returns:
減算されたベクトル

Definition at line 212 of file Vector3.h.

References x, y, and z.

bool Lamp::Vector3::operator== const Vector3 target  )  const [inline]
 

ベクトルが同じかどうか

Parameters:
target 比較するベクトル
Returns:
同じ値であればtrueを返す

Definition at line 369 of file Vector3.h.

References x, y, and z.

void Lamp::Vector3::set const float *const  source  )  [inline]
 

値の設定

Parameters:
source 設定値配列

Definition at line 125 of file Vector3.h.

References x, y, and z.

void Lamp::Vector3::set float  sourceX,
float  sourceY,
float  sourceZ
[inline]
 

値の設定

Parameters:
sourceX Xの設定値
sourceY Yの設定値
sourceZ Zの設定値

Definition at line 115 of file Vector3.h.

References x, y, and z.

Referenced by Lamp::Camera::clippingSetup(), Lamp::AxisAlignedBox::getCornerArray(), Lamp::Quaternion::getRotationAxis(), Lamp::Matrix44::getRotationAxis(), Lamp::Matrix34::getRotationAxis(), Lamp::Matrix33::getRotationAxis(), Lamp::Triangle::set(), Lamp::Sphere::set(), Lamp::Segment::set(), Lamp::Ray::set(), Lamp::Plane::set(), Lamp::OrientedBox::set(), Lamp::Line::set(), Lamp::Cone::set(), Lamp::Capsule::set(), Lamp::AxisAlignedBox::set(), Lamp::Sphere::setCenter(), Lamp::Plane::setNormal(), Lamp::Sound3D::Sound3D(), Lamp::Plane::transform(), and Lamp::Triangle::Triangle().

Vector3& Lamp::Vector3::setLength float  length  )  [inline]
 

ベクトル長の設定

Parameters:
length 設定するベクトル長

Definition at line 293 of file Vector3.h.

References Assert, and getLength().

Referenced by Lamp::SphereIntersection::intersect().

String Lamp::Vector3::toString  )  const [inline]
 

文字列化

Returns:
ベクトルの文字列表記

Definition at line 417 of file Vector3.h.

References Lamp::String::format(), x, y, and z.


Friends And Related Function Documentation

Vector3 operator * float  mulValue,
const Vector3 mulVector
[friend]
 

乗算

Parameters:
mulValue 乗算する値
mulVector 乗算するベクトル
Returns:
乗算されたベクトル

Definition at line 173 of file Vector3.h.


The documentation for this class was generated from the following files:
Generated on Wed Mar 16 10:29:53 2005 for Lamp by doxygen 1.3.2