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_CENTERED_PLACER
16#define OSGPARTICLE_CENTERED_PLACER 1
18#include <osgParticle/Placer>
27 /** An abstract placer base class for placers which need a <I>center point</I>.
29 class CenteredPlacer: public Placer {
31 inline CenteredPlacer();
32 inline CenteredPlacer(const CenteredPlacer& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
34 virtual const char* libraryName() const { return "osgParticle"; }
35 virtual const char* className() const { return "CenteredPlacer"; }
36 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Placer* >(obj) != 0; }
38 /// Get the center point.
39 inline const osg::Vec3& getCenter() const;
41 /// Set the center point.
42 inline void setCenter(const osg::Vec3& v);
44 /// Set the center point.
45 inline void setCenter(float x, float y, float z);
48 virtual ~CenteredPlacer() {}
56 inline CenteredPlacer::CenteredPlacer()
57 : Placer(), center_(0, 0, 0)
61 inline CenteredPlacer::CenteredPlacer(const CenteredPlacer& copy, const osg::CopyOp& copyop)
62 : Placer(copy, copyop), center_(copy.center_)
66 inline const osg::Vec3& CenteredPlacer::getCenter() const
71 inline void CenteredPlacer::setCenter(const osg::Vec3& v)
76 inline void CenteredPlacer::setCenter(float x, float y, float z)