snowman now rotates around

master
Martin Felis 2017-02-20 10:49:39 +01:00
parent a49290885e
commit 3c6752ed34
1 changed files with 9 additions and 2 deletions

View File

@ -105,11 +105,18 @@ void CharacterEntity::update(float dt) {
position[1],
position[2]);
gRenderer->drawDebugSphere (Vector3f (0.f, 1.3 + sin(cur_time * 2.f), 0.f), 2.2f);
Quaternion quat (-cos(cur_time), 0.0f, 0.0f * sin(cur_time), 1.0f);
quat.normalize();
entity->mesh.localTransforms[0].rotation = quat;
// update matrices
entity->mesh.updateMatrices(entity->transform.toMatrix());
cur_time += dt;
gRenderer->drawDebugSphere (Vector3f (0.f, 1.3 + sin(cur_time * 2.f), 0.f), 2.2f);
}
void ShowCharacterPropertiesWindow (CharacterEntity* character) {