Springhead
An open source physics engine for virtual reality, haptics and motion generation.
クラス テンプレート TPose< ET >

姿勢.位置と向きを表すクラス. TQuaternionTVec3 で向きと位置を表す. TAffineの代わりに使える.

#include <TQuaternion.h>

TPose< ET >に対する継承グラフ

Public 型

typedef TVecDesc< TPose< ET >, ET > desc
 
typedef PTM::TVectorBase< 4, descbase_type
 
- Public 型 inherited from VectorImp< TVecDesc< TPose< ET >, ET > >
typedef TVecDesc< TPose< ET >, ET > desc
 
typedef TYPENAME desc::exp_type exp_type
 
typedef TYPENAME desc::ret_type ret_type
 
typedef TYPENAME desc::element_type element_type
 
typedef TYPENAME desc::zero zero
 

Public メソッド

 DEF_TVECTOR_BASIC_MEMBER (TPose)
 継承されない基本的なメンバの定義. [詳細]
 
ET & item_impl (size_t i)
 要素のアクセス
 
const ET & item_impl (size_t i) const
 要素のアクセス
 
size_t stride_impl () const
 ストライド
 
TVec3< ET > & Pos ()
 要素のアクセス
 
const TVec3< ET > & Pos () const
 
TQuaternion< ET > & Ori ()
 
const TQuaternion< ET > & Ori () const
 
ET & W ()
 
const ET & W () const
 
ET & X ()
 
const ET & X () const
 
ET & Y ()
 
const ET & Y () const
 
ET & Z ()
 
const ET & Z () const
 
ET & Px ()
 
const ET & Px () const
 
ET & Py ()
 
const ET & Py () const
 
ET & Pz ()
 
const ET & Pz () const
 
要素へのアクセス
ET & PosX ()
 
const ET & PosX () const
 
ET & PosY ()
 
const ET & PosY () const
 
ET & PosZ ()
 
const ET & PosZ () const
 
ET & OriX ()
 
const ET & OriX () const
 
ET & OriY ()
 
const ET & OriY () const
 
ET & OriZ ()
 
const ET & OriZ () const
 
ET & OriW ()
 
const ET & OriW () const
 
TPose< ET > Inv () const
 
初期化・構築
template<class TW , class TX , class TY , class TZ , class TPX , class TPY , class TPZ >
 TPose (TW wi, TX xi, TY yi, TZ zi, TPX pxi, TPY pyi, TPZ pzi)
 コンストラクタ
 
template<class AT >
 TPose (const TAffine< AT > &af)
 
- Public メソッド inherited from TVectorBase< 7, TVecDesc< TPose< ET >, ET > >
size_t size_impl () const
 
void resize_impl (size_t sz)
 
- Public メソッド inherited from VectorImp< TVecDesc< TPose< ET >, ET > >
 VectorImp ()
 コンストラクタ
 
exp_type & exp ()
 実体の取得
 
const exp_type & exp () const
 
const element_type & item (size_t n) const
 n番目の要素を返す(基数は0).
 
element_type & item (size_t n)
 
size_t size () const
 サイズの取得
 
void resize (size_t sz)
 サイズの設定
 
void resize (size_t sz, const element_type v)
 サイズの設定とベクトルの要素を全てvにする
 
size_t stride () const
 ストライドの取得
 
TVectorSlice< SZ::SIZE,
SZ::STRIDE, desc > & 
t_slice (SZ)
 スライスを返す.テンプレート版 このベクトルのSZ::OFFSET要素から SZ::OFFSET + SZ::SIZE要素までの 部分ベクトルへの参照を返す. [詳細]
 
const TVectorSlice< SZ::SIZE,
SZ::STRIDE, desc > & 
t_slice (SZ) const
 
TVectorSlice< SZ::SIZE,
SZ::STRIDE, desc > & 
t_slice (size_t off, SZ)
 スライスを返す.サイズだけテンプレート版 このベクトルの off 要素から off + SZ::SIZE要素までの 部分ベクトルへの参照を返す. [詳細]
 
const TVectorSlice< SZ::SIZE,
SZ::STRIDE, desc > & 
t_slice (size_t off, SZ) const
 
TSubVector< SZ::SIZE, desc > & sub_vector (SZ)
 部分ベクトルを返す.テンプレート版
 
const TSubVector< SZ::SIZE,
desc > & 
sub_vector (SZ) const
 
TSubVector< SZ::SIZE, desc > & sub_vector (size_t off, SZ)
 部分ベクトルを返す.サイズだけテンプレート版
 
const TSubVector< SZ::SIZE,
desc > & 
sub_vector (size_t off, SZ) const
 
EVectorSlice< element_type > v_range (size_t off, size_t sz)
 部分ベクトルを返す.変数版
 
ConstEVectorSlice< element_type > v_range (size_t off, size_t sz) const
 
EVectorSlice< element_type > v_slice (size_t off, size_t sz, size_t str)
 ベクトルのスライスを返す.
 
ConstEVectorSlice< element_type > v_slice (size_t off, size_t sz, size_t str) const
 
void clear (const element_type v=zero(0))
 ベクトルの要素を全てvにする. [詳細]
 
void assign (const VectorImp< B > &b)
 代入(*this = b). [詳細]
 
void assign (const element_type *b)
 代入(*this = b). [詳細]
 
void add (const VectorImp< B > &b)
 加算(*this += b). [詳細]
 
void sub (const VectorImp< B > &b)
 減算(*this -= b). [詳細]
 
void multi (const element_type &b)
 定数倍(*this *= b). [詳細]
 
void div (const element_type &b)
 定数分の1(*this /= b). [詳細]
 
element_type dot (const VectorImp< B > &b) const
 内積(return *this * b). [詳細]
 
bool equal (const VectorImp< B > &b) const
 比較(return *this == b). [詳細]
 
void element_min (const VectorImp< B > &b)
 要素ごとの最小値(min(*this, b)). [詳細]
 
void element_max (const VectorImp< B > &b)
 要素ごとの最大値(max(*this, b)). [詳細]
 
element_type square () const
 ベクトルのノルム(大きさ)の2乗を返す.
 
element_type norm () const
 ベクトルのノルム(大きさ)を返す.
 
void unitize ()
 単位ベクトルにする.
 
void clip (const VectorImp< BD > &b, const VectorImp< ED > &e)
 クリッピングする(bとeを頂点とする矩形内に収まるようにする).
 
void print (std::ostream &os, const char *sep="( )") const
 表示. [詳細]
 
void input (T &is)
 表示. [詳細]
 
element_type & operator[] (I n)
 [] 演算子(基数は0).
 
const element_type & operator[] (I n) const
 [] 演算子(基数は0) (const 版).
 
 operator element_type * ()
 element_type * への変換
 
 operator const element_type * () const
 
ret_type operator* (element_type b) const
 ベクトルのスカラー倍(return this * b). [詳細]
 
ret_type operator/ (element_type b) const
 ベクトルのスカラー分の1(return this / b). [詳細]
 
ret_type operator+= (const VectorImp< BD > &b)
 += 演算子(*this = *this + b). [詳細]
 
ret_type operator-= (const VectorImp< BD > &b)
 -= 演算子(*this = *this - b) [詳細]
 
ret_type operator*= (T b)
 *= 演算子 (*this = *this * b) [詳細]
 
ret_type operator/= (T b)
 /= 演算子 (*this = 1/b * *this). [詳細]
 
ret_type operator- () const
 
ret_type unit () const
 単位ベクトルを返す.
 

Public 変数

union {
   ET   data [7]
 
   struct {
      ET   w
 
      ET   x
 
      ET   y
 
      ET   z
 
      ET   px
 
      ET   py
 
      ET   pz
 
   } 
 
}; 
 

Protected メソッド

void set_default ()
 コンストラクタ
 
- Protected メソッド inherited from VectorImp< TVecDesc< TPose< ET >, ET > >
void init_buffer ()
 バッファの初期化.何もしない.
 
void set_default ()
 デフォルトコンストラクタ
 

初期化と構築

 TPose (const TVec3< ET > &p, const TQuaternion< ET > &q=TQuaternion< ET >())
 
template<class AT >
void FromAffine (const TAffine< AT > &f)
 Affine変換の行列から読み出します. [詳細]
 
template<class B >
void ToAffine (TAffine< B > &af) const
 Affine変換の行列に変換し返す [詳細]
 
 operator TAffine< ET > ()
 
static TPose< ET > Unit ()
 単位行列
 
static TPose< ET > Trn (element_type px, element_type py, element_type pz)
 平行移動
 
static TPose< ET > Trn (const TVec3< ET > &v)
 
static TPose< ET > Rot (ET wi, ET xi, ET yi, ET zi)
 回転
 
static TPose< ET > Rot (ET angle, const TVec3< element_type > &axis)
 
static TPose< ET > Rot (ET angle, char axis)
 
static TPose< ET > Rot (const TVec3< ET > &rot)
 
static TPose< ET > Rot (const TQuaternion< ET > &q)
 

Additional Inherited Members

- Static Public 変数 inherited from TVectorBase< 7, TVecDesc< TPose< ET >, ET > >
static const size_t SIZE
 

関数

DEF_TVECTOR_BASIC_MEMBER ( TPose< ET >  )
参照
::DEF_TVECTOR_BASIC_MEMBER
void FromAffine ( const TAffine< AT > &  f)
inline

Affine行列の位置ベクトルにposeの位置をコピーする

Oriからできる行列をAffine行列の対応する場所に上書き

void ToAffine ( TAffine< B > &  af) const
inline

Affine行列の位置ベクトルにposeの位置をコピーする

Oriからできる行列をAffine行列の対応する場所に上書き


このクラスの説明は次のファイルから生成されました: