// Copyright (C) 2002-2003 Gideon May (gideon@computer.org) // // Permission to copy, use, sell and distribute this software is granted // provided this copyright notice appears in all copies. // Permission to modify the code and to distribute modified code is granted // provided this copyright notice appears in all copies, and a notice // that the code was modified is included with the copyright notice. // // This software is provided "as is" without express or implied warranty, // and with no claim as to its suitability for any purpose. // #include #include #include #include #include #include "held_ptr.hpp" using namespace boost::python; namespace PyOSGSim { void init_Impostor() { class_, bases >("Impostor", "Impostor - is a form of Level Of Detail group node which allows both switching \n" "between children depending on distance from eye point and image caching.\n" "\n" "The principle behind Imposters is that they cache an image of real geometry and then the image is drawn \n" "in subsequent frames instead of the real geometry. Its a bit like a\n" "Billboard *but* is updated at runtime and w.r.t view point. By drawing\n" "just the texture mapped quad you can cut down scene complexity and\n" "improve performance.\n" "\n" "For more details have a look at:\n" "\n" " http://grail.cs.washington.edu/projects/hic/\n" "\n" "The OSG doesn't implement exactly the same technique as above, but its\n" "should be a good starting place. The OSG's impostors are much less\n" "intrusive since you don't need to restructure your whole scene to use\n" "them.\n" "\n" "All you need to do to use Impostors is to set up the visible\n" "range values for each LOD child of the Impostor, as per osg::LOD,\n" "and set an Impostor threshold to tell the renderer at what distance\n" "the Impostor's image caching should cut in. The osg::CullVisitor\n" "automatically handles all the setting of pre-rendering stages to\n" "calculate the required ImpostorSprites (which encapsulates the image\n" "cache and quad), and updates them as the view point changes. If you \n" "use osg::SceneView/CullVisitor all the complexity of supporting \n" "Impostor will be nicely hidden away.\n", no_init) .def(init<>()) .def("setImpostorThreshold", &osgSim::Impostor::setImpostorThreshold, "Set the Impostor threshold distance.\n" "For eye points further than this threshold the Imposter is used if appropriate,\n" "otherwise the LOD children as chosen as per a standard LOD node.\n") .def("getImpostorThreshold", &osgSim::Impostor::getImpostorThreshold, "Get the Impostor threshold distance.\n") .def("setImpostorThresholdToBound", &osgSim::Impostor::setImpostorThresholdToBound, "Set the Impostor threshold distance relative to the node's bounding\n" "sphere's radius.\n") ; } }