Browse Source

Fixed transform inheritance in Scene. I just can't get it right on first try.

vectorfields
Vladimír Vondruš 16 years ago
parent
commit
5ab557eb05
  1. 2
      src/Scene.cpp

2
src/Scene.cpp

@ -55,7 +55,7 @@ void Scene::draw() {
void Scene::drawChildren(AbstractObject* object, const Matrix4& transformationMatrix) { void Scene::drawChildren(AbstractObject* object, const Matrix4& transformationMatrix) {
for(set<AbstractObject*>::const_iterator it = object->children().begin(); it != object->children().end(); ++it) { for(set<AbstractObject*>::const_iterator it = object->children().begin(); it != object->children().end(); ++it) {
/* Transformation matrix for the object */ /* Transformation matrix for the object */
Matrix4 matrix = (*it)->transformation()*transformationMatrix; Matrix4 matrix = transformationMatrix*(*it)->transformation();
/* Draw the object and its children */ /* Draw the object and its children */
(*it)->draw(matrix, _camera->projectionMatrix()); (*it)->draw(matrix, _camera->projectionMatrix());

Loading…
Cancel
Save