// 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 PyOSGParticle { void init_ParticleProcessor() { class_, bases, boost::noncopyable > particleProcessor("ParticleProcessor", "A common base interface for those classes which need to do something on particles. Such classes" "are, for example, Emitter (particle generation) and Program (particle animation)." "This class holds some properties, like a reference frame and a reference to a ParticleSystem;" "descendant classes should process the particles taking into account the reference frame, computing the right" "transformations when needed.", no_init); scope particleProcessor_scope(particleProcessor); particleProcessor.def("getReferenceFrame", &osgParticle::ParticleProcessor::getReferenceFrame, "Get the reference frame."); particleProcessor.def("setReferenceFrame", &osgParticle::ParticleProcessor::setReferenceFrame, "Set the reference frame."); particleProcessor.def("isEnabled", &osgParticle::ParticleProcessor::isEnabled, "Get whether this processor is enabled or not."); particleProcessor.def("setEnabled", &osgParticle::ParticleProcessor::setEnabled, "Set whether this processor is enabled or not."); particleProcessor.def("getParticleSystem", (osgParticle::ParticleSystem*(osgParticle::ParticleProcessor::*)()) &osgParticle::ParticleProcessor::getParticleSystem, "Get a pointer to the destination particle system.", return_internal_reference<>()); particleProcessor.def("setParticleSystem", &osgParticle::ParticleProcessor::setParticleSystem, "Set the destination particle system."); particleProcessor.def("getLocalToWorldMatrix", &osgParticle::ParticleProcessor::getLocalToWorldMatrix, "Get the current local-to-world transformation matrix (valid only during cull traversal).", return_internal_reference<>()); particleProcessor.def("getWorldToLocalMatrix", &osgParticle::ParticleProcessor::getWorldToLocalMatrix, "Get the current world-to-local transformation matrix (valid only during cull traversal).", return_internal_reference<>()); particleProcessor.def("transformLocalToWorld", &osgParticle::ParticleProcessor::transformLocalToWorld, "Transform a point from local to world coordinates (valid only during cull traversal)."); particleProcessor.def("rotateLocalToWorld", &osgParticle::ParticleProcessor::rotateLocalToWorld, "Transform a vector from local to world coordinates, discarding translation (valid only during cull traversal)."); particleProcessor.def("transformWorldToLocal", &osgParticle::ParticleProcessor::transformWorldToLocal, "Transform a point from world to local coordinates (valid only during cull traversal)."); particleProcessor.def("rotateWorldToLocal", &osgParticle::ParticleProcessor::rotateWorldToLocal, "Transform a vector from world to local coordinates, discarding translation (valid only during cull traversal)."); enum_ referenceFrame("ReferenceFrame"); # define OSG_ENUM(VALUE) \ (referenceFrame.value(#VALUE, osgParticle::ParticleProcessor::VALUE), \ particleProcessor.def(#VALUE, object(osgParticle::ParticleProcessor::VALUE))) OSG_ENUM(RELATIVE_RF); OSG_ENUM(ABSOLUTE_RF); scope(); } }