1#ifndef BT_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
2#define BT_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
30#define PLANEDIREPSILON 0.0000001f
31#define PARALELENORMALS 0.000001f
33#define BT_CLAMP(number, minval, maxval) (number < minval ? minval : (number > maxval ? maxval : number))
141 N[0] = (
_M[0] +
_M[1]) * 0.5f;
142 N[1] = (
_M[2] +
_M[3]) * 0.5f;
151 else if (
_M[1] <
_M[3])
169 else if (
_M[3] <
_M[1])
184 _M.setValue(
N[0],
N[1],
N[2],
vB1.dot(
N));
#define BT_SWAP_NUMBERS(a, b)
Swap numbers.
btScalar bt_distance_point_plane(const btVector4 &plane, const btVector3 &point)
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
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.
void bt_closest_point_on_segment(btVector3 &cp, const btVector3 &v, const btVector3 &e1, const btVector3 &e2)
#define BT_CLAMP(number, minval, maxval)
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.
const T & btMax(const T &a, const T &b)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btFabs(btScalar x)
#define SIMD_FORCE_INLINE
btVector3 can be used to represent 3D points and vectors.
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
btScalar dot(const btVector3 &v) const
Return the dot product.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btScalar length2() const
Return the length of the vector squared.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.