Added .osg support for osgShadow NodeKit
This commit is contained in:
18
src/osgPlugins/osgShadow/GNUmakefile
Normal file
18
src/osgPlugins/osgShadow/GNUmakefile
Normal file
@@ -0,0 +1,18 @@
|
||||
TOPDIR = ../../..
|
||||
include $(TOPDIR)/Make/makedefs
|
||||
|
||||
CXXFILES =\
|
||||
ParallelSplitShadowMap.cpp\
|
||||
ShadowMap.cpp\
|
||||
ShadowTechnique.cpp\
|
||||
ShadowTexture.cpp\
|
||||
ShadowVolume.cpp\
|
||||
ShadowedScene.cpp
|
||||
|
||||
LIBS += -losgShadow -losgUtil -losg $(OTHER_LIBS)
|
||||
|
||||
TARGET_BASENAME = osgShadow
|
||||
include $(TOPDIR)/Make/cygwin_plugin_def
|
||||
PLUGIN = $(PLUGIN_PREFIX)$(TARGET_BASENAME).$(PLUGIN_EXT)
|
||||
|
||||
include $(TOPDIR)/Make/makerules
|
||||
40
src/osgPlugins/osgShadow/ParallelSplitShadowMap.cpp
Normal file
40
src/osgPlugins/osgShadow/ParallelSplitShadowMap.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <osgShadow/ParallelSplitShadowMap>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
#include <osgDB/ParameterOutput>
|
||||
|
||||
bool ParallelSplitShadowMap_readLocalData(osg::Object &obj, osgDB::Input &fr);
|
||||
bool ParallelSplitShadowMap_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
|
||||
|
||||
osgDB::RegisterDotOsgWrapperProxy ParallelSplitShadowMap_Proxy
|
||||
(
|
||||
new osgShadow::ParallelSplitShadowMap,
|
||||
"ParallelSplitShadowMap",
|
||||
"Object ShadowTechnique ParallelSplitShadowMap",
|
||||
ParallelSplitShadowMap_readLocalData,
|
||||
ParallelSplitShadowMap_writeLocalData
|
||||
);
|
||||
|
||||
bool ParallelSplitShadowMap_readLocalData(osg::Object& obj, osgDB::Input &fr)
|
||||
{
|
||||
osgShadow::ParallelSplitShadowMap& ss = static_cast<osgShadow::ParallelSplitShadowMap&>(obj);
|
||||
bool itAdvanced = false;
|
||||
|
||||
return itAdvanced;
|
||||
}
|
||||
|
||||
bool ParallelSplitShadowMap_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
|
||||
{
|
||||
const osgShadow::ParallelSplitShadowMap& ss = static_cast<const osgShadow::ParallelSplitShadowMap &>(obj);
|
||||
|
||||
return true;
|
||||
}
|
||||
40
src/osgPlugins/osgShadow/ShadowMap.cpp
Normal file
40
src/osgPlugins/osgShadow/ShadowMap.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <osgShadow/ShadowMap>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
#include <osgDB/ParameterOutput>
|
||||
|
||||
bool ShadowMap_readLocalData(osg::Object &obj, osgDB::Input &fr);
|
||||
bool ShadowMap_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
|
||||
|
||||
osgDB::RegisterDotOsgWrapperProxy ShadowMap_Proxy
|
||||
(
|
||||
new osgShadow::ShadowMap,
|
||||
"ShadowMap",
|
||||
"Object ShadowTechnique ShadowMap",
|
||||
ShadowMap_readLocalData,
|
||||
ShadowMap_writeLocalData
|
||||
);
|
||||
|
||||
bool ShadowMap_readLocalData(osg::Object& obj, osgDB::Input &fr)
|
||||
{
|
||||
osgShadow::ShadowMap& ss = static_cast<osgShadow::ShadowMap&>(obj);
|
||||
bool itAdvanced = false;
|
||||
|
||||
return itAdvanced;
|
||||
}
|
||||
|
||||
bool ShadowMap_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
|
||||
{
|
||||
const osgShadow::ShadowMap& ss = static_cast<const osgShadow::ShadowMap &>(obj);
|
||||
|
||||
return true;
|
||||
}
|
||||
40
src/osgPlugins/osgShadow/ShadowTechnique.cpp
Normal file
40
src/osgPlugins/osgShadow/ShadowTechnique.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <osgShadow/ShadowTechnique>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
#include <osgDB/ParameterOutput>
|
||||
|
||||
bool ShadowTechnique_readLocalData(osg::Object &obj, osgDB::Input &fr);
|
||||
bool ShadowTechnique_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
|
||||
|
||||
osgDB::RegisterDotOsgWrapperProxy ShadowTechnique_Proxy
|
||||
(
|
||||
new osgShadow::ShadowTechnique,
|
||||
"ShadowTechnique",
|
||||
"Object ShadowTechnique ",
|
||||
ShadowTechnique_readLocalData,
|
||||
ShadowTechnique_writeLocalData
|
||||
);
|
||||
|
||||
bool ShadowTechnique_readLocalData(osg::Object& obj, osgDB::Input &fr)
|
||||
{
|
||||
osgShadow::ShadowTechnique& ss = static_cast<osgShadow::ShadowTechnique&>(obj);
|
||||
bool itAdvanced = false;
|
||||
|
||||
return itAdvanced;
|
||||
}
|
||||
|
||||
bool ShadowTechnique_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
|
||||
{
|
||||
const osgShadow::ShadowTechnique& ss = static_cast<const osgShadow::ShadowTechnique &>(obj);
|
||||
|
||||
return true;
|
||||
}
|
||||
40
src/osgPlugins/osgShadow/ShadowTexture.cpp
Normal file
40
src/osgPlugins/osgShadow/ShadowTexture.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <osgShadow/ShadowTexture>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
#include <osgDB/ParameterOutput>
|
||||
|
||||
bool ShadowTexture_readLocalData(osg::Object &obj, osgDB::Input &fr);
|
||||
bool ShadowTexture_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
|
||||
|
||||
osgDB::RegisterDotOsgWrapperProxy ShadowTexture_Proxy
|
||||
(
|
||||
new osgShadow::ShadowTexture,
|
||||
"ShadowTexture",
|
||||
"Object ShadowTechnique ShadowTexture",
|
||||
ShadowTexture_readLocalData,
|
||||
ShadowTexture_writeLocalData
|
||||
);
|
||||
|
||||
bool ShadowTexture_readLocalData(osg::Object& obj, osgDB::Input &fr)
|
||||
{
|
||||
osgShadow::ShadowTexture& ss = static_cast<osgShadow::ShadowTexture&>(obj);
|
||||
bool itAdvanced = false;
|
||||
|
||||
return itAdvanced;
|
||||
}
|
||||
|
||||
bool ShadowTexture_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
|
||||
{
|
||||
const osgShadow::ShadowTexture& ss = static_cast<const osgShadow::ShadowTexture &>(obj);
|
||||
|
||||
return true;
|
||||
}
|
||||
40
src/osgPlugins/osgShadow/ShadowVolume.cpp
Normal file
40
src/osgPlugins/osgShadow/ShadowVolume.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <osgShadow/ShadowVolume>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
#include <osgDB/ParameterOutput>
|
||||
|
||||
bool ShadowVolume_readLocalData(osg::Object &obj, osgDB::Input &fr);
|
||||
bool ShadowVolume_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
|
||||
|
||||
osgDB::RegisterDotOsgWrapperProxy ShadowVolume_Proxy
|
||||
(
|
||||
new osgShadow::ShadowVolume,
|
||||
"ShadowVolume",
|
||||
"Object ShadowTechnique ShadowVolume",
|
||||
ShadowVolume_readLocalData,
|
||||
ShadowVolume_writeLocalData
|
||||
);
|
||||
|
||||
bool ShadowVolume_readLocalData(osg::Object& obj, osgDB::Input &fr)
|
||||
{
|
||||
osgShadow::ShadowVolume& ss = static_cast<osgShadow::ShadowVolume&>(obj);
|
||||
bool itAdvanced = false;
|
||||
|
||||
return itAdvanced;
|
||||
}
|
||||
|
||||
bool ShadowVolume_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
|
||||
{
|
||||
const osgShadow::ShadowVolume& ss = static_cast<const osgShadow::ShadowVolume &>(obj);
|
||||
|
||||
return true;
|
||||
}
|
||||
53
src/osgPlugins/osgShadow/ShadowedScene.cpp
Normal file
53
src/osgPlugins/osgShadow/ShadowedScene.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
#include <osgShadow/ShadowedScene>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
#include <osgDB/ParameterOutput>
|
||||
|
||||
bool ShadowedScene_readLocalData(osg::Object &obj, osgDB::Input &fr);
|
||||
bool ShadowedScene_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
|
||||
|
||||
osgDB::RegisterDotOsgWrapperProxy ShadowedScene_Proxy
|
||||
(
|
||||
new osgShadow::ShadowedScene,
|
||||
"ShadowedScene",
|
||||
"Object ShadowedScene Group ",
|
||||
ShadowedScene_readLocalData,
|
||||
ShadowedScene_writeLocalData
|
||||
);
|
||||
|
||||
bool ShadowedScene_readLocalData(osg::Object& obj, osgDB::Input &fr)
|
||||
{
|
||||
osgShadow::ShadowedScene& ss = static_cast<osgShadow::ShadowedScene&>(obj);
|
||||
bool iteratorAdvanced = false;
|
||||
|
||||
osg::ref_ptr<osg::Object> object=0;
|
||||
while((object=fr.readObject())!=0)
|
||||
{
|
||||
osgShadow::ShadowTechnique* st = dynamic_cast<osgShadow::ShadowTechnique*>(object.get());
|
||||
if (st) ss.setShadowTechnique(st);
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
return iteratorAdvanced;
|
||||
}
|
||||
|
||||
bool ShadowedScene_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
|
||||
{
|
||||
const osgShadow::ShadowedScene& ss = static_cast<const osgShadow::ShadowedScene &>(obj);
|
||||
|
||||
if (ss.getShadowTechnique())
|
||||
{
|
||||
fw.writeObject(*ss.getShadowTechnique());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user