13 using namespace Eigen;
20 bool newPointOk = mapToSphere(point2D, newPoint3D);
22 if (mLastPointOk && newPointOk)
24 Vector3f axis = mLastPoint3D.cross(newPoint3D).normalized();
25 float cos_angle = mLastPoint3D.dot(newPoint3D);
28 float angle = 2. *
acos(cos_angle);
36 mLastPoint3D = newPoint3D;
37 mLastPointOk = newPointOk;
42 if ((
p2.x() >= 0) && (
p2.x() <=
int(mpCamera->vpWidth())) &&
43 (
p2.y() >= 0) && (
p2.y() <=
int(mpCamera->vpHeight())) )
45 double x = (double)(
p2.x() - 0.5*mpCamera->vpWidth()) / (
double)mpCamera->vpWidth();
46 double y = (double)(0.5*mpCamera->vpHeight() -
p2.y()) / (
double)mpCamera->vpHeight();
49 double sinx2siny2 = sinx * sinx + siny * siny;
53 v3.z() = sinx2siny2 < 1.0 ?
sqrt(1.0 - sinx2siny2) : 0.0;