Blender V2.61 - r43446
Defines | Functions

btGeometryOperations.h File Reference

#include "btBoxCollision.h"

Go to the source code of this file.

Defines

#define PLANEDIREPSILON   0.0000001f
#define PARALELENORMALS   0.000001f
#define BT_CLAMP(number, minval, maxval)   (number<minval?minval:(number>maxval?maxval:number))

Functions

SIMD_FORCE_INLINE void bt_edge_plane (const btVector3 &e1, const btVector3 &e2, const btVector3 &normal, btVector4 &plane)
 Calc a plane from a triangle edge an a normal. plane is a vec4f.
SIMD_FORCE_INLINE void bt_closest_point_on_segment (btVector3 &cp, const btVector3 &v, const btVector3 &e1, const btVector3 &e2)
SIMD_FORCE_INLINE int bt_line_plane_collision (const btVector4 &plane, const btVector3 &vDir, const btVector3 &vPoint, btVector3 &pout, btScalar &tparam, btScalar tmin, btScalar tmax)
 line plane collision
SIMD_FORCE_INLINE void bt_segment_collision (const btVector3 &vA1, const btVector3 &vA2, const btVector3 &vB1, const btVector3 &vB2, btVector3 &vPointA, btVector3 &vPointB)
 Find closest points on segments.

Detailed Description

Author:
Francisco Leon Najera

Definition in file btGeometryOperations.h.


Define Documentation

#define BT_CLAMP (   number,
  minval,
  maxval 
)    (number<minval?minval:(number>maxval?maxval:number))

Definition at line 38 of file btGeometryOperations.h.

Referenced by bt_segment_collision().

#define PARALELENORMALS   0.000001f

Definition at line 35 of file btGeometryOperations.h.

#define PLANEDIREPSILON   0.0000001f

Definition at line 34 of file btGeometryOperations.h.

Referenced by bt_line_plane_collision().


Function Documentation

SIMD_FORCE_INLINE void bt_closest_point_on_segment ( btVector3 &  cp,
const btVector3 &  v,
const btVector3 &  e1,
const btVector3 &  e2 
)

Finds the closest point(cp) to (v) on a segment (e1,e2)

Definition at line 54 of file btGeometryOperations.h.

Referenced by bt_segment_collision().

SIMD_FORCE_INLINE void bt_edge_plane ( const btVector3 &  e1,
const btVector3 &  e2,
const btVector3 &  normal,
btVector4 plane 
)

Calc a plane from a triangle edge an a normal. plane is a vec4f.

Definition at line 41 of file btGeometryOperations.h.

References cross(), and btVector4::setValue().

Referenced by btPrimitiveTriangle::get_edge_plane().

SIMD_FORCE_INLINE int bt_line_plane_collision ( const btVector4 plane,
const btVector3 &  vDir,
const btVector3 &  vPoint,
btVector3 &  pout,
btScalar tparam,
btScalar  tmin,
btScalar  tmax 
)

line plane collision

Returns:
-0 if the ray never intersects -1 if the ray collides in front -2 if the ray collides in back

Definition at line 84 of file btGeometryOperations.h.

References bt_distance_point_plane(), btFabs(), and PLANEDIREPSILON.

Referenced by bt_segment_collision().

SIMD_FORCE_INLINE void bt_segment_collision ( const btVector3 &  vA1,
const btVector3 &  vA2,
const btVector3 &  vB1,
const btVector3 &  vB2,
btVector3 &  vPointA,
btVector3 &  vPointB 
)

Find closest points on segments.

Definition at line 121 of file btGeometryOperations.h.

References BT_CLAMP, bt_closest_point_on_segment(), bt_line_plane_collision(), BT_SWAP_NUMBERS, N, btVector4::setValue(), and SIMD_EPSILON.