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

Drawable 2D or 3D ring. More...

#include <StelGeometryBuilder.hpp>

Public Member Functions

 ~StelGeometryRing ()
 Destroy the ring, freeing vertex and index buffers. More...
 
void draw (class StelRenderer *renderer, StelProjectorP projector=StelProjectorP())
 Draw the ring. More...
 
void setInnerOuterRadius (const float inner, const float outer)
 Set inner and outer radius of the ring. More...
 
void setResolution (const int slices, const int loops)
 Set resolution (detail) of the ring. More...
 
void setFlipFaces (const bool flipFaces)
 Should the ring be flipped to face the opposite side? More...
 
void setOffset (const Vec3f offset)
 Set offset (position) of the ring (for 2D rings, the Z coordinate is ignored). More...
 

Detailed Description

Drawable 2D or 3D ring.

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

The ring is a flat circle with a hole in center formed by a circular grid with multiple loops each composed of multiple slices.

Rings are constructed by StelGeometryBuilder functions buildRingTextured(), and buildRing2D().

See Also
StelGeometryBuilder::buildRingTextured, StelGeometryBuilder::buildRing2D

Definition at line 410 of file StelGeometryBuilder.hpp.

Constructor & Destructor Documentation

StelGeometryRing::~StelGeometryRing ( )
inline

Destroy the ring, freeing vertex and index buffers.

Definition at line 423 of file StelGeometryBuilder.hpp.

Member Function Documentation

void StelGeometryRing::draw ( class StelRenderer renderer,
StelProjectorP  projector = StelProjectorP() 
)

Draw the ring.

Parameters
rendererRenderer to draw the ring.
projectorProjector to project the vertices, if any. Not used for 2D rings.
void StelGeometryRing::setFlipFaces ( const bool  flipFaces)
inline

Should the ring be flipped to face the opposite side?

Definition at line 493 of file StelGeometryBuilder.hpp.

void StelGeometryRing::setInnerOuterRadius ( const float  inner,
const float  outer 
)
inline

Set inner and outer radius of the ring.

Parameters
innerInner radius. Must be greater than zero.
outerOuter radius. Must be greater than the inner radius.

Definition at line 457 of file StelGeometryBuilder.hpp.

void StelGeometryRing::setOffset ( const Vec3f  offset)
inline

Set offset (position) of the ring (for 2D rings, the Z coordinate is ignored).

Definition at line 502 of file StelGeometryBuilder.hpp.

void StelGeometryRing::setResolution ( const int  slices,
const int  loops 
)
inline

Set resolution (detail) of the ring.

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

Parameters
slicesNumber of slices/subdivisions. E.g. 3 is a triangle, 5 a pentagon, etc. Must be at least 3 and at most 4096.
loopsNumber of concentric loops in the ring. Must be at least 1.

Definition at line 477 of file StelGeometryBuilder.hpp.


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