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

Lamp::AxisAlignedBox Class Reference

軸沿いボックス More...

#include <AxisAlignedBox.h>

List of all members.

Public Member Functions

 AxisAlignedBox ()
 コンストラクタ

 AxisAlignedBox (const Vector3 &minimum, const Vector3 &maximum)
 コンストラクタ

 AxisAlignedBox (float minimumX, float minimumY, float minimumZ, float maximumX, float maximumY, float maximumZ)
 コンストラクタ

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

void set (const Vector3 &minimum, const Vector3 &maximum)
 値の設定

void set (float minimumX, float minimumY, float minimumZ, float maximumX, float maximumY, float maximumZ)
 値の設定

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

const Vector3getMinimum () const
 最小値の取得

const Vector3getMaximum () const
 最大値の取得

Vector3 getSize () const
 サイズの取得

Vector3 getCenter () const
 中心の取得

Vector3 getCorner (int index) const
 コーナーの取得

void getCornerArray (Vector3 corner[8]) const
 コーナー配列の取得

const AxisAlignedBoxmerge (const AxisAlignedBox &box)
 マージ

const AxisAlignedBoxmerge (const Vector3 &vector)
 マージ

bool isZero () const
 ゼロボックスかどうか

bool isUnit () const
 単位ボックスかどうか

AxisAlignedBox transform (const Matrix33 &matrix) const
 トランスフォーム

AxisAlignedBox transform (const Matrix34 &matrix) const
 トランスフォーム

AxisAlignedBox transform (const Matrix44 &matrix) const
 トランスフォーム

float getDistance (const Vector3 &point) const
 点距離

float getSquaredDistance (const Vector3 &point) const
 点距離の二乗

float getDistance (const AxisAlignedBox &axisAlignedBox) const
 軸沿いボックス距離

float getSquaredDistance (const AxisAlignedBox &axisAlignedBox) const
 軸沿いボックス距離の二乗

float getDistance (const Capsule &capsule) const
 カプセル距離

float getSquaredDistance (const Capsule &capsule) const
 カプセル距離の二乗

float getDistance (const Cone &cone) const
 コーン距離

float getSquaredDistance (const Cone &cone) const
 コーン距離の二乗

float getDistance (const Line &line) const
 ライン距離

float getSquaredDistance (const Line &line) const
 ライン距離の二乗

float getDistance (const OrientedBox &orientedBox) const
 指向性ボックス距離

float getSquaredDistance (const OrientedBox &orientedBox) const
 指向性ボックス距離の二乗

float getDistance (const Plane &plane) const
 平面距離

float getSquaredDistance (const Plane &plane) const
 平面距離の二乗

float getDistance (const Ray &ray) const
 レイ距離

float getSquaredDistance (const Ray &ray) const
 レイ距離の二乗

float getDistance (const Segment &segment) const
 セグメント距離

float getSquaredDistance (const Segment &segment) const
 セグメント距離の二乗

float getDistance (const Sphere &sphere) const
 球距離

float getSquaredDistance (const Sphere &sphere) const
 球距離の二乗

float getDistance (const Triangle &triangle) const
 三角距離

float getSquaredDistance (const Triangle &triangle) const
 三角距離の二乗

bool intersect (const Vector3 &point) const
 点交差

bool intersect (const AxisAlignedBox &axisAlignedBox) const
 軸沿いボックス交差

bool intersect (const Capsule &capsule) const
 カプセル交差

bool intersect (const Cone &cone) const
 コーン交差

bool intersect (const Line &line) const
 ライン交差

bool intersect (const OrientedBox &orientedBox) const
 指向性ボックス交差

bool intersect (const Plane &plane) const
 平面交差

bool intersect (const Ray &ray) const
 レイ交差

bool intersect (const Segment &segment) const
 セグメント交差

bool intersect (const Sphere &sphere) const
 球交差

bool intersect (const Triangle &triangle) const
 三角交差

bool operator== (const AxisAlignedBox &target) const
 軸沿いボックスが同じかどうか

bool epsilonEquals (const AxisAlignedBox &target, float epsilon) const
 軸沿いボックスが同じかどうか

bool operator!= (const AxisAlignedBox &target) const
 軸沿いボックスが同じでないかどうか

bool notEpsilonEquals (const AxisAlignedBox &target, float epsilon) const
 軸沿いボックスが同じでないかどうか

String toString () const
 文字列化


Static Public Attributes

const AxisAlignedBox zero
 ゼロボックス

const AxisAlignedBox unit
 単位ボックス


Detailed Description

軸沿いボックス

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

Definition at line 51 of file AxisAlignedBox.h.


Constructor & Destructor Documentation

Lamp::AxisAlignedBox::AxisAlignedBox  )  [inline]
 

コンストラクタ

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

Definition at line 70 of file AxisAlignedBox.h.

Lamp::AxisAlignedBox::AxisAlignedBox const Vector3 minimum,
const Vector3 maximum
[inline]
 

コンストラクタ

Parameters:
minimum 最小値の初期値
maximum 最大値の初期値

Definition at line 77 of file AxisAlignedBox.h.

References Assert, Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.

Lamp::AxisAlignedBox::AxisAlignedBox float  minimumX,
float  minimumY,
float  minimumZ,
float  maximumX,
float  maximumY,
float  maximumZ
[inline]
 

コンストラクタ

Parameters:
minimumX 最小値Xの初期値
minimumY 最小値Yの初期値
minimumZ 最小値Zの初期値
maximumX 最大値Xの初期値
maximumY 最大値Yの初期値
maximumZ 最大値Zの初期値

Definition at line 93 of file AxisAlignedBox.h.

References Assert, Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.

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

コンストラクタ

Parameters:
source 初期値配列

Definition at line 107 of file AxisAlignedBox.h.

References Assert, Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.


Member Function Documentation

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

軸沿いボックスが同じかどうか

Parameters:
target 比較する軸沿いボックス
epsilon 誤差
Returns:
誤差の範囲内で同じ値であればtrueを返す

Definition at line 654 of file AxisAlignedBox.h.

References Assert, Lamp::Vector3::epsilonEquals(), maximum_, and minimum_.

Referenced by isUnit(), and isZero().

Vector3 Lamp::AxisAlignedBox::getCenter  )  const [inline]
 

中心の取得

Returns:
中心

Definition at line 187 of file AxisAlignedBox.h.

Referenced by Lamp::DeformedMeshGeometry::calculateBounding(), Lamp::VectorInterpolationCompressor::compressConstant(), Lamp::CalculateBoundingSphereFilter::filterMesh(), Lamp::CalculateBoundingBoxFilter::filterMesh(), and Lamp::CollisionRenderer::setupStaticDeformedMeshCollision().

Vector3 Lamp::AxisAlignedBox::getCorner int  index  )  const [inline]
 

コーナーの取得

以下の図のインデックスに沿ってコーナーを取得します。 0が最小値で4が最大値です。

y+ | 1----2 /| /| 5-+--4 | | 0--+-3-- x+ |/ |/ 6----7 / z+
Parameters:
index インデックス
Returns:
コーナー

Definition at line 209 of file AxisAlignedBox.h.

References ErrorOut, Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.

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

void Lamp::AxisAlignedBox::getCornerArray Vector3  corner[8]  )  const [inline]
 

コーナー配列の取得

以下の図のインデックスに沿ってコーナーを取得します。 0が最小値で4が最大値です。

y+ | 1----2 /| /| 5-+--4 | | 0--+-3-- x+ |/ |/ 6----7 / z+
Parameters:
corner [out] コーナー配列

Definition at line 250 of file AxisAlignedBox.h.

References Lamp::Vector3::set(), Lamp::Vector3::x, and Lamp::Vector3::y.

Referenced by Lamp::Camera::clipping(), and transform().

float Lamp::AxisAlignedBox::getDistance const Triangle triangle  )  const [inline]
 

三角距離

Parameters:
triangle 距離判定する三角
Returns:
距離

Definition at line 535 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const Sphere sphere  )  const [inline]
 

球距離

Parameters:
sphere 距離判定する球
Returns:
距離

Definition at line 518 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const Segment segment  )  const [inline]
 

セグメント距離

Parameters:
segment 距離判定するセグメント
Returns:
距離

Definition at line 501 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const Ray ray  )  const [inline]
 

レイ距離

Parameters:
ray 距離判定するレイ
Returns:
距離

Definition at line 484 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const Plane plane  )  const
 

平面距離

Parameters:
plane 距離判定する平面
Returns:
距離

Definition at line 77 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getDistance const OrientedBox orientedBox  )  const [inline]
 

指向性ボックス距離

Parameters:
orientedBox 距離判定する指向性ボックス
Returns:
距離

Definition at line 449 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const Line line  )  const [inline]
 

ライン距離

Parameters:
line 距離判定するライン
Returns:
距離

Definition at line 432 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const Cone cone  )  const [inline]
 

コーン距離

Parameters:
cone 距離判定するコーン
Returns:
距離

Definition at line 415 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const Capsule capsule  )  const [inline]
 

カプセル距離

Parameters:
capsule 距離判定するカプセル
Returns:
距離

Definition at line 398 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const AxisAlignedBox axisAlignedBox  )  const [inline]
 

軸沿いボックス距離

Parameters:
axisAlignedBox 距離判定する軸沿いボックス
Returns:
距離

Definition at line 381 of file AxisAlignedBox.h.

References getSquaredDistance().

float Lamp::AxisAlignedBox::getDistance const Vector3 point  )  const [inline]
 

点距離

Parameters:
point 距離判定する点
Returns:
距離

Definition at line 364 of file AxisAlignedBox.h.

References getSquaredDistance().

Referenced by getSquaredDistance().

const Vector3& Lamp::AxisAlignedBox::getMaximum  )  const [inline]
 

最大値の取得

Returns:
最大値

Definition at line 175 of file AxisAlignedBox.h.

Referenced by Lamp::CalculateBoundingBoxFilter::filterMesh(), Lamp::AxisAlignedBoxIntersection::intersect(), Lamp::TextSceneSaver::writeMeshData(), and Lamp::TextCollisionSaver::writeStaticDeformedMeshCollision().

const Vector3& Lamp::AxisAlignedBox::getMinimum  )  const [inline]
 

最小値の取得

Returns:
最小値

Definition at line 169 of file AxisAlignedBox.h.

Referenced by Lamp::CalculateBoundingBoxFilter::filterMesh(), Lamp::AxisAlignedBoxIntersection::intersect(), Lamp::TextSceneSaver::writeMeshData(), and Lamp::TextCollisionSaver::writeStaticDeformedMeshCollision().

Vector3 Lamp::AxisAlignedBox::getSize  )  const [inline]
 

サイズの取得

Returns:
サイズ

Definition at line 181 of file AxisAlignedBox.h.

Referenced by Lamp::AnimationCompressor::compressScale(), Lamp::AxisAlignedBoxIntersection::intersect(), and Lamp::CollisionRenderer::setupStaticDeformedMeshCollision().

float Lamp::AxisAlignedBox::getSquaredDistance const Triangle triangle  )  const
 

三角距離の二乗

Parameters:
triangle 距離判定する三角
Returns:
距離の二乗

Definition at line 97 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const Sphere sphere  )  const
 

球距離の二乗

Parameters:
sphere 距離判定する球
Returns:
距離の二乗

Definition at line 92 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const Segment segment  )  const
 

セグメント距離の二乗

Parameters:
segment 距離判定するセグメント
Returns:
距離の二乗

Definition at line 87 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const Ray ray  )  const
 

レイ距離の二乗

Parameters:
ray 距離判定するレイ
Returns:
距離の二乗

Definition at line 82 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const Plane plane  )  const [inline]
 

平面距離の二乗

Parameters:
plane 距離判定する平面
Returns:
距離の二乗

Definition at line 473 of file AxisAlignedBox.h.

References getDistance().

float Lamp::AxisAlignedBox::getSquaredDistance const OrientedBox orientedBox  )  const
 

指向性ボックス距離の二乗

Parameters:
orientedBox 距離判定する指向性ボックス
Returns:
距離の二乗

Definition at line 72 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const Line line  )  const
 

ライン距離の二乗

Parameters:
line 距離判定するライン
Returns:
距離の二乗

Definition at line 67 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const Cone cone  )  const
 

コーン距離の二乗

Parameters:
cone 距離判定するコーン
Returns:
距離の二乗

Definition at line 62 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const Capsule capsule  )  const
 

カプセル距離の二乗

Parameters:
capsule 距離判定するカプセル
Returns:
距離の二乗

Definition at line 57 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const AxisAlignedBox axisAlignedBox  )  const
 

軸沿いボックス距離の二乗

Parameters:
axisAlignedBox 距離判定する軸沿いボックス
Returns:
距離の二乗

Definition at line 51 of file AxisAlignedBox.cpp.

float Lamp::AxisAlignedBox::getSquaredDistance const Vector3 point  )  const
 

点距離の二乗

Parameters:
point 距離判定する点
Returns:
距離の二乗

Definition at line 46 of file AxisAlignedBox.cpp.

Referenced by getDistance().

bool Lamp::AxisAlignedBox::intersect const Triangle triangle  )  const
 

三角交差

Parameters:
triangle 交差判定する三角
Returns:
交差していればtrue

Definition at line 154 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const Sphere sphere  )  const
 

球交差

Parameters:
sphere 交差判定する球
Returns:
交差していればtrue

Definition at line 149 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const Segment segment  )  const
 

セグメント交差

Parameters:
segment 交差判定するセグメント
Returns:
交差していればtrue

Definition at line 144 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const Ray ray  )  const
 

レイ交差

Parameters:
ray 交差判定するレイ
Returns:
交差していればtrue

Definition at line 139 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const Plane plane  )  const
 

平面交差

Parameters:
plane 交差判定する平面
Returns:
交差していればtrue

Definition at line 134 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const OrientedBox orientedBox  )  const
 

指向性ボックス交差

Parameters:
orientedBox 交差判定する指向性ボックス
Returns:
交差していればtrue

Definition at line 129 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const Line line  )  const
 

ライン交差

Parameters:
line 交差判定するライン
Returns:
交差していればtrue

Definition at line 124 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const Cone cone  )  const
 

コーン交差

Parameters:
cone 交差判定するコーン
Returns:
交差していればtrue

Definition at line 119 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const Capsule capsule  )  const
 

カプセル交差

Parameters:
capsule 交差判定するカプセル
Returns:
交差していればtrue

Definition at line 114 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const AxisAlignedBox axisAlignedBox  )  const
 

軸沿いボックス交差

Parameters:
axisAlignedBox 交差判定する軸沿いボックス
Returns:
交差していればtrue

Definition at line 109 of file AxisAlignedBox.cpp.

bool Lamp::AxisAlignedBox::intersect const Vector3 point  )  const
 

点交差

Parameters:
point 交差判定する点
Returns:
交差していればtrue

Definition at line 104 of file AxisAlignedBox.cpp.

Referenced by Lamp::Scene::getLocalLightList(), and Lamp::DeformedMeshGeometry::intersectBounding().

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

単位ボックスかどうか

Returns:
単位ボックスならtrueを返す

Definition at line 307 of file AxisAlignedBox.h.

References epsilonEquals(), and unit.

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

ゼロボックスかどうか

Returns:
ゼロボックスならtrueを返す

Definition at line 299 of file AxisAlignedBox.h.

References epsilonEquals(), and zero.

const AxisAlignedBox& Lamp::AxisAlignedBox::merge const Vector3 vector  )  [inline]
 

マージ

Parameters:
vector マージするベクトル
Returns:
マージされたボックス

Definition at line 284 of file AxisAlignedBox.h.

References Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.

const AxisAlignedBox& Lamp::AxisAlignedBox::merge const AxisAlignedBox box  )  [inline]
 

マージ

Parameters:
box マージするボックス
Returns:
マージされたボックス

Definition at line 269 of file AxisAlignedBox.h.

References maximum_, minimum_, Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.

Referenced by Lamp::DeformedMeshGeometry::calculateBounding(), Lamp::VectorInterpolationCompressor::compressConstant(), Lamp::CalculateBoundingBoxFilter::filterMesh(), Lamp::VectorLinearInterpolator::getBoundingBox(), Lamp::VectorArrayInterpolator::getBoundingBox(), Lamp::OrientedBox::scaledTransform(), and transform().

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

軸沿いボックスが同じでないかどうか

Parameters:
target 比較する軸沿いボックス
epsilon 誤差
Returns:
誤差の範囲内で同じでない値であればtrueを返す

Definition at line 676 of file AxisAlignedBox.h.

References Assert, maximum_, minimum_, and Lamp::Vector3::notEpsilonEquals().

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

軸沿いボックスが同じでないかどうか

Parameters:
target 比較する軸沿いボックス
Returns:
同じでない値であればtrueを返す

Definition at line 666 of file AxisAlignedBox.h.

References maximum_, and minimum_.

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

軸沿いボックスが同じかどうか

Parameters:
target 比較する軸沿いボックス
Returns:
同じ値であればtrueを返す

Definition at line 644 of file AxisAlignedBox.h.

References maximum_, and minimum_.

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

値の設定

Parameters:
source 設定値配列

Definition at line 154 of file AxisAlignedBox.h.

References Assert, Lamp::Vector3::set(), Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.

void Lamp::AxisAlignedBox::set float  minimumX,
float  minimumY,
float  minimumZ,
float  maximumX,
float  maximumY,
float  maximumZ
[inline]
 

値の設定

Parameters:
minimumX 設定する最小値X
minimumY 設定する最小値Y
minimumZ 設定する最小値Z
maximumX 設定する最大値X
maximumY 設定する最大値Y
maximumZ 設定する最大値Z

Definition at line 140 of file AxisAlignedBox.h.

References Assert, Lamp::Vector3::set(), Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.

void Lamp::AxisAlignedBox::set const Vector3 minimum,
const Vector3 maximum
[inline]
 

値の設定

Parameters:
minimum 設定する最小値
maximum 設定する最大値

Definition at line 123 of file AxisAlignedBox.h.

References Assert, Lamp::Vector3::x, Lamp::Vector3::y, and Lamp::Vector3::z.

Referenced by Lamp::DeformedMeshGeometry::calculateBounding(), Lamp::CalculateBoundingBoxFilter::filterMesh(), Lamp::VectorLinearInterpolator::getBoundingBox(), Lamp::VectorConstantInterpolator::getBoundingBox(), Lamp::VectorArrayInterpolator::getBoundingBox(), Lamp::TextSceneLoader::readAxisAlignedBox(), Lamp::TextCollisionLoader::readAxisAlignedBox(), and Lamp::OrientedBox::scaledTransform().

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

文字列化

Returns:
軸沿いボックスの文字列表記

Definition at line 690 of file AxisAlignedBox.h.

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

AxisAlignedBox Lamp::AxisAlignedBox::transform const Matrix44 matrix  )  const [inline]
 

トランスフォーム

Parameters:
matrix 乗算する行列
Returns:
変換後の軸沿いボックス

Definition at line 347 of file AxisAlignedBox.h.

References getCornerArray(), maximum_, merge(), and minimum_.

AxisAlignedBox Lamp::AxisAlignedBox::transform const Matrix34 matrix  )  const [inline]
 

トランスフォーム

Parameters:
matrix 乗算する行列
Returns:
変換後の軸沿いボックス

Definition at line 333 of file AxisAlignedBox.h.

References getCornerArray(), maximum_, merge(), and minimum_.

AxisAlignedBox Lamp::AxisAlignedBox::transform const Matrix33 matrix  )  const [inline]
 

トランスフォーム

Parameters:
matrix 乗算する行列
Returns:
変換後の軸沿いボックス

Definition at line 319 of file AxisAlignedBox.h.

References getCornerArray(), maximum_, merge(), and minimum_.

Referenced by Lamp::Mesh::traverse(), and Lamp::StaticDeformedMeshCollision::traverseImplement().


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