Changeset 13041 for OpenSceneGraph/trunk/include/osgParticle/SegmentPlacer
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/SegmentPlacer
r11755 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 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 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 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 39 39 /// get vertex <B>A</B>. 40 40 inline const osg::Vec3& getVertexA() const; 41 41 42 42 /// Set vertex <B>A</B> of the segment as a vector. 43 43 inline void setVertexA(const osg::Vec3& v); 44 44 45 45 /// Set vertex <B>A</B> of the segment as three floats. 46 46 inline void setVertexA(float x, float y, float z); 47 47 48 48 /// get vertex <B>B</B>. 49 49 inline const osg::Vec3& getVertexB() const; 50 50 51 51 /// Set vertex <B>B</B> of the segment as a vector. 52 52 inline void setVertexB(const osg::Vec3& v); 53 53 54 54 /// Set vertex <B>B</B> of the segment as three floats. 55 55 inline void setVertexB(float x, float y, float z); 56 56 57 57 /// Set both vertices. 58 58 inline void setSegment(const osg::Vec3& A, const osg::Vec3& B); 59 59 60 60 /// Place a particle. This method is called by <CODE>ModularEmitter</CODE>, do not call it manually. 61 61 inline void place(Particle* P) const; … … 63 63 /// return the length of the segment 64 64 inline float volume() const; 65 65 66 66 /// return the control position 67 67 inline osg::Vec3 getControlPosition() const; … … 69 69 protected: 70 70 virtual ~SegmentPlacer() {} 71 SegmentPlacer& operator=(const SegmentPlacer&) { return *this; } 71 SegmentPlacer& operator=(const SegmentPlacer&) { return *this; } 72 72 73 73 private: … … 77 77 78 78 // INLINE FUNCTIONS 79 79 80 80 inline SegmentPlacer::SegmentPlacer() 81 81 : Placer(), _vertexA(-1, 0, 0), _vertexB(1, 0, 0) 82 82 { 83 83 } 84 84 85 85 inline SegmentPlacer::SegmentPlacer(const SegmentPlacer& copy, const osg::CopyOp& copyop) 86 86 : Placer(copy, copyop), _vertexA(copy._vertexA), _vertexB(copy._vertexB) … … 108 108 P->setPosition(rangev3(_vertexA, _vertexB).get_random()); 109 109 } 110 110 111 111 inline float SegmentPlacer::volume() const 112 112 { 113 113 return (_vertexB - _vertexA).length(); 114 114 } 115 115 116 116 inline void SegmentPlacer::setVertexA(const osg::Vec3& v) 117 117 { 118 118 _vertexA = v; 119 119 } 120 120 121 121 inline void SegmentPlacer::setVertexA(float x, float y, float z) 122 122 { 123 123 _vertexA.set(x, y, z); 124 124 } 125 125 126 126 inline void SegmentPlacer::setVertexB(const osg::Vec3& v) 127 127 { … … 132 132 { 133 133 _vertexB.set(x, y, z); 134 } 135 134 } 135 136 136 inline osg::Vec3 SegmentPlacer::getControlPosition() const 137 137 {
