|
Revision 5328, 1.6 kB
(checked in by robert, 7 years ago)
|
|
Updated copyright years.
|
-
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.preMult(osg::Matrix::rotate(_attitude)* |
|---|
| 29 | osg::Matrix::translate(_position)); |
|---|
| 30 | } |
|---|
| 31 | else |
|---|
| 32 | { |
|---|
| 33 | matrix = osg::Matrix::rotate(_attitude)* |
|---|
| 34 | osg::Matrix::translate(_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.postMult(osg::Matrix::translate(-_position)* |
|---|
| 45 | osg::Matrix::rotate(_attitude.inverse())); |
|---|
| 46 | } |
|---|
| 47 | else |
|---|
| 48 | { |
|---|
| 49 | matrix = osg::Matrix::translate(-_position)* |
|---|
| 50 | osg::Matrix::rotate(_attitude.inverse()); |
|---|
| 51 | } |
|---|
| 52 | return true; |
|---|
| 53 | } |
|---|