Stellarium 0.12.0
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · Renderer · File Structure

StelGeometryBuilder Class Reference

Builds various geometry primitives, storing them in vertex buffers. More...

#include <StelGeometryBuilder.hpp>

List of all members.

Public Member Functions

void buildCircle (StelVertexBuffer< VertexP2 > *vertexBuffer, const float x, const float y, const float radius, const int segments=128)
 Build a 2D circle.
void buildCylinder (StelVertexBuffer< VertexP3T2 > *const vertexBuffer, const float radius, const float height, const int slices, const bool orientInside=false)
 Build a cylinder without top and bottom caps.
void buildFanDisk (StelVertexBuffer< VertexP3T2 > *const vertexBuffer, StelIndexBuffer *const indexBuffer, const float radius, const int innerFanSlices, const int level)
 Build a disk having texture center at center of disk.
StelGeometrySpherebuildSphereFisheye (const SphereParams &params, const float textureFov)
 Build a fisheye-textured sphere.
StelGeometrySpherebuildSphereUnlit (const SphereParams &params)
 Build a regularly texture mapped sphere.
StelGeometrySpherebuildSphereLit (const SphereParams &params, const StelLight &light)
 Build a regularly texture mapped sphere with lighting baked into vertex colors.
StelGeometryRingbuildRingTextured (const RingParams &params, const Vec3f offset=Vec3f(0.0f, 0.0f, 0.0f))
 Build a flat texture mapped ring with 3D coordinates (for example for planet's rings).
StelGeometryRingbuildRing2D (const RingParams &params, const Vec2f offset=Vec2f(0.0f, 0.0f))
 Build a 2D ring without texture mapping.

Detailed Description

Builds various geometry primitives, storing them in vertex buffers.

Definition at line 572 of file StelGeometryBuilder.hpp.


Member Function Documentation

void StelGeometryBuilder::buildCircle ( StelVertexBuffer< VertexP2 > *  vertexBuffer,
const float  x,
const float  y,
const float  radius,
const int  segments = 128 
) [inline]

Build a 2D circle.

Parameters:
vertexBuffer Vertex buffer to store the circle. Must be empty, and have the line strip primitive type.
x X position of the center of the ring.
y Y position of the center of the ring.
radius Radius of the ring. Must be greater than zero.
segments Number of segments to subdivide the ring into.

Definition at line 584 of file StelGeometryBuilder.hpp.

void StelGeometryBuilder::buildCylinder ( StelVertexBuffer< VertexP3T2 > *const   vertexBuffer,
const float  radius,
const float  height,
const int  slices,
const bool  orientInside = false 
) [inline]

Build a cylinder without top and bottom caps.

Parameters:
vertexBuffer Vertex buffer to store the cylinder. Must be empty, and have the triangle strip primitive type.
radius Radius of the cylinder.
height Height of the cylinder.
slices Number of slices (sides) of the cylinder. Must be at least 3.
orientInside Should the cylinder's faces point inside?

Definition at line 624 of file StelGeometryBuilder.hpp.

void StelGeometryBuilder::buildFanDisk ( StelVertexBuffer< VertexP3T2 > *const   vertexBuffer,
StelIndexBuffer *const   indexBuffer,
const float  radius,
const int  innerFanSlices,
const int  level 
)

Build a disk having texture center at center of disk.

The disk is composed from concentric circles with increasing refinement. The number of slices of the outmost circle is (innerFanSlices << level).

Index buffer is used to decrease vertex count.

Parameters:
vertexBuffer Vertex buffer to store the fan disk. Must be empty, and have the triangles primitive type.
indexBuffer Index buffer to store indices specifying the triangles to draw.
radius Radius of the disk.
innerFanSlices Number of slices. Must be at least 3.
level Number of concentric circles. Must be at most 31, but much lower (e.g; 8) is recommended.
StelGeometryRing* StelGeometryBuilder::buildRing2D ( const RingParams params,
const Vec2f  offset = Vec2f(0.0f, 0.0f) 
) [inline]

Build a 2D ring without texture mapping.

(Note that the parameters refer to RingParams parameters)

The ring is a disk with a radius specified by the outerRadius parameter , with a circular hole in center that has radius set by the innerRadius parameter. The ring is subdivided into multiple concentric loops, and radially into multiple slices.

Orientation of the ring's faces can be flipped by the flipFaces parameter. The offset parameter is an offset that is added to positions of all vertices in the ring.

The ring must be deleted to free graphics resources.

See also:
RingParams

Definition at line 792 of file StelGeometryBuilder.hpp.

StelGeometryRing* StelGeometryBuilder::buildRingTextured ( const RingParams params,
const Vec3f  offset = Vec3f(0.0f, 0.0f, 0.0f) 
) [inline]

Build a flat texture mapped ring with 3D coordinates (for example for planet's rings).

(Note that the parameters refer to RingParams parameters)

The ring is a disk with a radius specified by the outerRadius parameter , with a circular hole in center that has radius set by the innerRadius parameter. The ring is subdivided into multiple concentric loops, and radially into multiple slices.

Orientation of the ring's faces can be flipped by the flipFaces parameter. The offset parameter is an offset that is added to positions of all vertices in the ring.

The ring must be deleted to free graphics resources.

See also:
RingParams

Definition at line 765 of file StelGeometryBuilder.hpp.

StelGeometrySphere* StelGeometryBuilder::buildSphereFisheye ( const SphereParams params,
const float  textureFov 
) [inline]

Build a fisheye-textured sphere.

The sphere must be deleted to free graphics resources.

Parameters:
params Sphere parameters.
textureFov Field of view of the texture coordinates.
See also:
SphereParams

Definition at line 689 of file StelGeometryBuilder.hpp.

StelGeometrySphere* StelGeometryBuilder::buildSphereLit ( const SphereParams params,
const StelLight light 
) [inline]

Build a regularly texture mapped sphere with lighting baked into vertex colors.

Texture coordinates: x goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y sides of the sphere, y goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes)

The sphere must be deleted to free graphics resources.

Parameters:
params Sphere parameters.
light Light to use for lighting.
See also:
SphereParams

Definition at line 736 of file StelGeometryBuilder.hpp.

StelGeometrySphere* StelGeometryBuilder::buildSphereUnlit ( const SphereParams params  )  [inline]

Build a regularly texture mapped sphere.

Texture coordinates: x goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y sides of the sphere, y goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes)

The sphere must be deleted to free graphics resources.

Parameters:
params Sphere parameters.
See also:
SphereParams

Definition at line 712 of file StelGeometryBuilder.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 14:05:45 2013 for Stellarium by  doxygen 1.6.3