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

Lamp::Sphere Class Reference

球 More...

#include <Sphere.h>

List of all members.

Public Member Functions

 Sphere ()
 コンストラクタ

 Sphere (const Vector3 &center, float radius)
 コンストラクタ

 Sphere (float centerX, float centerY, float centerZ, float radius)
 コンストラクタ

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

void set (const Vector3 &center, float radius)
 値の設定

void set (float centerX, float centerY, float centerZ, float radius)
 値の設定

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

void setCenter (float centerX, float centerY, float centerZ)
 中心の設定

void setCenter (const Vector3 &center)
 中心の設定

void setRadius (float radius)
 半径の設定

const Vector3 & getCenter () const
 中心の取得

float getRadius () const
 半径の取得

const Sphere & merge (const Sphere &target)
 マージ

const Sphere & merge (const Vector3 &target)
 マージ

const Sphere & append (const Vector3 &target)
 追加

bool isZero () const
 ゼロ球かどうか

bool isUnit () const
 単位球かどうか

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

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

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

Sphere scaledTransform (const Matrix33 &matrix) const
 スケール有りトランスフォーム

Sphere scaledTransform (const Matrix34 &matrix) const
 スケール有りトランスフォーム

Sphere scaledTransform (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 (Intersection *intersection, const Sphere &sphere) const
 球交差

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

bool intersect (Intersection *intersection, const Triangle &triangle) const
 三角交差

bool operator== (const Sphere &target) const
 球が同じかどうか

bool epsilonEquals (const Sphere &target, float epsilon) const
 球が同じかどうか

bool operator!= (const Sphere &target) const
 球が同じでないかどうか

bool notEpsilonEquals (const Sphere &target, float epsilon) const
 球が同じでないかどうか

String toString () const
 文字列化


Static Public Attributes

const Sphere zero
 ゼロ球

const Sphere unit
 単位球


Detailed Description

球

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

Definition at line 52 of file Sphere.h.


Constructor & Destructor Documentation

Lamp::Sphere::Sphere (   )  [inline]
 

コンストラクタ

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

Definition at line 71 of file Sphere.h.

Referenced by scaledTransform(), and transform().

Lamp::Sphere::Sphere (  const Vector3 &  center,
float  radius
)  [inline]
 

コンストラクタ

Parameters:
center 中心の初期値
radius 半径の初期値

Definition at line 79 of file Sphere.h.

Lamp::Sphere::Sphere (  float  centerX,
float  centerY,
float  centerZ,
float  radius
)  [inline]
 

コンストラクタ

Parameters:
centerX 中心Xの初期値
centerY 中心Yの初期値
centerZ 中心Zの初期値
radius 半径の初期値

Definition at line 91 of file Sphere.h.

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

コンストラクタ

Parameters:
source 初期値配列

Definition at line 99 of file Sphere.h.


Member Function Documentation

const Sphere& Lamp::Sphere::append (  const Vector3 &  target  )  [inline]
 

追加

中心は動かさない。適切な中心が設定されている状態で使用する。

Parameters:
target 追加するベクトル
Returns:
追加された球

Definition at line 234 of file Sphere.h.

References Lamp::Vector3::getLength(), and Lamp::Vector3::isZero().

Referenced by Lamp::DeformedMeshGeometry::calculateBounding(), and Lamp::CalculateBoundingSphereFilter::filterMesh().

bool Lamp::Sphere::epsilonEquals (  const Sphere &  target,
float  epsilon
)  const [inline]
 

球が同じかどうか

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

Definition at line 672 of file Sphere.h.

References Assert, center_, Lamp::Vector3::epsilonEquals(), and radius_.

const Vector3& Lamp::Sphere::getCenter (   )  const [inline]
 

中心の取得

Returns:
中心

Definition at line 166 of file Sphere.h.

Referenced by Lamp::Camera::clipping(), Lamp::StaticSphereCollision::getCenter(), Lamp::Mesh::getCenter(), Lamp::Scene::getLocalLightList(), Lamp::Mesh::getWorldCenter(), Lamp::SphereIntersection::intersect(), Lamp::SegmentIntersection::intersect(), Lamp::RayIntersection::intersect(), Lamp::PlaneIntersection::intersect(), Lamp::LineIntersection::intersect(), Lamp::AxisAlignedBoxIntersection::intersect(), Lamp::InformationRenderer::setupMeshBounding(), Lamp::CollisionRenderer::setupStaticDeformedMeshCollision(), Lamp::CollisionRenderer::setupStaticSphereCollision(), Lamp::TextSceneSaver::writeMeshData(), and Lamp::TextCollisionSaver::writeStaticDeformedMeshCollision().

float Lamp::Sphere::getDistance (  const Triangle &  triangle  )  const [inline]
 

三角距離

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

Definition at line 537 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const Sphere &  sphere  )  const [inline]
 

球距離

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

Definition at line 520 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const Segment &  segment  )  const [inline]
 

セグメント距離

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

Definition at line 503 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const Ray &  ray  )  const [inline]
 

レイ距離

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

Definition at line 486 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const Plane &  plane  )  const
 

平面距離

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

Definition at line 91 of file Sphere.cpp.

float Lamp::Sphere::getDistance (  const OrientedBox &  orientedBox  )  const [inline]
 

指向性ボックス距離

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

Definition at line 451 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const Line &  line  )  const [inline]
 

ライン距離

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

Definition at line 434 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const Cone &  cone  )  const [inline]
 

コーン距離

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

Definition at line 417 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const Capsule &  capsule  )  const [inline]
 

カプセル距離

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

Definition at line 400 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const AxisAlignedBox &  axisAlignedBox  )  const [inline]
 

軸沿いボックス距離

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

Definition at line 383 of file Sphere.h.

References getSquaredDistance().

float Lamp::Sphere::getDistance (  const Vector3 &  point  )  const [inline]
 

点距離

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

Definition at line 366 of file Sphere.h.

References getSquaredDistance().

Referenced by getSquaredDistance().

float Lamp::Sphere::getRadius (   )  const [inline]
 

半径の取得

Returns:
半径

Definition at line 172 of file Sphere.h.

Referenced by Lamp::Camera::clipping(), Lamp::CalculateBoundingSphereFilter::filterMesh(), Lamp::Scene::getLocalLightList(), Lamp::StaticSphereCollision::getRadius(), Lamp::SphereIntersection::intersect(), Lamp::SegmentIntersection::intersect(), Lamp::RayIntersection::intersect(), Lamp::PlaneIntersection::intersect(), Lamp::LineIntersection::intersect(), Lamp::AxisAlignedBoxIntersection::intersect(), Lamp::SceneFramework::loadScene(), Lamp::InformationRenderer::setupMeshBounding(), Lamp::CollisionRenderer::setupStaticDeformedMeshCollision(), Lamp::CollisionRenderer::setupStaticSphereCollision(), Lamp::TextSceneSaver::writeMeshData(), and Lamp::TextCollisionSaver::writeStaticDeformedMeshCollision().

float Lamp::Sphere::getSquaredDistance (  const Triangle &  triangle  )  const
 

三角距離の二乗

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

Definition at line 111 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const Sphere &  sphere  )  const
 

球距離の二乗

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

Definition at line 106 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const Segment &  segment  )  const
 

セグメント距離の二乗

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

Definition at line 101 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const Ray &  ray  )  const
 

レイ距離の二乗

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

Definition at line 96 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const Plane &  plane  )  const [inline]
 

平面距離の二乗

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

Definition at line 475 of file Sphere.h.

References getDistance().

float Lamp::Sphere::getSquaredDistance (  const OrientedBox &  orientedBox  )  const
 

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

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

Definition at line 86 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const Line &  line  )  const
 

ライン距離の二乗

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

Definition at line 81 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const Cone &  cone  )  const
 

コーン距離の二乗

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

Definition at line 76 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const Capsule &  capsule  )  const
 

カプセル距離の二乗

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

Definition at line 71 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const AxisAlignedBox &  axisAlignedBox  )  const
 

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

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

Definition at line 66 of file Sphere.cpp.

float Lamp::Sphere::getSquaredDistance (  const Vector3 &  point  )  const
 

点距離の二乗

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

Definition at line 61 of file Sphere.cpp.

Referenced by getDistance().

bool Lamp::Sphere::intersect (  Intersection *  intersection,
const Triangle &  triangle
)  const
 

三角交差

Parameters:
intersection 交差、返り値がtrueなら設定されている
triangle 交差判定する三角
Returns:
交差していればtrue

Definition at line 178 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Triangle &  triangle  )  const
 

三角交差

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

Definition at line 173 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  Intersection *  intersection,
const Sphere &  sphere
)  const
 

球交差

Parameters:
intersection 交差、返り値がtrueなら設定されている
sphere 交差判定する球
Returns:
交差していればtrue

Definition at line 168 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Sphere &  sphere  )  const
 

球交差

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

Definition at line 163 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Segment &  segment  )  const
 

セグメント交差

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

Definition at line 158 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Ray &  ray  )  const
 

レイ交差

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

Definition at line 153 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Plane &  plane  )  const
 

平面交差

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

Definition at line 148 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const OrientedBox &  orientedBox  )  const
 

指向性ボックス交差

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

Definition at line 143 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Line &  line  )  const
 

ライン交差

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

Definition at line 138 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Cone &  cone  )  const
 

コーン交差

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

Definition at line 128 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Capsule &  capsule  )  const
 

カプセル交差

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

Definition at line 133 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const AxisAlignedBox &  axisAlignedBox  )  const
 

軸沿いボックス交差

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

Definition at line 123 of file Sphere.cpp.

bool Lamp::Sphere::intersect (  const Vector3 &  point  )  const
 

点交差

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

Definition at line 118 of file Sphere.cpp.

Referenced by Lamp::Camera::clipping(), Lamp::DeformedMeshGeometry::intersectBounding(), and Lamp::StaticSphereCollision::intersection().

bool Lamp::Sphere::isUnit (   )  const [inline]
 

単位球かどうか

Returns:
単位球ならtrueを返す

Definition at line 257 of file Sphere.h.

bool Lamp::Sphere::isZero (   )  const [inline]
 

ゼロ球かどうか

Returns:
ゼロ球ならtrueを返す

Definition at line 249 of file Sphere.h.

const Sphere& Lamp::Sphere::merge (  const Vector3 &  target  )  [inline]
 

マージ

中心が動く。 適切な中心とappendを使用した場合と比べて、球が大きくなってしまう。

Parameters:
target マージするベクトル
Returns:
マージされた球

Definition at line 213 of file Sphere.h.

References Lamp::Vector3::getLength(), and Lamp::Vector3::isZero().

const Sphere& Lamp::Sphere::merge (  const Sphere &  target  )  [inline]
 

マージ

Parameters:
target マージする球
Returns:
マージされた球

Definition at line 182 of file Sphere.h.

References center_, Lamp::Vector3::getLength(), Lamp::Vector3::isZero(), and radius_.

bool Lamp::Sphere::notEpsilonEquals (  const Sphere &  target,
float  epsilon
)  const [inline]
 

球が同じでないかどうか

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

Definition at line 694 of file Sphere.h.

References Assert, center_, Lamp::Vector3::notEpsilonEquals(), and radius_.

bool Lamp::Sphere::operator!= (  const Sphere &  target  )  const [inline]
 

球が同じでないかどうか

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

Definition at line 684 of file Sphere.h.

References center_, and radius_.

bool Lamp::Sphere::operator== (  const Sphere &  target  )  const [inline]
 

球が同じかどうか

Parameters:
target 比較する球
Returns:
同じ値であればtrueを返す

Definition at line 662 of file Sphere.h.

References center_, and radius_.

Sphere Lamp::Sphere::scaledTransform (  const Matrix44 &  matrix  )  const [inline]
 

スケール有りトランスフォーム

一番スケールの大きな軸にあわせて半径が膨らみます。

Parameters:
matrix 乗算する行列
Returns:
変換後の球

Definition at line 343 of file Sphere.h.

References Lamp::Matrix44::m, and Sphere().

Sphere Lamp::Sphere::scaledTransform (  const Matrix34 &  matrix  )  const [inline]
 

スケール有りトランスフォーム

一番スケールの大きな軸にあわせて半径が膨らみます。

Parameters:
matrix 乗算する行列
Returns:
変換後の球

Definition at line 321 of file Sphere.h.

References Lamp::Matrix34::m, and Sphere().

Sphere Lamp::Sphere::scaledTransform (  const Matrix33 &  matrix  )  const [inline]
 

スケール有りトランスフォーム

一番スケールの大きな軸にあわせて半径が膨らみます。

Parameters:
matrix 乗算する行列
Returns:
変換後の球

Definition at line 299 of file Sphere.h.

References Lamp::Matrix33::m, and Sphere().

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

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

値の設定

Parameters:
source 設定値配列

Definition at line 132 of file Sphere.h.

References Lamp::Vector3::set().

void Lamp::Sphere::set (  float  centerX,
float  centerY,
float  centerZ,
float  radius
)  [inline]
 

値の設定

Parameters:
centerX 設定する中心X
centerY 設定する中心Y
centerZ 設定する中心Z
radius 設定する半径

Definition at line 123 of file Sphere.h.

References Lamp::Vector3::set().

void Lamp::Sphere::set (  const Vector3 &  center,
float  radius
)  [inline]
 

値の設定

Parameters:
center 設定する中心
radius 設定する半径

Definition at line 111 of file Sphere.h.

Referenced by Lamp::DeformedMeshGeometry::calculateBounding(), Lamp::Camera::clippingSetup(), and Lamp::StaticSphereCollision::setSphere().

void Lamp::Sphere::setCenter (  const Vector3 &  center  )  [inline]
 

中心の設定

Parameters:
center 設定する中心

Definition at line 151 of file Sphere.h.

void Lamp::Sphere::setCenter (  float  centerX,
float  centerY,
float  centerZ
)  [inline]
 

中心の設定

Parameters:
centerX 設定する中心X
centerY 設定する中心Y
centerZ 設定する中心Z

Definition at line 143 of file Sphere.h.

References Lamp::Vector3::set().

Referenced by Lamp::TextSceneLoader::readSphere(), Lamp::TextCollisionLoader::readSphere(), and Lamp::StaticSphereCollision::setCenter().

void Lamp::Sphere::setRadius (  float  radius  )  [inline]
 

半径の設定

Parameters:
radius 設定する半径

Definition at line 157 of file Sphere.h.

Referenced by Lamp::CalculateBoundingSphereFilter::filterMesh(), Lamp::TextSceneLoader::readSphere(), Lamp::TextCollisionLoader::readSphere(), and Lamp::StaticSphereCollision::setRadius().

String Lamp::Sphere::toString (   )  const [inline]
 

文字列化

Returns:
球の文字列表記

Definition at line 708 of file Sphere.h.

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

Sphere Lamp::Sphere::transform (  const Matrix44 &  matrix  )  const [inline]
 

トランスフォーム

Parameters:
matrix 乗算する行列
Returns:
変換後の球

Definition at line 287 of file Sphere.h.

References Sphere().

Sphere Lamp::Sphere::transform (  const Matrix34 &  matrix  )  const [inline]
 

トランスフォーム

Parameters:
matrix 乗算する行列
Returns:
変換後の球

Definition at line 278 of file Sphere.h.

References Sphere().

Sphere Lamp::Sphere::transform (  const Matrix33 &  matrix  )  const [inline]
 

トランスフォーム

Parameters:
matrix 乗算する行列
Returns:
変換後の球

Definition at line 269 of file Sphere.h.

References Sphere().

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


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