SetAnimationFrame

Sets an entity to a specific animation frame.

Syntax

Parameters

Example

#include "Leadwerks.h"

using namespace Leadwerks;
Entity* entity = NULL;
int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
World* world = World::Create();
Camera* camera = Camera::Create();
camera->Turn(0, 90, 0);
camera->Move(0, 1, -2);
Light* light = DirectionalLight::Create();
light->SetRotation(35, 35, 0);

//Load a model
Model* model = Model::Load("Models/Trees/pine01.mdl");


while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;

model->SetAnimationFrame(Leadwerks::Time::GetCurrent() / 100.0, 1, 2);

Leadwerks::Time::Update();
world->Update();
world->Render();
context->Sync();
}
return 0;
}