kn Namespace Reference


Classes

class  GeometryException
 Exception thrown in case of geometry error. More...

Functions

std::ostream & operator<< (std::ostream &stream, const GeometryException &err)
 Operator << for GeometryException.
template<typename T >
kn::Vector3< T > barycentricToPoint (const kn::Vector3< T > &pointA, const kn::Vector3< T > &pointB, const kn::Vector3< T > &pointC, const kn::Vector2< T > &bary)
 convert barycentric coordinates of a triangle in world-space coordinates
std::pair< kn::Vector2d, double > intersectTriangle (const kn::Vector3d &pointA, const kn::Vector3d &pointB, const kn::Vector3d &pointC, const kn::Vector3d &rayDirection,const kn::Vector3d &rayOrigin)
 Intersect a triangle If the returned distance is negative, no intersection was found.
std::pair< kn::Vector3d, double > intersectOBB (const kn::Vector3d &center, const kn::Vector3d a[3], const kn::Vector3d &h, const kn::Vector3d &rayDirection,const kn::Vector3d &rayOrigin)
 Intersect an Oriented Bounding Box If the returned distance is negative, no intersection was found.
std::pair< kn::Vector3d, double > intersectSphere (const kn::Vector3d &spherePosition, double sphereRadius, const kn::Vector3d &rayDirection,const kn::Vector3d &rayOrigin)
 Intersect a sphere If the returned distance is negative, no intersection was found.

Variables

static const float MAX_FLOAT = std::numeric_limits<float>::max()
static const float MIN_FLOAT = std::numeric_limits<float>::min()

Function Documentation

template<typename T >
kn::Vector3<T> kn::barycentricToPoint ( const kn::Vector3< T > &  pointA,
const kn::Vector3< T > &  pointB,
const kn::Vector3< T > &  pointC,
const kn::Vector2< T > &  bary 
) [inline]

convert barycentric coordinates of a triangle in world-space coordinates

Parameters:
pointA First point of the triangle
pointB Second point of the triangle
pointC Third point of the triangle
bary Barycentric coordinates
Returns:
World-space coordinates

Definition at line 58 of file GeometryTools.hpp.

std::pair< kn::Vector3d, double > kn::intersectOBB ( const kn::Vector3d &  center,
const kn::Vector3d  a[3],
const kn::Vector3d &  h,
const kn::Vector3d &  rayDirection,
const kn::Vector3d &  rayOrigin 
)

Intersect an Oriented Bounding Box If the returned distance is negative, no intersection was found.

Parameters:
center Center of the bounding box
a Normalized side directions (x,y,z)
h Positive half-lengths
rayDirection Direction of the intersection ray
rayOrigin Origin of the ray
Returns:
Poistion of the intersection and distance to the intersection

Definition at line 95 of file Intersection.cpp.

std::pair< kn::Vector3d, double > kn::intersectSphere ( const kn::Vector3d &  spherePosition,
double  sphereRadius,
const kn::Vector3d &  rayDirection,
const kn::Vector3d &  rayOrigin 
)

Intersect a sphere If the returned distance is negative, no intersection was found.

Parameters:
spherePosition position of the center of the sphere
radius radius of the sphere
rayDirection Direction of the intersection ray
rayOrigin Origin of the ray
Returns:
Poistion of the intersection and distance to the intersection

Definition at line 123 of file Intersection.cpp.

std::pair< kn::Vector2d, double > kn::intersectTriangle ( const kn::Vector3d &  pointA,
const kn::Vector3d &  pointB,
const kn::Vector3d &  pointC,
const kn::Vector3d &  rayDirection,
const kn::Vector3d &  rayOrigin 
)

Intersect a triangle If the returned distance is negative, no intersection was found.

Parameters:
pointA First point of the triangle
pointB Second point of the triangle
pointC Third point of the triangle
rayDirection Direction of the intersection ray
rayOrigin Origin of the ray
Returns:
Barycentric coordinates of the intersection and distance to the intersection

Definition at line 48 of file Intersection.cpp.

std::ostream& kn::operator<< ( std::ostream &  stream,
const GeometryException &  err 
) [inline]

Operator << for GeometryException.

Parameters:
stream output stream GeometryException to print
Returns:
output stream

Definition at line 98 of file GeometryException.hpp.


Variable Documentation

const float kn::MAX_FLOAT = std::numeric_limits<float>::max() [static]

Definition at line 42 of file GeometryTools.hpp.

const float kn::MIN_FLOAT = std::numeric_limits<float>::min() [static]

Definition at line 47 of file GeometryTools.hpp.


Generated on Thu Nov 12 16:06:36 2009 for OpenKN-geometry by  doxygen 1.5.8