openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
OpenRAVE::geometry Namespace Reference

Templated math and geometric functions. More...

Classes

class  RaveVector
 Vector class containing 4 dimensions. More...
 
class  RaveTransform
 Affine transformation parameterized with quaterions. More...
 
class  RaveTransformMatrix
 Affine transformation parameterized with rotation matrices. Scales and shears are not supported. More...
 
class  ray
 A ray defined by an origin and a direction. More...
 
class  aabb
 An axis aligned bounding box. More...
 
class  OrientedBox
 An oriented bounding box. More...
 
class  obb
 An oriented bounding box. More...
 
class  triangle
 A triangle defined by 3 points. More...
 
class  frustum
 A pyramid with its vertex clipped. More...
 
class  RaveCameraIntrinsics
 intrinsic parameters for a camera. More...
 

Functions

float MATH_SQRT (float f)
 
double MATH_SQRT (double f)
 
float MATH_SIN (float f)
 
double MATH_SIN (double f)
 
float MATH_COS (float f)
 
double MATH_COS (double f)
 
float MATH_FABS (float f)
 
double MATH_FABS (double f)
 
float MATH_ACOS (float f)
 
double MATH_ACOS (double f)
 
float MATH_ASIN (float f)
 
double MATH_ASIN (double f)
 
float MATH_ATAN2 (float fy, float fx)
 
double MATH_ATAN2 (double fy, double fx)
 
template<typename T >
RaveVector< T > operator* (float f, const RaveVector< T > &left)
 
template<typename T >
RaveVector< T > operator* (double f, const RaveVector< T > &left)
 
template<typename T >
RaveVector< T > quatFromAxisAngle (const RaveVector< T > &axis, T angle)
 Converts an axis-angle rotation into a quaternion.
 
template<typename T >
RaveVector< T > quatFromAxisAngle (const RaveVector< T > &axisangle)
 Converts an axis-angle rotation into a quaternion.
 
template<typename T >
RaveVector< T > quatFromMatrix (const RaveTransformMatrix< T > &rotation)
 Converts the rotation of a matrix into a quaternion.
 
template<typename T >
RaveTransformMatrix< T > matrixFromQuat (const RaveVector< T > &quat)
 Converts a quaternion to a 3x3 matrix.
 
template<typename T >
void matrixFromQuat (RaveTransformMatrix< T > &rotation, const RaveVector< T > &quat)
 Converts a quaternion to a 3x3 matrix.
 
template<typename T >
RaveTransformMatrix< T > matrixFromAxisAngle (const RaveVector< T > &axis, T angle)
 Converts an axis-angle rotation to a 3x3 matrix.
 
template<typename T >
RaveTransformMatrix< T > matrixFromAxisAngle (const RaveVector< T > &axisangle)
 Converts an axis-angle rotation to a 3x3 matrix.
 
template<typename T >
RaveVector< T > quatMultiply (const RaveVector< T > &quat0, const RaveVector< T > &quat1)
 Multiply two quaternions.
 
template<typename T >
RaveVector< T > quatInverse (const RaveVector< T > &quat)
 Inverted a quaternion rotation.
 
template<typename T >
RaveVector< T > quatSlerp (const RaveVector< T > &quat0, const RaveVector< T > &quat1, T t)
 Sphereical linear interpolation between two quaternions.
 
template<typename T >
RaveVector< T > dQSlerp (const RaveVector< T > &qa, const RaveVector< T > &_qb, T t)
 
template<typename T >
RaveVector< T > quatRotate (const RaveVector< T > &q, const RaveVector< T > &t)
 transform a vector by a quaternion
 
template<typename T >
RaveVector< T > quatRotateDirection (const RaveVector< T > &sourcedir, const RaveVector< T > &targetdir)
 Return the minimal quaternion that orients sourcedir to targetdir.
 
template<typename T >
std::pair< T, RaveVector< T > > normalizeAxisRotation (const RaveVector< T > &axis, const RaveVector< T > &quat)
 Find the rotation theta around axis such that rot(axis,theta) * q is closest to the identity rotation.
 
template<typename T >
RaveVector< T > axisAngleFromQuat (const RaveVector< T > &quat)
 Converts a quaternion into the axis-angle representation.
 
template<typename T >
RaveVector< T > axisAngleFromMatrix (const RaveTransformMatrix< T > &rotation)
 Converts the rotation of a matrix into axis-angle representation.
 
template<typename T >
RaveTransformMatrix< T > transformLookat (const RaveVector< T > &vlookat, const RaveVector< T > &vcamerapos, const RaveVector< T > &vcameraup)
 Returns a camera matrix that looks along a ray with a desired up vector.
 
template<typename T >
int insideQuadrilateral (const RaveVector< T > &v, const RaveVector< T > &verts)
 Tests a point inside a 3D quadrilateral.
 
template<typename T >
int insideTriangle (const RaveVector< T > v, const triangle< T > &tri)
 Tests a point insdie a 3D triangle.
 
template<typename T >
bool RayAABBTest (const ray< T > &r, const aabb< T > &ab)
 Test collision of a ray with an axis aligned bounding box.
 
template<typename T >
bool RayOBBTest (const ray< T > &r, const obb< T > &o)
 Test collision of a ray and an oriented bounding box.
 
template<typename T >
bool IsOBBinFrustum (const obb< T > &o, const frustum< T > &fr)
 Test collision of an oriented bounding box and a frustum.
 
template<typename T , typename U >
bool IsOBBinConvexHull (const obb< T > &o, const U &vplanes)
 Tests if an oriented bounding box is inside a 3D convex hull.
 
template<typename T >
bool TriTriCollision (const RaveVector< T > &u1, const RaveVector< T > &u2, const RaveVector< T > &u3, const RaveVector< T > &v1, const RaveVector< T > &v2, const RaveVector< T > &v3, RaveVector< T > &contactpos, RaveVector< T > &contactnorm)
 Test collision if two 3D triangles.Assuming triangle vertices are declared counter-clockwise!!
 
template<typename T >
obb< T > OBBFromAABB (const aabb< T > &ab, const RaveTransformMatrix< T > &t)
 Transform an axis aligned bounding box to an oriented bounding box.
 
template<typename T >
obb< T > OBBFromAABB (const aabb< T > &ab, const RaveTransform< T > &t)
 Transform an axis aligned bounding box to an oriented bounding box.
 
template<typename T >
obb< T > TransformOBB (const RaveTransform< T > &t, const obb< T > &o)
 Transforms an oriented bounding box.
 
template<typename T >
obb< T > TransformOBB (const RaveTransformMatrix< T > &t, const obb< T > &o)
 Transforms an oriented bounding box.
 
template<typename T >
bool AABBCollision (const aabb< T > &ab1, const aabb< T > &ab2)
 projects an obb along the world axes
 
Primitive Serialization functions.

Don't add new lines to the output << operators. Some applications use it to serialize the data to send across the network.

template<typename U >
std::ostream & operator<< (std::ostream &O, const RaveVector< U > &v)
 
template<typename U >
std::istream & operator>> (std::istream &I, RaveVector< U > &v)
 
template<typename U >
std::ostream & operator<< (std::ostream &O, const RaveTransform< U > &v)
 
template<typename U >
std::istream & operator>> (std::istream &I, RaveTransform< U > &v)
 
template<typename U >
std::ostream & operator<< (std::ostream &O, const ray< U > &r)
 
template<typename U >
std::istream & operator>> (std::istream &I, ray< U > &r)
 
template<typename U >
std::ostream & operator<< (std::ostream &O, const RaveTransformMatrix< U > &v)
 serialize in column order! This is the format transformations are passed across the network
 
template<typename U >
std::istream & operator>> (std::istream &I, RaveTransformMatrix< U > &v)
 de-serialize in column order! This is the format transformations are passed across the network
 
Distnace functions.
template<typename T >
DistVertexOBBSq (const RaveVector< T > &v, const obb< T > &o)
 The minimum distance form the vertex to the oriented bounding box.
 

Detailed Description

Templated math and geometric functions.

Function Documentation

template<typename T >
RaveVector<T> OpenRAVE::geometry::dQSlerp ( const RaveVector< T > &  qa,
const RaveVector< T > &  _qb,
t 
)
inline

Definition at line 1028 of file geometry.h.

float OpenRAVE::geometry::MATH_ACOS ( float  f)
inline

Definition at line 134 of file geometry.h.

double OpenRAVE::geometry::MATH_ACOS ( double  f)
inline

Definition at line 144 of file geometry.h.

float OpenRAVE::geometry::MATH_ASIN ( float  f)
inline

Definition at line 154 of file geometry.h.

double OpenRAVE::geometry::MATH_ASIN ( double  f)
inline

Definition at line 164 of file geometry.h.

float OpenRAVE::geometry::MATH_ATAN2 ( float  fy,
float  fx 
)
inline

Definition at line 174 of file geometry.h.

double OpenRAVE::geometry::MATH_ATAN2 ( double  fy,
double  fx 
)
inline

Definition at line 184 of file geometry.h.

float OpenRAVE::geometry::MATH_COS ( float  f)
inline

Definition at line 94 of file geometry.h.

double OpenRAVE::geometry::MATH_COS ( double  f)
inline

Definition at line 104 of file geometry.h.

float OpenRAVE::geometry::MATH_FABS ( float  f)
inline

Definition at line 114 of file geometry.h.

double OpenRAVE::geometry::MATH_FABS ( double  f)
inline

Definition at line 124 of file geometry.h.

float OpenRAVE::geometry::MATH_SIN ( float  f)
inline

Definition at line 74 of file geometry.h.

double OpenRAVE::geometry::MATH_SIN ( double  f)
inline

Definition at line 84 of file geometry.h.

float OpenRAVE::geometry::MATH_SQRT ( float  f)
inline

Definition at line 55 of file geometry.h.

double OpenRAVE::geometry::MATH_SQRT ( double  f)
inline

Definition at line 64 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::operator* ( float  f,
const RaveVector< T > &  left 
)
inline

Definition at line 351 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::operator* ( double  f,
const RaveVector< T > &  left 
)
inline

Definition at line 362 of file geometry.h.

template<typename U >
std::ostream& OpenRAVE::geometry::operator<< ( std::ostream &  O,
const RaveVector< U > &  v 
)

Definition at line 750 of file geometry.h.

template<typename U >
std::ostream& OpenRAVE::geometry::operator<< ( std::ostream &  O,
const RaveTransform< U > &  v 
)

Definition at line 762 of file geometry.h.

template<typename U >
std::ostream& OpenRAVE::geometry::operator<< ( std::ostream &  O,
const ray< U > &  r 
)

Definition at line 774 of file geometry.h.

template<typename U >
std::ostream& OpenRAVE::geometry::operator<< ( std::ostream &  O,
const RaveTransformMatrix< U > &  v 
)

serialize in column order! This is the format transformations are passed across the network

Definition at line 788 of file geometry.h.

template<typename U >
std::istream& OpenRAVE::geometry::operator>> ( std::istream &  I,
RaveVector< U > &  v 
)

Definition at line 756 of file geometry.h.

template<typename U >
std::istream& OpenRAVE::geometry::operator>> ( std::istream &  I,
RaveTransform< U > &  v 
)

Definition at line 768 of file geometry.h.

template<typename U >
std::istream& OpenRAVE::geometry::operator>> ( std::istream &  I,
ray< U > &  r 
)

Definition at line 780 of file geometry.h.

template<typename U >
std::istream& OpenRAVE::geometry::operator>> ( std::istream &  I,
RaveTransformMatrix< U > &  v 
)

de-serialize in column order! This is the format transformations are passed across the network

Definition at line 795 of file geometry.h.