Inital work on adding .osg support for CameraNode and CameraView.

This commit is contained in:
Robert Osfield
2005-11-02 19:52:58 +00:00
parent 511dda8525
commit 5dee96c14f
4 changed files with 17 additions and 6 deletions

View File

@@ -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

View File

@@ -7,6 +7,8 @@ CXXFILES =\
AutoTransform.cpp\
Billboard.cpp\
BlendFunc.cpp\
CameraNode.cpp\
CameraView.cpp\
ClearNode.cpp\
ClipNode.cpp\
ClipPlane.cpp\

View File

@@ -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;

View File

@@ -6,8 +6,8 @@
#include <osgDB/Input>
#include <osgDB/Output>
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