Open Ahbee opened 3 years ago
changing it to what lookAt
does seems fix it
void Camera::setViewDirection(const glm::dvec3& viewDirection)
{
mViewDirection = normalize(viewDirection);
mOrientation = glm::toQuat(alignZAxisWithTarget(-mViewDirection, mWorldUp));
mModelViewCached = false;
}
running this code after the line
cp.setOrientation(cp.getOrientation());
the view Direction of the camera flips to {0,-1,0}. This looks likesetViewDirection
is not setting the orientation correctly