1
#include <osg/MatrixTransform>
3
#include <osgDB/Registry>
5
#include <osgDB/Output>
10
using namespace osgDB;
12
// forward declare functions to use later.
13
bool MatrixTransform_readLocalData(Object& obj, Input& fr);
14
bool MatrixTransform_writeLocalData(const Object& obj, Output& fw);
16
// register the read and write functions with the osgDB::Registry.
17
REGISTER_DOTOSGWRAPPER(MatrixTransform)
19
new osg::MatrixTransform,
21
"Object Node Transform MatrixTransform Group",
22
&MatrixTransform_readLocalData,
23
&MatrixTransform_writeLocalData,
24
DotOsgWrapper::READ_AND_WRITE
27
// register old style 'DCS' read and write functions with the osgDB::Registry.
28
REGISTER_DOTOSGWRAPPER(DCS)
30
new osg::MatrixTransform,
32
"Object Node Group DCS",
33
&MatrixTransform_readLocalData,
35
DotOsgWrapper::READ_ONLY
38
bool MatrixTransform_readLocalData(Object& obj, Input& fr)
40
bool iteratorAdvanced = false;
42
MatrixTransform& transform = static_cast<MatrixTransform&>(obj);
44
if (fr[0].matchWord("Type"))
46
if (fr[1].matchWord("DYNAMIC"))
48
transform.setDataVariance(osg::Object::DYNAMIC);
50
iteratorAdvanced = true;
52
else if (fr[1].matchWord("STATIC"))
54
transform.setDataVariance(osg::Object::STATIC);
56
iteratorAdvanced = true;
62
if (readMatrix(matrix,fr))
64
transform.setMatrix(matrix);
65
iteratorAdvanced = true;
68
return iteratorAdvanced;
72
bool MatrixTransform_writeLocalData(const Object& obj, Output& fw)
74
const MatrixTransform& transform = static_cast<const MatrixTransform&>(obj);
76
writeMatrix(transform.getMatrix(),fw);