From Wang Rui, "The new osgShadow and osgFX serializers are attached, and some

modifications of the osgShadow header naming styles as well. The
osgDB::Serializer header is also changed to add new Vec2 serializer
macros because of the needs of osgShadow classes. It should compile
fine on both Windows and Linux. But I have only done a few tests to
generate .osgb, .osgt and .osgx formats with these new wrappers."
This commit is contained in:
Robert Osfield
2010-04-20 10:29:04 +00:00
parent a0781cba6c
commit a8c4fd8761
36 changed files with 496 additions and 21 deletions

View File

@@ -0,0 +1,20 @@
#include <osgShadow/ShadowMap>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgShadow_ShadowMap,
new osgShadow::ShadowMap,
osgShadow::ShadowMap,
"osg::Object osgShadow::ShadowTechnique osgShadow::ShadowMap" )
{
ADD_UINT_SERIALIZER( TextureUnit, 1 ); // _shadowTextureUnit
ADD_VEC2_SERIALIZER( PolygonOffset, osg::Vec2f() ); // _polyOffset
ADD_VEC2_SERIALIZER( AmbientBias, osg::Vec2d() ); // _ambientBias
ADD_SERIALIZER( (new osgDB::PropByRefSerializer<osgShadow::ShadowMap, osg::Vec2s>
("TextureSize", osg::Vec2s(1024, 1024),
&osgShadow::ShadowMap::getTextureSize,
&osgShadow::ShadowMap::setTextureSize))
); // _textureSize
}