r_sphere.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sphere_s

Typedefs

typedef struct sphere_s sphere_t

Functions

void R_SphereGenerate (sphere_t *sphere, const int tris, const float radius)
 Initialize the globe chain arrays.
void R_SphereRender (const sphere_t *sphere, const vec3_t pos, const vec3_t rotate, const float scale, const vec4_t lightPos)
 Draw the sphere.
void R_SphereInit (void)
 Creates the spheres we need for rendering the 3d globe.
void R_SphereShade (const sphere_t *sphere)
 render sphere using standard OpenGL lighting
void R_SphereShadeGLSL (const sphere_t *sphere)
 render sphere using GLSL (bump mapping, specularity, and season-blending)

Variables

sphere_t r_globeEarth
sphere_t r_globeMoon
sphere_t r_globeEarthAtmosphere

Typedef Documentation

typedef struct sphere_s sphere_t

Function Documentation

void R_SphereGenerate ( sphere_t sphere,
const int  tris,
const float  radius 
)

Initialize the globe chain arrays.

Parameters:
[out] sphere The sphere you want to create
[in] tris The amount of tris the globe should have - the higher the number the higher the details. tris*tris triangles are obtained.
[in] radius The radius of the sphere
See also:
R_Draw3DGlobe

< angle from the pole (z-axis)

< angle around the equator, from y-axis

Definition at line 50 of file r_sphere.c.

References sphere_s::glslProgram, i, Mem_PoolAlloc, sphere_s::normals, sphere_s::num_tris, rhoSpiral(), st, sphere_s::texes, Vector2Set, VectorNormalize2(), VectorSet, sphere_s::verts, and vid_genericPool.

Referenced by R_SphereInit().

void R_SphereInit ( void   ) 

Creates the spheres we need for rendering the 3d globe.

Note:
The moon sphere has less detail because it's smaller in the scene
The sizes are arbitrary, becasue we use orthographic projection. The real sizes are: lunarRadius = 0.273 * earthRadius, solarRadius = 110.0 * earthRadius
See also:
R_Init

Definition at line 120 of file r_sphere.c.

References CVAR_ARCHIVE, Cvar_Get(), Cvar_SetValue(), EARTH_RADIUS, cvar_s::integer, MOON_RADIUS, R_SphereGenerate(), and cvar_s::value.

Referenced by R_Init().

void R_SphereRender ( const sphere_t sphere,
const vec3_t  pos,
const vec3_t  rotate,
const float  scale,
const vec4_t  lightPos 
)

Draw the sphere.

Parameters:
[in] sphere The sphere that should be rendered
[in] pos The position (translation) of the matrix
[in] rotate The rotation of the matrix
[in] scale The scale of the matrix
[in] lightPos Set this to NULL if you don't want to change the light position

Definition at line 174 of file r_sphere.c.

References rendererData_t::aliasCount, sphere_s::num_tris, sphere_s::overlay, PITCH, R_BindDefaultArray(), R_CheckError, R_SphereCheckGLSL(), R_SphereShade(), R_SphereShadeGLSL(), refdef, ROLL, viddef_t::rx, viddef_t::ry, VectorNotEmpty, viddef, and YAW.

Referenced by R_Draw3DGlobe().

void R_SphereShade ( const sphere_t sphere  ) 
void R_SphereShadeGLSL ( const sphere_t sphere  ) 

Variable Documentation

Definition at line 32 of file r_sphere.c.

Referenced by R_Draw3DGlobe().

Definition at line 34 of file r_sphere.c.

Referenced by R_Draw3DGlobe().

Definition at line 33 of file r_sphere.c.

Referenced by R_Draw3DGlobe().


Generated by  doxygen 1.6.2