252da5e5f9
handles float's double's properly.
39 lines
973 B
C++
39 lines
973 B
C++
#include <osg/ColorMatrix>
|
|
|
|
#include <osgDB/Registry>
|
|
#include <osgDB/Input>
|
|
#include <osgDB/Output>
|
|
|
|
#include "Matrix.h"
|
|
|
|
using namespace osg;
|
|
using namespace osgDB;
|
|
|
|
// forward declare functions to use later.
|
|
bool ColorMatrix_readLocalData(Object& obj, Input& fr);
|
|
bool ColorMatrix_writeLocalData(const Object& obj, Output& fw);
|
|
|
|
// register the read and write functions with the osgDB::Registry.
|
|
RegisterDotOsgWrapperProxy g_ColorMatrixProxy
|
|
(
|
|
new osg::ColorMatrix,
|
|
"ColorMatrix",
|
|
"Object StateAttribute ColorMatrix",
|
|
&ColorMatrix_readLocalData,
|
|
&ColorMatrix_writeLocalData
|
|
);
|
|
|
|
|
|
bool ColorMatrix_readLocalData(Object& obj, Input& fr)
|
|
{
|
|
ColorMatrix& colorMatrix = static_cast<ColorMatrix&>(obj);
|
|
return readMatrix(colorMatrix.getMatrix(), fr);
|
|
}
|
|
|
|
|
|
bool ColorMatrix_writeLocalData(const Object& obj, Output& fw)
|
|
{
|
|
const ColorMatrix& colorMatrix = static_cast<const ColorMatrix&>(obj);
|
|
return writeMatrix(colorMatrix.getMatrix(), fw);
|
|
}
|