복수의 애니메이션 데이터를 불러오는 경우도 필요한 수의 ActTabl을 준비하여 각각에 대해 OEMC_Micro3D_ActTable_loadMtraData() 를 이용합니다.
샘플에서는 결정 키를 누를 때 마다 액션이 바뀝니다.
/**
* cap.act[] 는 액션 데이터용 배열
* cap.actIndex 는 액션 데이터 선택용 변수
*/
OEMC_Micro3D_ActTable_initialize( &cap.act[0], g_IAllocator );
OEMC_Micro3D_ActTable_initialize( &cap.act[1], g_IAllocator );
/* 액션 데이터의 Load */
MemIstream_initialize( &mis, cap_back.addr, cap_back.size );
rval = OEMC_Micro3D_ActTable_loadMtraData(
MemIstream_initialize( &mis, cap_walk.addr, cap_walk.size );
rval = OEMC_Micro3D_ActTable_loadMtraData(
cap.actIndex = 0;
/* 액션 데이터의 설정 */
int maxframe =
OEMC_Micro3D_ActTable_getNumFrames(
cap.currentFrame += 65536 * g_dif_time * 30 / 1000;
if ( maxframe != 0 ) {
OEMC_Micro3D_Figure_setPosture( &cap.fig,
/* 액션 데이터의 변환 */
cap.actIndex++;
if ( cap.actIndex > 1 )
* cap.act[] 는 액션 데이터용 배열
* cap.actIndex 는 액션 데이터 선택용 변수
*/
OEMC_Micro3D_ActTable_initialize( &cap.act[0], g_IAllocator );
OEMC_Micro3D_ActTable_initialize( &cap.act[1], g_IAllocator );
/* 액션 데이터의 Load */
MemIstream_initialize( &mis, cap_back.addr, cap_back.size );
rval = OEMC_Micro3D_ActTable_loadMtraData(
&cap.act[0], MemIstream_getIIstream( &mis ) );
if ( !rval )
return HI_FALSE;
MemIstream_initialize( &mis, cap_walk.addr, cap_walk.size );
rval = OEMC_Micro3D_ActTable_loadMtraData(
&cap.act[1], MemIstream_getIIstream( &mis ) );
if ( !rval )
return HI_FALSE;
cap.actIndex = 0;
/* 액션 데이터의 설정 */
int maxframe =
OEMC_Micro3D_ActTable_getNumFrames(
&cap.act[cap.actIndex], cap.actID );
cap.currentFrame += 65536 * g_dif_time * 30 / 1000;
if ( maxframe != 0 ) {
if ( cap.currentFrame > maxframe )
} else {
cap.currentFrame -= maxframe;
cap.currentFrame = 0;
}OEMC_Micro3D_Figure_setPosture( &cap.fig,
&cap.act[cap.actIndex], cap.actID, cap.currentFrame );
/* 액션 데이터의 변환 */
cap.actIndex++;
if ( cap.actIndex > 1 )
cap.actIndex = 0;

Sample_Animation 실행 화면
(왼/한가운데쪽 화면 :
걸음의 액션
,
오른쪽 화면 :
덤블링(백공)의 액션
)

