1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
13//osgParticle - Copyright (C) 2002 Marco Jez
15#ifndef OSGPARTICLE_POINT_PLACER
16#define OSGPARTICLE_POINT_PLACER 1
18#include <osgParticle/CenteredPlacer>
19#include <osgParticle/Particle>
27 /** A point-shaped particle placer.
28 This placer class uses the center point defined in its base class <CODE>CenteredPlacer</CODE>
29 to place there all incoming particles.
31 class PointPlacer: public CenteredPlacer {
34 inline PointPlacer(const PointPlacer& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
36 META_Object(osgParticle, PointPlacer);
39 This method is called automatically by <CODE>ModularEmitter</CODE> and should not be called
42 inline void place(Particle* P) const;
44 /// return the control position
45 inline osg::Vec3 getControlPosition() const;
48 virtual ~PointPlacer() {}
49 PointPlacer& operator=(const PointPlacer&) { return *this; }
54 inline PointPlacer::PointPlacer()
59 inline PointPlacer::PointPlacer(const PointPlacer& copy, const osg::CopyOp& copyop)
60 : CenteredPlacer(copy, copyop)
64 inline void PointPlacer::place(Particle* P) const
66 P->setPosition(getCenter());
70 inline osg::Vec3 PointPlacer::getControlPosition() const