// Draws the current animation set on every draw call
// When an animation set has ended, increase the index pointer
// Call the next animation set by setting it up
void AnimManager::draw(){
    AnimSet* animSet = animSetArr[currentIndex];
		
    if(animSet->getHasEnded()){
        currentIndex = (currentIndex+1)%animSetArr.size();
        animSetArr[currentIndex]->setup();
        std::cout << "New draw\n";
    }else{
        animSet->draw();
    }
		
	 	//animSet->draw();
}
Exemple #2
0
/*
====================
init
====================
*/
VOID Game::init()
{
    // create the graph context
    mGraphPtr = GNEW(Graph);
    CHECK(mGraphPtr);

    // test the pawn
    mPawnPtr = GNEW(Pawn);
    CHECK(mPawnPtr);
    {
        // set the animation set
        AnimSet* set = GNEW(AnimSet);
        CHECK(set);
        {
            set->Load(GLoad("model/NPC_F006/NPC_F006.G3DA"));
        }
        mPawnPtr->SetAnimSet(set);

        // add the skeletal mesh
        SkeletalMesh* mesh = GNEW(SkeletalMesh);
        CHECK(mesh);
        {
            mesh->Load(GLoad("model/NPC_F006/NPC_F006.G3DS"));
        }
        mPawnPtr->AddSkeletalMesh("body", mesh);
    }
    /*
    		// create the shape
    		mBoxPtr = GNEW(Box); CHECK(mBoxPtr);
    		mCapsulePtr = GNEW(Capsule); CHECK(mCapsulePtr);
    		mConePtr = GNEW(Cone); CHECK(mConePtr);
    		mCylinderPtr = GNEW(Cylinder); CHECK(mCylinderPtr);
    		mSpherePtr = GNEW(Sphere); CHECK(mSpherePtr);
    		mConePtr->type(Primitive::PT_LINE_LOOP);
    */
    build();

    mAngle = 0.0f;
}
Exemple #3
0
AnimSet* AnimSetManager::LoadResource( const char *filename )
{
	AnimSet *as = new AnimSet;
	as->Load( filename );
	return as;
}