Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

gl_sphere< T, S > Class Template Reference

Template class for storing spheres with distance values. More...

#include <sphere.h>

Inheritance diagram for gl_sphere< T, S >:

sphere< T, S > List of all members.

Static Public Member Functions

void convert (ap_array< sphere< T, S > > *spheres, ap_array< gl_sphere< T, S > > *gl_spheres)
 Function to convert an array of spheres to gl_spheres.

void compute_distances (gl_sphere< T, S > *spheres, int n, double eye[3])
 Function to compute distance values for an array of gl_spheres.


Public Attributes

double distance
 Distance squared.


Detailed Description

template<class T, class S>
class gl_sphere< T, S >

Template class for storing spheres with distance values.

This class is essentially the same as the sphere class except that each gl_sphere has a distance value. This value is actually a distance squared to avoid spending time computing square roots.


Member Function Documentation

template<class T, class S>
void gl_sphere< T, S >::convert ap_array< sphere< T, S > > *  spheres,
ap_array< gl_sphere< T, S > > *  gl_spheres
[static]
 

Function to convert an array of spheres to gl_spheres.

Parameters:
spheres Pointer to an ap_array of spheres
gl_spheres Pointer to an ap_array to hold the computed gl_spheres

template<class T, class S>
void gl_sphere< T, S >::compute_distances gl_sphere< T, S > *  spheres,
int  n,
double  eye[3]
[static]
 

Function to compute distance values for an array of gl_spheres.

For each gl_sphere in the array, the distance squared from the viewing position to the sphere is computed and stored in the gl_sphere.

Parameters:
spheres Pointer to an ap_array of gl_spheres
n Number of gl_spheres to process
eye Coordinates of the viewing position


Member Data Documentation

template<class T, class S>
double gl_sphere< T, S >::distance
 

Distance squared.


The documentation for this class was generated from the following files:
Generated on Thu Nov 27 08:17:11 2003 for Animp - Animated Particles by doxygen 1.3.2