This commit is contained in:
Vadim Lopatin 2016-04-04 17:00:35 +03:00
parent b00d3265cd
commit d8bca0d935
2 changed files with 13 additions and 2 deletions

View File

@ -115,8 +115,9 @@ class UiWidget : VerticalLayout, CellVisitor {
_scene.activeCamera = _cam;
Node3d dirLightNode = new Node3d();
dirLightNode.rotateY(-15);
dirLightNode.rotateX(20);
dirLightNode.lookAt(vec3(-5, -5, -5), vec3(0, 0, 0), vec3(0, 1, 0));
//dirLightNode.rotateY(-15);
//dirLightNode.rotateX(20);
dirLightNode.light = Light.createDirectional(vec3(1, 0.5, 0.5));
_scene.addChild(dirLightNode);

View File

@ -116,4 +116,14 @@ class Transform : RefCountedObject {
}
return _matrix;
}
@property void matrix(ref const(mat4) m) {
_matrix = m;
_dirtyTransform = false;
}
void lookAt(const vec3 eye, const vec3 center, const vec3 up) {
_matrix.lookAt(eye, center, up);
_dirtyTransform = false;
}
}