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

# Lamp::Quaternion Class Reference

四元数 More...

`#include <Quaternion.h>`

List of all members.

## Public Member Functions
| Quaternion ()
| コンストラクタ
| Quaternion (float sourceX, float sourceY, float sourceZ, float sourceW)
| コンストラクタ
| Quaternion (const float *const source)
| コンストラクタ
void | set (float sourceX, float sourceY, float sourceZ, float sourceW)
| 値の設定
void | set (const float *const source)
| 値の設定
void | setZero ()
| ゼロ四元数の設定
void | setIdentity ()
| 恒等四元数の設定
void | setRotationAxis (const Vector3 &axis, float radian)
| 軸指定回転の設定
void | addRotationAxis (const Vector3 &axis, float radian)
| 軸指定回転の追加
void | getRotationAxis (Vector3 *axis, float *radian) const
| 軸指定回転の取得
void | setRotationXYZ (const Vector3 &radian)
| XYZ軸回転の設定.
void | addRotationXYZ (const Vector3 &radian)
| XYZ軸回転の追加.
bool | getRotationXYZ (Vector3 *radian) const
| XYZ軸回転の取得.
void | setRotationZYX (const Vector3 &radian)
| ZYX軸回転の設定.
void | addRotationZYX (const Vector3 &radian)
| ZYX軸回転の追加.
bool | getRotationZYX (Vector3 *radian) const
| ZYX軸回転の取得.
Quaternion | operator+ (const Quaternion &addQuaternion) const
| 加算
Quaternion | operator- (const Quaternion &subQuaternion) const
| 減算
Quaternion | operator * (const Quaternion &mulQuat) const
| 乗算
Quaternion | operator * (float mulValue) const
| 乗算
Vector3 | operator * (const Vector3 &mulVector) const
| ベクトル乗算
Quaternion | operator+ () const
| +演算子
Quaternion | operator- () const
| -演算子
Quaternion & | operator+= (const Quaternion &addQuaternion)
| 代入加算
Quaternion & | operator-= (const Quaternion &subQuaternion)
| 代入減算
Quaternion & | operator *= (const Quaternion &mulQuat)
| 代入乗算
Quaternion & | operator *= (float mulValue)
| 代入乗算
float | getLength () const
| 長さの取得
bool | isZero () const
| ゼロ四元数かどうか
bool | isUnit () const
| 単位四元数かどうか
Quaternion & | normalize ()
| 正規化
float | getNorm () const
| ノルムの取得
Quaternion & | conjugate ()
| 共役
float | dotProduct (const Quaternion &dotQuaternion) const
| 内積
Quaternion & | invert ()
| 逆四元数
Quaternion & | unitInvert ()
| 単位逆四元数
bool | operator== (const Quaternion &target) const
| 四元数が同じかどうか
bool | epsilonEquals (const Quaternion &target, float epsilon) const
| 四元数が同じかどうか
bool | operator!= (const Quaternion &target) const
| 四元数が同じでないかどうか
bool | notEpsilonEquals (const Quaternion &target, float epsilon) const
| 四元数が同じでないかどうか
bool | rotationEquals (const Quaternion &target) const
| 四元数が同じ回転をあらわすかどうか
bool | epsilonRotationEquals (const Quaternion &target, float epsilon) const
| 四元数が同じ回転をあらわすかどうか
String | toString () const
| 文字列化
## Static Public Member Functions
Quaternion | slerp (const Quaternion &source, const Quaternion &target, float alpha)
| 球面線形補間
Quaternion | correctSlerp (const Quaternion &source, const Quaternion &target, float alpha)
| 補正付球面線形補間
Quaternion | squad (const Quaternion &source, const Quaternion &sourceHandle, const Quaternion &targetHandle, const Quaternion &target, float alpha)
| 球面二次補間
Quaternion | correctSquad (const Quaternion &source, const Quaternion &sourceHandle, const Quaternion &targetHandle, const Quaternion &target, float alpha)
| 補正付球面二次補間
## Static Public Attributes
const Quaternion | zero
| ゼロ四元数
const Quaternion | identity
| 恒等四元数
## Friends
Quaternion | operator * (float mulValue, const Quaternion &mulQuaternion)
| 乗算

## Detailed Description

四元数

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

Definition at line 38 of file Quaternion.h.

## Constructor & Destructor Documentation

Lamp::Quaternion::Quaternion | ( |  | ) | `[inline]`

| コンストラクタ このコンストラクタは初期値の設定を行わないため値は不定です。 Definition at line 78 of file Quaternion.h. Referenced by operator *(), operator+(), and operator-().

Lamp::Quaternion::Quaternion | ( | float | sourceX,
|  | float | sourceY,
|  | float | sourceZ,
|  | float | sourceW
| ) | `[inline]`

  | コンストラクタ Parameters:
  sourceX | Xの初期値
  sourceY | Yの初期値
  sourceZ | Zの初期値
  sourceW | Wの初期値
Definition at line 87 of file Quaternion.h. References w, x, y, and z.

Lamp::Quaternion::Quaternion | ( | const float *const | source | ) | `[inline, explicit]`

  | コンストラクタ Parameters:
  source | 初期値配列
Definition at line 96 of file Quaternion.h. References w, x, y, and z.

## Member Function Documentation

void Lamp::Quaternion::addRotationAxis | ( | const Vector3 & | axis,
|  | float | radian
| ) | `[inline]`

  | 軸指定回転の追加 Parameters:
  axis | 回転軸
  radian | ラジアン単位での回転角度
Definition at line 165 of file Quaternion.h. References setRotationAxis().

void Lamp::Quaternion::addRotationXYZ | ( | const Vector3 & | radian | ) | `[inline]`

  | XYZ軸回転の追加. Parameters:
  radian | 各軸におけるラジアン単位での回転角度
Definition at line 212 of file Quaternion.h. References setRotationXYZ().

void Lamp::Quaternion::addRotationZYX | ( | const Vector3 & | radian | ) | `[inline]`

  | ZYX軸回転の追加. Parameters:
  radian | 各軸におけるラジアン単位での回転角度
Definition at line 286 of file Quaternion.h. References setRotationZYX().

Quaternion& Lamp::Quaternion::conjugate | ( |  | ) | `[inline]`

| 共役 Returns: 共役化された四元数 Definition at line 543 of file Quaternion.h. References x, y, and z. Referenced by unitInvert().

Quaternion Lamp::Quaternion::correctSlerp | ( | const Quaternion & | source,
|  | const Quaternion & | target,
|  | float | alpha
| ) | `[inline, static]`

  | 補正付球面線形補間 Parameters:
  source | 補間開始四元数
  target | 補間終了四元数
  alpha | 補間係数
Returns: 補間済み四元数 Definition at line 619 of file Quaternion.h. References Assert, dotProduct(), and isUnit(). Referenced by correctSquad().

Quaternion Lamp::Quaternion::correctSquad | ( | const Quaternion & | source,
|  | const Quaternion & | sourceHandle,
|  | const Quaternion & | targetHandle,
|  | const Quaternion & | target,
|  | float | alpha
| ) | `[inline, static]`

  | 補正付球面二次補間 Parameters:
  source | 補間開始四元数
  sourceHandle | 補間開始四元数ハンドル
  targetHandle | 補間終了四元数ハンドル
  target | 補間終了四元数
  alpha | 補間係数
Returns: 補間済み四元数 Definition at line 668 of file Quaternion.h. References correctSlerp().

float Lamp::Quaternion::dotProduct | ( | const Quaternion & | dotQuaternion | ) | const`[inline]`

  | 内積 Parameters:
  dotQuaternion | 内積をとる四元数
Returns: 内積値 Definition at line 555 of file Quaternion.h. References w, x, y, and z. Referenced by Lamp::RotationInterpolationCompressor::compressConstant(), Lamp::RotationInterpolationCompressor::compressLinear(), correctSlerp(), Lamp::QuaternionArrayInterpolator::correctValue(), Lamp::QuaternionArrayInterpolator::quaternionInterpolate(), Lamp::RotationInterpolationCompressor::recalcLinearError(), and slerp().

bool Lamp::Quaternion::epsilonEquals | ( | const Quaternion & | target,
|  | float | epsilon
| ) | const`[inline]`

  | 四元数が同じかどうか Parameters:
  target | 比較する四元数
  epsilon | 誤差
Returns: 誤差の範囲内で同じ値であればtrueを返す Definition at line 698 of file Quaternion.h. References Assert, w, x, y, and z. Referenced by epsilonRotationEquals().

bool Lamp::Quaternion::epsilonRotationEquals | ( | const Quaternion & | target,
|  | float | epsilon
| ) | const`[inline]`

  | 四元数が同じ回転をあらわすかどうか Parameters:
  target | 比較する四元数
  epsilon | 誤差
Returns: 誤差の範囲内で同じ回転をあらわせばtrueを返す Definition at line 750 of file Quaternion.h. References epsilonEquals().

float Lamp::Quaternion::getLength | ( |  | ) | const`[inline]`

| 長さの取得 Returns: 長さ Definition at line 496 of file Quaternion.h. References w, x, y, and z. Referenced by isUnit(), isZero(), and normalize().

float Lamp::Quaternion::getNorm | ( |  | ) | const`[inline]`

| ノルムの取得 Returns: ノルム Definition at line 535 of file Quaternion.h. References w, x, y, and z. Referenced by invert().

void Lamp::Quaternion::getRotationAxis | ( | Vector3 * | axis,
|  | float * | radian
| ) | const`[inline]`

  | 軸指定回転の取得 Parameters:
  axis | [out]回転軸を格納するベクトルへのポインタ。 回転していないときはゼロベクトル
  radian | [out]ラジアン単位での回転角度を格納するfloatへのポインタ
Definition at line 177 of file Quaternion.h. References array, Assert, isUnit(), Lamp::Vector3::set(), and w.

bool Lamp::Quaternion::getRotationXYZ | ( | Vector3 * | radian | ) | const`[inline]`

  | XYZ軸回転の取得. Parameters:
  radian | [out] 各軸におけるラジアン単位での回転角度
Returns: 答えが単一であればtrue Definition at line 223 of file Quaternion.h. References w, Lamp::Vector3::x, x, Lamp::Vector3::y, y, Lamp::Vector3::z, and z. Referenced by Lamp::PS2PadCameraController::control(), Lamp::QuaternionArrayInterpolator::convertEulerArrayInterpolator(), Lamp::QuaternionLinearInterpolator::eulerInterpolate(), Lamp::QuaternionArrayInterpolator::eulerInterpolate(), Lamp::EulerArrayInterpolator::eulerInterpolate(), Lamp::Axis3::getRotationXYZ(), and Lamp::RotationConstantInterpolator::setQuaternion().

bool Lamp::Quaternion::getRotationZYX | ( | Vector3 * | radian | ) | const`[inline]`

  | ZYX軸回転の取得. Parameters:
  radian | [out] 各軸におけるラジアン単位での回転角度
Returns: 答えが単一であればtrue Definition at line 297 of file Quaternion.h. References w, Lamp::Vector3::x, x, Lamp::Vector3::y, y, Lamp::Vector3::z, and z.

Quaternion& Lamp::Quaternion::invert | ( |  | ) | `[inline]`

| 逆四元数 Returns: 逆四元数 Definition at line 564 of file Quaternion.h. References Assert, getNorm(), isZero(), w, x, y, and z.

bool Lamp::Quaternion::isUnit | ( |  | ) | const`[inline]`

| 単位四元数かどうか Returns: 単位四元数ならtrueを返す Definition at line 512 of file Quaternion.h. References getLength(). Referenced by Lamp::RotationInterpolationCompressor::compressConstant(), correctSlerp(), getRotationAxis(), Lamp::QuaternionArrayInterpolator::quaternionInterpolate(), Lamp::Matrix44::setRotationQuaternion(), Lamp::Matrix34::setRotationQuaternion(), Lamp::Matrix33::setRotationQuaternion(), Lamp::Matrix44::setTransformationQuaternion(), Lamp::Matrix34::setTransformationQuaternion(), slerp(), and unitInvert().

bool Lamp::Quaternion::isZero | ( |  | ) | const`[inline]`

| ゼロ四元数かどうか Returns: ゼロ四元数ならtrueを返す Definition at line 504 of file Quaternion.h. References getLength(). Referenced by invert().

Quaternion& Lamp::Quaternion::normalize | ( |  | ) | `[inline]`

| 正規化 Returns: 正規化された四元数 Definition at line 520 of file Quaternion.h. References Assert, and getLength(). Referenced by Lamp::QuaternionArrayInterpolator::correctValue(), and Lamp::QuaternionArrayInterpolator::setValue().

bool Lamp::Quaternion::notEpsilonEquals | ( | const Quaternion & | target,
|  | float | epsilon
| ) | const`[inline]`

  | 四元数が同じでないかどうか Parameters:
  target | 比較する四元数
  epsilon | 誤差
Returns: 誤差の範囲内で同じでない値であればtrueを返す Definition at line 723 of file Quaternion.h. References Assert, w, x, y, and z.

Vector3 Lamp::Quaternion::operator * | ( | const Vector3 & | mulVector | ) | const`[inline]`

  | ベクトル乗算 Parameters:
  mulVector | 乗算するベクトル
Returns: 乗算されたベクトル Definition at line 409 of file Quaternion.h. References Lamp::Vector3::crossProduct(), w, x, y, and z.

Quaternion Lamp::Quaternion::operator * | ( | float | mulValue | ) | const`[inline]`

  | 乗算 Parameters:
  mulValue | 乗算する値
Returns: 乗算された四元数 Definition at line 384 of file Quaternion.h. References Quaternion(), w, x, y, and z.

Quaternion Lamp::Quaternion::operator * | ( | const Quaternion & | mulQuat | ) | const`[inline]`

  | 乗算 Parameters:
  mulQuat | 乗算する四元数
Returns: 乗算された四元数 Definition at line 369 of file Quaternion.h. References Quaternion(), w, x, y, and z.

Quaternion& Lamp::Quaternion::operator *= | ( | float | mulValue | ) | `[inline]`

  | 代入乗算 Parameters:
  mulValue | 乗算する値
Returns: 乗算された四元数 Definition at line 481 of file Quaternion.h. References w, x, y, and z.

Quaternion& Lamp::Quaternion::operator *= | ( | const Quaternion & | mulQuat | ) | `[inline]`

  | 代入乗算 Parameters:
  mulQuat | 乗算する四元数
Returns: 乗算された四元数 Definition at line 466 of file Quaternion.h. References set(), w, x, y, and z.

bool Lamp::Quaternion::operator!= | ( | const Quaternion & | target | ) | const`[inline]`

  | 四元数が同じでないかどうか Parameters:
  target | 比較する四元数
Returns: 同じでない値であればtrueを返す Definition at line 712 of file Quaternion.h. References w, x, y, and z.

Quaternion Lamp::Quaternion::operator+ | ( |  | ) | const`[inline]`

| +演算子 Returns: 四元数のコピー Definition at line 424 of file Quaternion.h.

Quaternion Lamp::Quaternion::operator+ | ( | const Quaternion & | addQuaternion | ) | const`[inline]`

  | 加算 Parameters:
  addQuaternion | 加算する四元数
Returns: 加算された四元数 Definition at line 343 of file Quaternion.h. References Quaternion(), w, x, y, and z.

Quaternion& Lamp::Quaternion::operator+= | ( | const Quaternion & | addQuaternion | ) | `[inline]`

  | 代入加算 Parameters:
  addQuaternion | 加算する四元数
Returns: 加算された四元数 Definition at line 440 of file Quaternion.h. References w, x, y, and z.

Quaternion Lamp::Quaternion::operator- | ( |  | ) | const`[inline]`

| -演算子 Returns: 値の符号が反転した四元数 Definition at line 430 of file Quaternion.h. References Quaternion(), w, x, y, and z.

Quaternion Lamp::Quaternion::operator- | ( | const Quaternion & | subQuaternion | ) | const`[inline]`

  | 減算 Parameters:
  subQuaternion | 減算する四元数
Returns: 減算された四元数 Definition at line 356 of file Quaternion.h. References Quaternion(), w, x, y, and z.

Quaternion& Lamp::Quaternion::operator-= | ( | const Quaternion & | subQuaternion | ) | `[inline]`

  | 代入減算 Parameters:
  subQuaternion | 減算する四元数
Returns: 減算された四元数 Definition at line 453 of file Quaternion.h. References w, x, y, and z.

bool Lamp::Quaternion::operator== | ( | const Quaternion & | target | ) | const`[inline]`

  | 四元数が同じかどうか Parameters:
  target | 比較する四元数
Returns: 同じ値であればtrueを返す Definition at line 687 of file Quaternion.h. References w, x, y, and z.

bool Lamp::Quaternion::rotationEquals | ( | const Quaternion & | target | ) | const`[inline]`

  | 四元数が同じ回転をあらわすかどうか Parameters:
  target | 比較する四元数
Returns: 同じ回転をあらわせばtrueを返す Definition at line 738 of file Quaternion.h.

void Lamp::Quaternion::set | ( | const float *const | source | ) | `[inline]`

  | 値の設定 Parameters:
  source | 設定値配列
Definition at line 121 of file Quaternion.h. References w, x, y, and z.

void Lamp::Quaternion::set | ( | float | sourceX,
|  | float | sourceY,
|  | float | sourceZ,
|  | float | sourceW
| ) | `[inline]`

  | 値の設定 Parameters:
  sourceX | Xの設定値
  sourceY | Yの設定値
  sourceZ | Zの設定値
  sourceW | Wの設定値
Definition at line 110 of file Quaternion.h. References w, x, y, and z. Referenced by operator *=(), setIdentity(), and setZero().

void Lamp::Quaternion::setRotationAxis | ( | const Vector3 & | axis,
|  | float | radian
| ) | `[inline]`

  | 軸指定回転の設定 Parameters:
  axis | 回転軸
  radian | ラジアン単位での回転角度
Definition at line 150 of file Quaternion.h. References Assert, Lamp::Vector3::isUnit(), w, Lamp::Vector3::x, x, Lamp::Vector3::y, y, Lamp::Vector3::z, and z. Referenced by addRotationAxis(), and Lamp::PS2PadCameraController::control().

void Lamp::Quaternion::setRotationXYZ | ( | const Vector3 & | radian | ) | `[inline]`

  | XYZ軸回転の設定. Parameters:
  radian | 各軸におけるラジアン単位での回転角度
Definition at line 192 of file Quaternion.h. References w, x, Lamp::Vector3::x, y, Lamp::Vector3::y, z, and Lamp::Vector3::z. Referenced by addRotationXYZ(), Lamp::PS2PadCameraController::control(), Lamp::EulerArrayInterpolator::convertQuaternionArrayInterpolator(), Lamp::Axis3::getRotationQuaternion(), Lamp::EulerArrayInterpolator::quaternionInterpolate(), and Lamp::RotationConstantInterpolator::setEuler().

void Lamp::Quaternion::setRotationZYX | ( | const Vector3 & | radian | ) | `[inline]`

  | ZYX軸回転の設定. Parameters:
  radian | 各軸におけるラジアン単位での回転角度
Definition at line 266 of file Quaternion.h. References w, x, Lamp::Vector3::x, y, Lamp::Vector3::y, z, and Lamp::Vector3::z. Referenced by addRotationZYX().

Quaternion Lamp::Quaternion::slerp | ( | const Quaternion & | source,
|  | const Quaternion & | target,
|  | float | alpha
| ) | `[inline, static]`

  | 球面線形補間 Parameters:
  source | 補間開始四元数
  target | 補間終了四元数
  alpha | 補間係数
Returns: 補間済み四元数 Definition at line 593 of file Quaternion.h. References Assert, dotProduct(), and isUnit(). Referenced by squad().

Quaternion Lamp::Quaternion::squad | ( | const Quaternion & | source,
|  | const Quaternion & | sourceHandle,
|  | const Quaternion & | targetHandle,
|  | const Quaternion & | target,
|  | float | alpha
| ) | `[inline, static]`

  | 球面二次補間 Parameters:
  source | 補間開始四元数
  sourceHandle | 補間開始四元数ハンドル
  targetHandle | 補間終了四元数ハンドル
  target | 補間終了四元数
  alpha | 補間係数
Returns: 補間済み四元数 Definition at line 651 of file Quaternion.h. References slerp().

String Lamp::Quaternion::toString | ( |  | ) | const`[inline]`

| 文字列化 Returns: ベクトルの文字列表記 Definition at line 764 of file Quaternion.h. References Lamp::String::format(), w, x, y, and z.

Quaternion& Lamp::Quaternion::unitInvert | ( |  | ) | `[inline]`

| 単位逆四元数 Returns: 逆四元数 Definition at line 578 of file Quaternion.h. References Assert, conjugate(), and isUnit(). Referenced by Lamp::Camera::setTransformation().

## Friends And Related Function Documentation

Quaternion operator * | ( | float | mulValue,
|  | const Quaternion & | mulQuaternion
| ) | `[friend]`

  | 乗算 Parameters:
  mulValue | 乗算する値
  mulQuaternion | 乗算する四元数
Returns: 乗算された四元数 Definition at line 395 of file Quaternion.h.

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

- Quaternion.h
- Quaternion.cpp