|
UFO: Alien Invasion
|
Functions to generate and render spheres. More...

Go to the source code of this file.
Data Structures | |
| struct | 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. | |
Variables | |
| sphere_t | r_globeEarth |
| sphere_t | r_globeMoon |
| sphere_t | r_globeEarthAtmosphere |
Functions to generate and render spheres.
Definition in file r_sphere.h.
Initialize the globe chain arrays.
| [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 |
< angle from the pole (z-axis)
< angle around the equator, from y-axis
Definition at line 51 of file r_sphere.cpp.
References sphere_t::glslProgram, i, M_PI, Mem_PoolAllocTypeN, sphere_t::normals, sphere_t::num_tris, rhoSpiral(), sphere_t::texes, Vector2Set, VectorNormalize2(), VectorSet, sphere_t::verts, and vid_genericPool.
Referenced by R_SphereInit().
Creates the spheres we need for rendering the 3d globe.
Definition at line 119 of file r_sphere.cpp.
References CVAR_ARCHIVE, Cvar_Get(), Cvar_SetValue(), EARTH_RADIUS, MOON_RADIUS, r_globeEarth, r_globeEarthAtmosphere, r_globeMoon, r_sphereDetails, and R_SphereGenerate().
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.
| [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 nullptr if you don't want to change the light position |
Definition at line 247 of file r_sphere.cpp.
References sphere_t::num_tris, sphere_t::overlay, PITCH, R_BindDefaultArray(), R_CheckError, R_SphereCheckGLSL(), R_SphereShade(), R_SphereShadeGLSL(), refdef, ROLL, scale, VectorNotEmpty, viddef, and YAW.
Referenced by R_Draw3DGlobe().
|
extern |
Definition at line 33 of file r_sphere.cpp.
Referenced by R_Draw3DGlobe(), and R_SphereInit().
|
extern |
Definition at line 35 of file r_sphere.cpp.
Referenced by R_Draw3DGlobe(), and R_SphereInit().
|
extern |
Definition at line 34 of file r_sphere.cpp.
Referenced by R_Draw3DGlobe(), and R_SphereInit().