Stellarium 0.12.2
List of all members | Public Member Functions
StelGeometrySphere Class Reference

Drawable 3D sphere. More...

#include <StelGeometryBuilder.hpp>

Public Member Functions

 ~StelGeometrySphere ()
 Destroy the sphere, freeing vertex and index buffers. More...
 
void draw (class StelRenderer *renderer, StelProjectorP projector)
 Draw the sphere. More...
 
void setRadius (const float radius)
 Set radius of the sphere. More...
 
void setOneMinusOblateness (const float oneMinusOblateness)
 Set the oblateness of the sphere. More...
 
void setResolution (const int slices, const int stacks)
 Set resolution (detail) of the sphere grid. More...
 
void setOrientInside (const bool orientInside)
 Should sphere faces be oriented inside? (Useful e.g. for skyspheres) More...
 
void setFlipTexture (const bool flipTexture)
 Should texture coordinates be flipped on the x (texture coord, not world) axis? More...
 
void setLight (const StelLight &light)
 Update the light. Can only be called if this is a lit sphere (constructed by buildSphereLit). More...
 

Detailed Description

Drawable 3D sphere.

Encapsulates vertex and index buffers needed to draw the sphere. These are generated as needed any time sphere parameters change.

The sphere is a spherical grid with multiple stacks each composed of multiple slices.

Spheres are constructed by StelGeometryBuilder functions buildSphereFisheye(), buildSphereUnlit() and buildSphereLit().

See Also
StelGeometryBuilder::buildSphereUnlit, StelGeometryBuilder::buildSphereLit, StelGeometryBuilder::buildSphereFisheye

Definition at line 136 of file StelGeometryBuilder.hpp.

Constructor & Destructor Documentation

StelGeometrySphere::~StelGeometrySphere ( )
inline

Destroy the sphere, freeing vertex and index buffers.

Definition at line 153 of file StelGeometryBuilder.hpp.

Member Function Documentation

void StelGeometrySphere::draw ( class StelRenderer renderer,
StelProjectorP  projector 
)

Draw the sphere.

Parameters
rendererRenderer to draw the sphere.
projectorProjector to project the vertices.
void StelGeometrySphere::setFlipTexture ( const bool  flipTexture)
inline

Should texture coordinates be flipped on the x (texture coord, not world) axis?

Definition at line 233 of file StelGeometryBuilder.hpp.

void StelGeometrySphere::setLight ( const StelLight light)
inline

Update the light. Can only be called if this is a lit sphere (constructed by buildSphereLit).

Definition at line 240 of file StelGeometryBuilder.hpp.

void StelGeometrySphere::setOneMinusOblateness ( const float  oneMinusOblateness)
inline

Set the oblateness of the sphere.

1.0 is a perfect sphere, 0.0f a flat ring.

Must be at least zero and at most one.

Definition at line 197 of file StelGeometryBuilder.hpp.

void StelGeometrySphere::setOrientInside ( const bool  orientInside)
inline

Should sphere faces be oriented inside? (Useful e.g. for skyspheres)

Definition at line 226 of file StelGeometryBuilder.hpp.

void StelGeometrySphere::setRadius ( const float  radius)
inline

Set radius of the sphere.

Parameters
radiusRadius to set. Must be greater than zero.

Definition at line 185 of file StelGeometryBuilder.hpp.

void StelGeometrySphere::setResolution ( const int  slices,
const int  stacks 
)
inline

Set resolution (detail) of the sphere grid.

Higher values result in more detail, but also higher resource usage.

Parameters
slicesNumber of slices/columns, i.e. horizontal resolution of the sphere. Must be at least 3 and at most 4096.
stacksNumber of stacks/rows/rings, i.e. vertical resolution of the sphere. Must be at least 3 and at most 4096.

Definition at line 213 of file StelGeometryBuilder.hpp.


The documentation for this class was generated from the following file: