NNS_G2dSetTrans

構文

#include <nnsys/g2d/g2d_Renderer.h>
void NNS_G2dSetTrans(fx32 x, fx32 y, fx32 z );
  

引数

x [IN] 平行移動 x
y [IN] 平行移動 y
z [IN] 平行移動 z

返り値

なし

説明

レンダラ内部の カレント行列の 平行移動 成分を設定します。
行列スタックのPushPop動作を回避可能な場合は、処理効率の向上が見込めます。

コード例:
//------------------------------------------
// NNS_G2dTranslate  を使用する場合
for( i = 0;i < N; i++ )
{
    NNS_G2dPushMtx();
        NNS_G2dTranslate( gameObjs[i].pos.x,
                          gameObjs[i].pos.y,
                          gameObjs[i].pos.z );
        NNS_G2dDrawCell( gameObjs[i].pCell );
    NNS_G2dPopMtx(1);
}
//------------------------------------------
// NNS_G2dSetTrans  を使用する場合
for( i = 0;i < N; i++ )
{
    // NNS_G2dPushMtx();// 不要
        NNS_G2dSetTrans( gameObjs[i].pos.x,
                         gameObjs[i].pos.y,
                         gameObjs[i].pos.z );
        NNS_G2dDrawCell( gameObjs[i].pCell );
    // NNS_G2dPopMtx(1);// 不要
}

参照

NNS_G2dTranslate
NNS_G2dRotZ
NNS_G2dScale

履歴

2004/11/10 初版