OpenSceneGraph 3.6.5
CenteredPlacer
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_CENTERED_PLACER
16#define OSGPARTICLE_CENTERED_PLACER 1
17
18#include <osgParticle/Placer>
19
20#include <osg/CopyOp>
21#include <osg/Object>
22#include <osg/Vec3>
23
24namespace osgParticle
25{
26
29 class CenteredPlacer: public Placer {
30 public:
31 inline CenteredPlacer();
32 inline CenteredPlacer(const CenteredPlacer& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
33
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; }
37
39 inline const osg::Vec3& getCenter() const;
40
42 inline void setCenter(const osg::Vec3& v);
43
45 inline void setCenter(float x, float y, float z);
46
47 protected:
48 virtual ~CenteredPlacer() {}
49
50 private:
51 osg::Vec3 center_;
52 };
53
54 // INLINE FUNCTIONS
55
57 : Placer(), center_(0, 0, 0)
58 {
59 }
60
62 : Placer(copy, copyop), center_(copy.center_)
63 {
64 }
65
67 {
68 return center_;
69 }
70
72 {
73 center_ = v;
74 }
75
76 inline void CenteredPlacer::setCenter(float x, float y, float z)
77 {
78 center_.set(x, y, z);
79 }
80
81}
82
83
84#endif
Vec3f Vec3
Definition Vec3:21
The osgParticle library is a NodeKit that extends the core scene graph to support particle effects.
Definition AccelOperator:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
void set(value_type x, value_type y, value_type z)
Definition Vec3f:67
virtual bool isSameKindAs(const osg::Object *obj) const
Definition CenteredPlacer:36
CenteredPlacer()
Definition CenteredPlacer:56
virtual ~CenteredPlacer()
Definition CenteredPlacer:48
virtual const char * className() const
return the name of the object's class type.
Definition CenteredPlacer:35
const osg::Vec3 & getCenter() const
Get the center point.
Definition CenteredPlacer:66
void setCenter(const osg::Vec3 &v)
Set the center point.
Definition CenteredPlacer:71
virtual const char * libraryName() const
return the name of the object's library.
Definition CenteredPlacer:34
Placer()
Definition Placer:56

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.