| 756 | |
| 757 | |
| 758 | Vec3d |
| 759 | FrameVector::direction(double tjd) const |
| 760 | { |
| 761 | Vec3d v; |
| 762 | |
| 763 | switch (vecType) |
| 764 | { |
| 765 | case RelativePosition: |
| 766 | v = target.getPosition(tjd) - observer.getPosition(tjd); |
| 767 | break; |
| 768 | |
| 769 | case RelativeVelocity: |
| 770 | { |
| 771 | Vec3d v0 = observer.getVelocity(tjd); |
| 772 | Vec3d v1 = target.getVelocity(tjd); |
| 773 | v = v1 - v0; |
| 774 | } |
| 775 | break; |
| 776 | |
| 777 | case ConstantVector: |
| 778 | if (frame == NULL) |
| 779 | v = vec; |
| 780 | else |
| 781 | v = vec * frame->getOrientation(tjd).toMatrix3(); |
| 782 | break; |
| 783 | |
| 784 | default: |
| 785 | // unhandled vector type |
| 786 | v = Vec3d(0.0, 0.0, 0.0); |
| 787 | break; |
| 788 | } |
| 789 | |
| 790 | return v; |
| 791 | } |
| 792 | |
| 793 | |
| 794 | unsigned int |
no test coverage detected