| 83 | } |
| 84 | |
| 85 | void Camera::Update() |
| 86 | { |
| 87 | if(!dirty) |
| 88 | return; |
| 89 | |
| 90 | if(type == CameraType::FPSLook) |
| 91 | { |
| 92 | Matrix4f p = Matrix4f::Translation(-pos); |
| 93 | Matrix4f r = Matrix4f::RotationXYZ(-angles); |
| 94 | |
| 95 | mat = r.Mul(p); |
| 96 | basis = mat.Transpose(); |
| 97 | } |
| 98 | else |
| 99 | { |
| 100 | Matrix4f p = Matrix4f::Translation(-pos); |
| 101 | Matrix4f r = arcrot.GetMatrix(); |
| 102 | Matrix4f d = Matrix4f::Translation(Vec3f(0.0f, 0.0f, dist)); |
| 103 | |
| 104 | mat = d.Mul(r.Mul(p)); |
| 105 | basis = mat.Transpose(); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | const Matrix4f Camera::GetMatrix() |
| 110 | { |