19 _major_radius(1.0f), _minor_radius(2.0f),
20 _start_sweep(osg::inDegrees(0.0f)), _end_sweep(osg::inDegrees(360.0f)),
21 _circle_cuts(50), _sweep_cuts(50) {}
24 float start_angle=0.0f,
float end_angle=360.0f,
25 unsigned int cross=50,
unsigned int sweep=50):
26 _major_radius(inner), _minor_radius(outer),
27 _start_sweep(start_angle), _end_sweep(end_angle),
28 _circle_cuts(cross), _sweep_cuts(sweep) {}
31 _major_radius(torus._major_radius), _minor_radius(torus._minor_radius),
32 _start_sweep(torus._start_sweep), _end_sweep(torus._end_sweep),
33 _circle_cuts(torus._circle_cuts), _sweep_cuts(torus._sweep_cuts) {}
35 inline bool valid()
const
38 if( (_minor_radius>_major_radius) && (_minor_radius>0.0f) )
43 inline void set(
float i,
float o) {_major_radius=i; _minor_radius=o;}
45 osg::Geode* operator() ()
const;
47 inline void setColor(
const osg::Vec4& c) { _color = c; }
48 inline const osg::Vec4& getColor()
const {
return _color; }
50 inline void setMajorRadius(
float inner) { _major_radius = inner; }
51 inline float getMajorRadius()
const {
return _major_radius; }
53 inline void setMinorRadius(
float outer) { _minor_radius = outer; }
54 inline float getMinorRadius()
const {
return _minor_radius; }
56 inline void setStartSweep(
float angle) { _start_sweep = angle; }
57 inline float getStartSweep()
const {
return _start_sweep; }
59 inline void setEndSweep(
float angle) { _end_sweep = angle; }
60 inline float getEndSweep()
const {
return _end_sweep; }
62 inline void setCircleCuts(
int cuts) { _circle_cuts = cuts; }
63 inline int getCircleCuts()
const {
return _circle_cuts; }
65 inline void setSweepCuts(
int cuts) { _sweep_cuts = cuts; }
66 inline int getSweepCuts()
const {
return _sweep_cuts; }
71 float _major_radius, _minor_radius;
72 float _start_sweep, _end_sweep;
73 unsigned int _circle_cuts, _sweep_cuts;
80 #endif // _OSG_TORUS_H_
Definition: OsgTorus.h:15