mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
various stuff in opengl demos such as a better model,
stable trackball for the fly navigation mode, and started to put some GUI elements...
This commit is contained in:
@@ -42,8 +42,7 @@ Camera::Camera()
|
||||
mVpX = 0;
|
||||
mVpY = 0;
|
||||
|
||||
setPosition(Vector3f::Constant(50.));
|
||||
|
||||
setPosition(Vector3f::Constant(100.));
|
||||
setTarget(Vector3f::Zero());
|
||||
}
|
||||
|
||||
@@ -179,6 +178,14 @@ void Camera::rotateAroundTarget(const Quaternionf& q)
|
||||
mViewIsUptodate = true;
|
||||
}
|
||||
|
||||
void Camera::localRotate(const Quaternionf& q)
|
||||
{
|
||||
float dist = (position() - mTarget).norm();
|
||||
setOrientation(orientation() * q);
|
||||
mTarget = position() + dist * direction();
|
||||
mViewIsUptodate = false;
|
||||
}
|
||||
|
||||
void Camera::zoom(float d)
|
||||
{
|
||||
float dist = (position() - mTarget).norm();
|
||||
|
||||
Reference in New Issue
Block a user