void Camera::rotateYX(REAL ay, REAL ax) //[]---------------------------------------------------[] //| Rotate YX. | //| | //| Composition of an azimuth of ay with an elavation | //| of ax (in degrees). | //[]---------------------------------------------------[] { if (Math::isZero(ay)) { elevation(ax); return; } Transf3 r; r.rotation(focalPoint, viewUp, Math::toRadians<REAL>(ay)); if (!Math::isZero(ax)) { Vec3 axis = directionOfProjection.cross(viewUp); Transf3 q; q.rotation(focalPoint, axis, Math::toRadians<REAL>(ax)); q.transformVectorRef(viewUp); r.compose(q); } r.transformRef(position); updateDOP(); }
void Camera::roll(REAL angle) //[]---------------------------------------------------[] //| Roll. | //| | //| Rotate the view up vector around the view plane | //| normal | //[]---------------------------------------------------[] { if (!Math::isZero(angle)) { Transf3 r; r.rotation(directionOfProjection, -Math::toRadians<REAL>(angle)); r.transformVectorRef(viewUp); viewModified = true; } }