// 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 #include #include #include #include #include #include "held_ptr.hpp" #include "Math.hpp" using namespace boost::python; namespace PyOSGSim { void init_ImpostorSprite() { class_, bases, boost::noncopyable >("ImpostorSprite", "An ImposterSprite is a textured quad which is rendered in place a \n" "3D geometry. The ImposterSprite is generated by rendering the original\n" "3D geometry to a texture as an image cache. The ImpostorSprite is\n" "automatically generated by the osgUtil::CullVisitor so it not\n" "necessary to deal with it directly.\n", no_init) .def(init<>()) .def("setParent", &osgSim::ImpostorSprite::setParent, "Set the parent, which must be an Impostor. \n" "Unlike conventional Drawables, ImpostorSprite's can only ever have\n" "one parent.\n" ) .def("getParent", (osgSim::Impostor *(osgSim::ImpostorSprite::*)()) &osgSim::ImpostorSprite::getParent, return_value_policy(), "Get the parent, which is an Impostor. \n") .def("setStoredLocalEyePoint", &osgSim::ImpostorSprite::setStoredLocalEyePoint, "Set the eye point for when the ImpsotorSprite was snapped.\n") .def("getStoredLocalEyePoint", &osgSim::ImpostorSprite::getStoredLocalEyePoint, return_value_policy(), "Get the eye point for when the ImpsotorSprite was snapped.\n") .def("setLastFrameUsed", &osgSim::ImpostorSprite::setLastFrameUsed, "Set the frame number for when the ImpostorSprite was last used in rendering.\n") .def("getLastFrameUsed", &osgSim::ImpostorSprite::getLastFrameUsed, "Get the frame number for when the ImpostorSprite was last used in rendering.\n") .def("getCoords", (osg::Vec3 *(osgSim::ImpostorSprite::*)()) &osgSim::ImpostorSprite::getCoords, return_internal_reference<>(), "Get the coordinates of the corners of the quad.\n" "Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left.") .def("getTexCoords", (osg::Vec2 *(osgSim::ImpostorSprite::*)()) &osgSim::ImpostorSprite::getTexCoords, return_internal_reference<>(), "Get the texture coordinates of the corners of the quad.\n" "Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left.") .def("calcPixelError", &osgSim::ImpostorSprite::calcPixelError, "calculate the pixel error value for passing in the ModelViewProjectionWindow transform,\n" "which transform local coords into screen space.\n") .def("setTexture", &osgSim::ImpostorSprite::setTexture) .def("getTexture", (osg::Texture2D *(osgSim::ImpostorSprite::*)()) &osgSim::ImpostorSprite::getTexture, return_value_policy()) .def("s", &osgSim::ImpostorSprite::s) .def("t", &osgSim::ImpostorSprite::t) ; } } // namespace PyOSG