openscenegraph
Placer
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
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.
7 *
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.
12*/
13//osgParticle - Copyright (C) 2002 Marco Jez
14
15#ifndef OSGPARTICLE_PLACER
16#define OSGPARTICLE_PLACER 1
17
18#include <osg/CopyOp>
19#include <osg/Object>
20#include <osg/Vec3>
21
22namespace osgParticle
23{
24
25 class Particle;
26
31 class Placer: public osg::Object {
32 public:
33 inline Placer();
34 inline Placer(const Placer& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
35
36 virtual const char* libraryName() const { return "osgParticle"; }
37 virtual const char* className() const { return "Placer"; }
38 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Placer *>(obj) != 0; }
39
41 virtual void place(Particle* P) const = 0;
42
44 virtual float volume() const { return 1.0f; }
45
47 virtual osg::Vec3 getControlPosition() const = 0;
48
49 protected:
51 Placer& operator=(const Placer& ) { return *this; }
52 };
53
54 // INLINE FUNCTIONS
55
57 : osg::Object()
58 {
59 }
60
61 inline Placer::Placer(const Placer& copy, const osg::CopyOp& copyop)
62 : osg::Object(copy, copyop)
63 {
64 }
65
66}
67
68#endif
Definition Particle:47
Definition Placer:31
virtual osg::Vec3 getControlPosition() const =0
Return the control position of particles that placer will generate. Must be implemented in descendant...
virtual bool isSameKindAs(const osg::Object *obj) const
Definition Placer:38
~Placer()
Definition Placer:50
virtual const char * libraryName() const
Definition Placer:36
Placer & operator=(const Placer &)
Definition Placer:51
virtual float volume() const
Volume of the placer. Can be implemented in descendant classes.
Definition Placer:44
Placer()
Definition Placer:56
virtual void place(Particle *P) const =0
Place a particle. Must be implemented in descendant classes.
virtual const char * className() const
Definition Placer:37
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition Object:61
Definition Vec3f:29
Definition AccelOperator:27
author: Julien Valentin 2017 (mp3butcher@hotmail.com)
Definition AlphaFunc:19