From 5dee96c14ff3c311073487f3922484d424bd3879 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 2 Nov 2005 19:52:58 +0000 Subject: [PATCH] Inital work on adding .osg support for CameraNode and CameraView. --- VisualStudio/osgPlugins/osg/dot_osg.dsp | 8 ++++++++ src/osgPlugins/osg/GNUmakefile | 2 ++ src/osgPlugins/osg/Matrix.cpp | 9 +++++---- src/osgPlugins/osg/Matrix.h | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/VisualStudio/osgPlugins/osg/dot_osg.dsp b/VisualStudio/osgPlugins/osg/dot_osg.dsp index e72a57d4b..abae4049e 100755 --- a/VisualStudio/osgPlugins/osg/dot_osg.dsp +++ b/VisualStudio/osgPlugins/osg/dot_osg.dsp @@ -116,6 +116,14 @@ SOURCE=..\..\..\src\osgPlugins\osg\BlendFunc.cpp # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\osg\CameraNode.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\osgPlugins\osg\CameraView.cpp +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\osg\ClearNode.cpp # End Source File # Begin Source File diff --git a/src/osgPlugins/osg/GNUmakefile b/src/osgPlugins/osg/GNUmakefile index bea7cfc5d..638eed437 100644 --- a/src/osgPlugins/osg/GNUmakefile +++ b/src/osgPlugins/osg/GNUmakefile @@ -7,6 +7,8 @@ CXXFILES =\ AutoTransform.cpp\ Billboard.cpp\ BlendFunc.cpp\ + CameraNode.cpp\ + CameraView.cpp\ ClearNode.cpp\ ClipNode.cpp\ ClipPlane.cpp\ diff --git a/src/osgPlugins/osg/Matrix.cpp b/src/osgPlugins/osg/Matrix.cpp index 475d5faab..2164b6663 100644 --- a/src/osgPlugins/osg/Matrix.cpp +++ b/src/osgPlugins/osg/Matrix.cpp @@ -1,10 +1,11 @@ #include "Matrix.h" -bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr) + +bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr, const char* keyword) { bool iteratorAdvanced = false; - if (fr.matchSequence("Matrix {")) + if (fr[0].matchWord(keyword) && fr[1].matchWord("{")) { int entry = fr[0].getNoNestedBrackets(); @@ -36,9 +37,9 @@ bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr) } -bool writeMatrix(const osg::Matrix& matrix, osgDB::Output& fw) +bool writeMatrix(const osg::Matrix& matrix, osgDB::Output& fw, const char* keyword) { - fw.indent() << "Matrix {" << std::endl; + fw.indent() << keyword <<" {" << std::endl; fw.moveIn(); fw.indent() << matrix(0,0) << " " << matrix(0,1) << " " << matrix(0,2) << " " << matrix(0,3) << std::endl; fw.indent() << matrix(1,0) << " " << matrix(1,1) << " " << matrix(1,2) << " " << matrix(1,3) << std::endl; diff --git a/src/osgPlugins/osg/Matrix.h b/src/osgPlugins/osg/Matrix.h index 25afdbb0d..e5fa46724 100644 --- a/src/osgPlugins/osg/Matrix.h +++ b/src/osgPlugins/osg/Matrix.h @@ -6,8 +6,8 @@ #include #include -extern bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr); +extern bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr, const char* keyword="Matrix"); -extern bool writeMatrix(const osg::Matrix& matrix, osgDB::Output& fw); +extern bool writeMatrix(const osg::Matrix& matrix, osgDB::Output& fw, const char* keyword="Matrix"); #endif