

Public Member Functions | |
| DSOPicker (const Point3d &, const Vec3d &, float) | |
| void | process (DeepSkyObject *const &, double, float) |
| ~DSOPicker () | |
Public Attributes | |
| Vec3d | pickDir |
| const DeepSkyObject * | pickedDSO |
| Point3d | pickOrigin |
| double | sinAngle2Closest |
|
||||||||||||||||
|
Definition at line 734 of file universe.cpp. References ANGULAR_RES, and sin(). 00736 : 00737 pickedDSO (NULL), 00738 pickOrigin (pickOrigin), 00739 pickDir (pickDir), 00740 sinAngle2Closest(sin(angle/2.0) > ANGULAR_RES ? sin(angle/2.0) : 00741 ANGULAR_RES ) 00742 { 00743 }
|
|
|
Definition at line 722 of file universe.cpp. 00722 {};
|
|
||||||||||||||||
|
Implements OctreeProcessor< DeepSkyObject *, double >. Definition at line 746 of file universe.cpp. References ANGULAR_RES, Vector3< T >::normalize(), pickDir, pickedDSO, pickOrigin, sinAngle2Closest, sqrt(), testIntersection(), Vector3< T >::x, Point3< T >::x, Vector3< T >::y, Point3< T >::y, Vector3< T >::z, and Point3< T >::z. 00747 {
00748 Vec3d relativeDSOPos = dso->getPosition() - pickOrigin;
00749 Vec3d dsoDir = relativeDSOPos;
00750 dsoDir.normalize();
00751
00752 double sinAngle2 = 0.0;
00753
00754 double distance2;
00755 if (testIntersection(Ray3d(Point3d(0.0, 0.0, 0.0), pickDir),
00756 Sphered(Point3d(0.0, 0.0, 0.0) + relativeDSOPos, (double) dso->getRadius()), distance2))
00757 {
00758 Point3d dsoPos = dso->getPosition();
00759 dsoDir = Vec3d(dsoPos.x * 1.0e-6 - pickOrigin.x,
00760 dsoPos.y * 1.0e-6 - pickOrigin.y,
00761 dsoPos.z * 1.0e-6 - pickOrigin.z);
00762 dsoDir.normalize();
00763 }
00764
00765 Vec3d dsoMissd = dsoDir - Vec3d(pickDir.x, pickDir.y, pickDir.z);
00766 sinAngle2 = sqrt(dsoMissd * dsoMissd)/2.0;
00767
00768 if (sinAngle2 <= sinAngle2Closest)
00769 {
00770 sinAngle2Closest = sinAngle2 > ANGULAR_RES ? sinAngle2 : ANGULAR_RES;
00771 pickedDSO = dso;
00772 }
00773 }
|
|
|
Definition at line 729 of file universe.cpp. Referenced by process(). |
|
|
Definition at line 727 of file universe.cpp. Referenced by Universe::pickDeepSkyObject(), and process(). |
|
|
Definition at line 728 of file universe.cpp. Referenced by process(). |
|
|
Definition at line 730 of file universe.cpp. Referenced by process(). |
1.4.1