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

utilities.inl File Reference

Go to the source code of this file.

Functions

int IntSquareRoot (int n)
bool IsSquare (int n)
void VectorToSphericalCoords (const sheep::Vector3 &v, sheep::Real *phi, sheep::Real *theta)
sheep::Vector3 SphericalCoordsToVector (sheep::Real phi, sheep::Real theta)
void PackSphericalCoords (sheep::Real phi, sheep::Real theta, sheep::uint8 *qphi, sheep::uint8 *qtheta)
void UnpackSphericalCoords (sheep::uint8 qphi, sheep::uint8 qtheta, sheep::Real *phi, sheep::Real *theta)
void PackSphericalCoords (sheep::Real phi, sheep::Real theta, sheep::uint8 *q)
void UnpackSphericalCoords (sheep::uint8 q, sheep::Real *phi, sheep::Real *theta)
void PackDirection (const sheep::Vector3 &v, sheep::uint8 *qphi, sheep::uint8 *qtheta)
 Helper function.

void PackDirection (const sheep::Vector3 &v, sheep::uint8 *q)
 Helper function.

sheep::Vector3 UnpackDirection (sheep::uint8 qphi, sheep::uint8 qtheta)
sheep::Vector3 UnpackDirection (sheep::uint8 q)


Function Documentation

int IntSquareRoot int  n  )  [inline]
 

Definition at line 24 of file utilities.inl.

Referenced by IsSquare().

bool IsSquare int  n  )  [inline]
 

Definition at line 29 of file utilities.inl.

References IntSquareRoot(), and sheep::sq().

void PackDirection const sheep::Vector3 v,
sheep::uint8 *  q
[inline]
 

Helper function.

Definition at line 160 of file utilities.inl.

References PackSphericalCoords(), sheep::Real, and VectorToSphericalCoords().

void PackDirection const sheep::Vector3 v,
sheep::uint8 *  qphi,
sheep::uint8 *  qtheta
[inline]
 

Helper function.

Definition at line 150 of file utilities.inl.

References PackSphericalCoords(), sheep::Real, and VectorToSphericalCoords().

void PackSphericalCoords sheep::Real  phi,
sheep::Real  theta,
sheep::uint8 *  q
[inline]
 

Packs a direction expressed in spherical coordinates to a compact 8-bit representation.

Definition at line 108 of file utilities.inl.

References sheep::NormalizeAngle(), and sheep::Real.

Referenced by PackDirection().

void PackSphericalCoords sheep::Real  phi,
sheep::Real  theta,
sheep::uint8 *  qphi,
sheep::uint8 *  qtheta
[inline]
 

Packs a direction expressed in spherical coordinates to a compact 16-bit representation.

Definition at line 68 of file utilities.inl.

References sheep::NormalizeAngle(), and sheep::Real.

sheep::Vector3 SphericalCoordsToVector sheep::Real  phi,
sheep::Real  theta
[inline]
 

Converts from spherical coordinates to cartesian coordinates. Returned vector is unit-length.

Definition at line 54 of file utilities.inl.

References sheep::Vector3::IsUnitLength(), and sheep::Real.

Referenced by toxic::Sphere::ComputeIrradiance(), and toxic::ConversionTables::ConversionTables().

sheep::Vector3 UnpackDirection sheep::uint8  q  )  [inline]
 

Not a helper function. Same as UnpackSphericalCoords() followed by SphericalCoordsToVector(), but much faster.

Definition at line 181 of file utilities.inl.

sheep::Vector3 UnpackDirection sheep::uint8  qphi,
sheep::uint8  qtheta
[inline]
 

Not a helper function. Same as UnpackSphericalCoords() followed by SphericalCoordsToVector(), but much faster.

Definition at line 167 of file utilities.inl.

References sheep::Vector3::IsUnitLength(), and sheep::Real.

void UnpackSphericalCoords sheep::uint8  q,
sheep::Real phi,
sheep::Real theta
[inline]
 

Unpacks spherical coordinates from the 16-bit representation. phi is in [0, 2*Pi], theta is in [0, Pi].

Todo:
Could be faster with a conversion table.

Definition at line 135 of file utilities.inl.

References sheep::Real.

void UnpackSphericalCoords sheep::uint8  qphi,
sheep::uint8  qtheta,
sheep::Real phi,
sheep::Real theta
[inline]
 

Unpacks spherical coordinates from the 16-bit representation. phi is in [0, 2*Pi], theta is in [0, Pi].

Todo:
Could be faster with a conversion table.

Definition at line 96 of file utilities.inl.

References sheep::Real.

void VectorToSphericalCoords const sheep::Vector3 v,
sheep::Real phi,
sheep::Real theta
[inline]
 

Converts from cartesian coordinates to spherical coordinates. v must be a unit-length vector. phi is in [0, 2*Pi], theta is in [0, Pi].

Todo:
Turn the multiplication into an addition.

Definition at line 34 of file utilities.inl.

References sheep::Vector3::IsUnitLength(), sheep::Vector3::m_x, sheep::Vector3::m_y, sheep::Vector3::m_z, and sheep::Real.

Referenced by toxic::PhotonMap::BuildPhotonDirectionHistogram(), and PackDirection().


Generated on Tue May 11 01:31:53 2004 for toxic by doxygen 1.3.6