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

GalileoFunctions.h File Reference

#include <math/Vector3.h>
#include <math/ONB.h>
#include <utilities/config.h>
#include <utilities/rgb.h>

Defines

#define _GR_FUNCTIONS_   1
#define GRAssert(condition)   (condition) ? (void)0 : GRAssertHelper(__FILE__, __LINE__);
#define likely(x)   (x)
#define unlikely(x)   (x)

Functions

double GRMin (double a, double b)
double GRMax (double a, double b)
int GRAbs (int x)
double GRLerp (double factor, double a, double b)
double GRHermite (double x)
float GRPowerHeuristic (float pdf1, float pdf2)
bool GRisnan (float val)
double GRDegRad (double a)
double GRRadDeg (double a)
int GRClamp (int x, int min, int max)
int GRFloor (double x)
Vector3 GRReflect (const Vector3 &v_out, const Vector3 &n)
Vector3 GRRefract (const Vector3 &v_out, const Vector3 &n, double eta)
rgb GRNormalReflectance (const rgb &eta)
rgb GRFresnelReflectance (const rgb &eta, double cos_theta)
Vector3 GRRandDir (double uRand1, double uRand2)
void GRCosineSampleHemisphere (double r1, double r2, const ONB &uvw, Vector3 &v)
bool isBigEndian ()
template<class T>
void swapBytes (T &t)
void GRError (const char *format,...)
void GRWarning (const char *format,...)
void GRAssertHelper (char *filename, int line_number)
void GRLowercase (char *original)
bool GRFileExtension (const char *original, char *extension_buf)
bool GRFileName (const char *original, char *filename_buf)

Detailed Description

A set of general purpose functions for the galileo renderer.

Function Documentation

Vector3 GRReflect const Vector3 v_out,
const Vector3 n
[inline]
 

Calculates the direction of a reflected light ray.

Parameters:
[in] v_out Incident vector that points away from the reflecting surface
[in] n Unit-length normal vector
Returns:
The direction that results when vOut is reflected about n.

Vector3 GRRefract const Vector3 v_out,
const Vector3 n,
double  eta
[inline]
 

Calculates the direction of a refracted light ray.

Parameters:
[in] v_out Incident vector that points away from the refracting surface
[in] n Unit-length normal vector in the same hemisphere as vOut
[in] eta Ratio of the index of refraction in the incident material to the index of refraction in the other material
Returns:
The direction of the refracted ray. Total internal reflection is handled correctly.

rgb GRNormalReflectance const rgb eta  )  [inline]
 

Calculates the percentage of reflected light for a beam with normal incidence.

Parameters:
[in] eta Ratio of indices of refraction (incident / refracted)
Returns:
The fresnel reflectance for a beam at normal incidence

rgb GRFresnelReflectance const rgb eta,
double  cos_theta
[inline]
 

Calculates the Fresnel reflectance for a beam with incident angle theta.

Parameters:
[in] eta Ratio of indices of refraction (incident / refracted)
[in] cos_theta Cosine of the angle of incidence of the beam
Returns:
The reflectance for the beam.


Generated on Wed Jul 20 16:15:19 2005 for galileo by  doxygen 1.4.3