Skip to content
Browse files

Adapted to Magnum changes.

  • Loading branch information...
1 parent b2ce52a commit 4a73ac8e33ab2ad7a8357dfd760c319aa7fb8263 @mosra committed Apr 16, 2012
Showing with 6 additions and 6 deletions.
  1. +3 −3 src/cubemap/CubeMapExample.cpp
  2. +1 −1 src/cubemap/Reflector.cpp
  3. +2 −2 src/viewer/ViewerExample.cpp
View
6 src/cubemap/CubeMapExample.cpp
@@ -68,13 +68,13 @@ class CubeMapExample: public AbstractExample {
void keyEvent(Key key, const Magnum::Math::Vector2<int>& position) {
if(key == Key::Up)
- camera->rotate(deg(-10.0f), camera->transformation().at(0).xyz(), true);
+ camera->rotate(deg(-10.0f), camera->transformation()[0].xyz(), true);
if(key == Key::Down)
- camera->rotate(deg(10.0f), camera->transformation().at(0).xyz(), true);
+ camera->rotate(deg(10.0f), camera->transformation()[0].xyz(), true);
if(key == Key::Left || key == Key::Right) {
- GLfloat yTransform = camera->transformation().at(2, 3);
+ GLfloat yTransform = camera->transformation()[3][2];
camera->translate(Vector3::yAxis(-yTransform));
if(key == Key::Left)
camera->rotate(deg(10.0f), Vector3::yAxis(), true);
View
2 src/cubemap/Reflector.cpp
@@ -41,7 +41,7 @@ void Reflector::draw(const Matrix4& transformationMatrix, Camera* camera) {
shader()->setModelViewMatrixUniform(transformationMatrix);
shader()->setProjectionMatrixUniform(camera->projectionMatrix());
Matrix4 cameraMatrix = camera->absoluteTransformation();
- cameraMatrix.set(3, Vector4());
+ cameraMatrix[3] = Vector4();
shader()->setReflectivityUniform(2.0f);
shader()->setDiffuseColorUniform(Vector3(0.3f, 0.3f, 0.3f));
shader()->setCameraMatrixUniform(cameraMatrix);
View
4 src/viewer/ViewerExample.cpp
@@ -110,7 +110,7 @@ class ViewerExample: public FpsCounterExample {
if(state == MouseState::Up) return;
/* Distance between origin and near camera clipping plane */
- GLfloat distance = camera->transformation().at(3).z()-0-camera->near();
+ GLfloat distance = camera->transformation()[3].z()-0-camera->near();
/* Move 15% of the distance back or forward */
if(button == MouseButton::WheelUp)
@@ -133,7 +133,7 @@ class ViewerExample: public FpsCounterExample {
if(previousPosition.length() < 0.001f || axis.length() < 0.001f) return;
- GLfloat angle = acos(previousPosition*currentPosition);
+ GLfloat angle = acos(Vector3::dot(previousPosition, currentPosition));
o->rotate(angle, axis);
previousPosition = currentPosition;

0 comments on commit 4a73ac8

Please sign in to comment.
Something went wrong with that request. Please try again.