Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #pragma once
00019 #include <osg/Geode>
00020 #include <osg/Geometry>
00021
00022 class SphereSegment : public osg::Geode
00023 {
00024 public:
00025 SphereSegment(void);
00026
00027 SphereSegment(float radius, unsigned int longitudeSteps, unsigned int lattitudeSteps, float longStart, float longEnd,
00028 float latStart, float latEnd);
00029
00030 SphereSegment(const SphereSegment& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
00031
00032 protected:
00033 ~SphereSegment(void);
00034
00035 public:
00036
00037
00038 void compute(float radius, unsigned int longitudeSteps, unsigned int lattitudeSteps, float longStart, float longEnd,
00039 float latStart, float latEnd);
00040 private:
00041 osg::Vec2 sphereMap(osg::Vec3& vertex, float radius);
00042
00043 inline unsigned int idx(unsigned int r, unsigned int c, unsigned int row_len)
00044 {
00045 return c + r * row_len;
00046 }
00047 };