|
Revision 13041, 1.5 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | #include <osg/CameraView> |
|---|
| 14 | |
|---|
| 15 | using namespace osg; |
|---|
| 16 | |
|---|
| 17 | CameraView::CameraView(): |
|---|
| 18 | _fieldOfView(60.0), |
|---|
| 19 | _fieldOfViewMode(VERTICAL), |
|---|
| 20 | _focalLength(0.0) |
|---|
| 21 | { |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | bool CameraView::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const |
|---|
| 25 | { |
|---|
| 26 | if (_referenceFrame==RELATIVE_RF) |
|---|
| 27 | { |
|---|
| 28 | matrix.preMultTranslate(_position); |
|---|
| 29 | matrix.preMultRotate(_attitude); |
|---|
| 30 | } |
|---|
| 31 | else |
|---|
| 32 | { |
|---|
| 33 | matrix.makeRotate(_attitude); |
|---|
| 34 | matrix.postMultTranslate(_position); |
|---|
| 35 | } |
|---|
| 36 | return true; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | bool CameraView::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const |
|---|
| 41 | { |
|---|
| 42 | if (_referenceFrame==RELATIVE_RF) |
|---|
| 43 | { |
|---|
| 44 | matrix.postMultTranslate(-_position); |
|---|
| 45 | matrix.postMultRotate(_attitude.inverse()); |
|---|
| 46 | } |
|---|
| 47 | else |
|---|
| 48 | { |
|---|
| 49 | matrix.makeRotate(_attitude.inverse()); |
|---|
| 50 | matrix.preMultTranslate(-_position); |
|---|
| 51 | } |
|---|
| 52 | return true; |
|---|
| 53 | } |
|---|