Blender V4.3
btConvexHull.cpp File Reference
#include <string.h>
#include "btConvexHull.h"
#include "btAlignedObjectArray.h"
#include "btMinMax.h"
#include "btVector3.h"

Go to the source code of this file.

Classes

class  int3
 
class  VertFlag
 
class  EdgeFlag
 
class  PlaneFlag
 
class  Coplanar
 
class  btHullTriangle
 

Macros

#define COPLANAR   (0)
 
#define UNDER   (1)
 
#define OVER   (2)
 
#define SPLIT   (OVER | UNDER)
 
#define PAPERWIDTH   (btScalar(0.001))
 
#define EPSILON   btScalar(0.000001) /* close enough to consider two btScalaring point numbers to be 'the same'. */
 

Typedefs

typedef ConvexH::HalfEdge HalfEdge
 

Functions

btPlane PlaneFlip (const btPlane &plane)
 
int operator== (const btPlane &a, const btPlane &b)
 
int coplanar (const btPlane &a, const btPlane &b)
 
btVector3 PlaneLineIntersection (const btPlane &plane, const btVector3 &p0, const btVector3 &p1)
 
btVector3 PlaneProject (const btPlane &plane, const btVector3 &point)
 
btVector3 ThreePlaneIntersection (const btPlane &p0, const btPlane &p1, const btPlane &p2)
 
btScalar DistanceBetweenLines (const btVector3 &ustart, const btVector3 &udir, const btVector3 &vstart, const btVector3 &vdir, btVector3 *upoint=NULL, btVector3 *vpoint=NULL)
 
btVector3 TriNormal (const btVector3 &v0, const btVector3 &v1, const btVector3 &v2)
 
btVector3 NormalOf (const btVector3 *vert, const int n)
 
int PlaneTest (const btPlane &p, const btVector3 &v)
 
int SplitTest (ConvexH &convex, const btPlane &plane)
 
template<class T >
int maxdirfiltered (const T *p, int count, const T &dir, btAlignedObjectArray< int > &allow)
 
btVector3 orth (const btVector3 &v)
 
template<class T >
int maxdirsterid (const T *p, int count, const T &dir, btAlignedObjectArray< int > &allow)
 
int operator== (const int3 &a, const int3 &b)
 
int above (btVector3 *vertices, const int3 &t, const btVector3 &p, btScalar epsilon)
 
int hasedge (const int3 &t, int a, int b)
 
int hasvert (const int3 &t, int v)
 
int shareedge (const int3 &a, const int3 &b)
 
void ReleaseHull (PHullResult &result)
 
static void addPoint (unsigned int &vcount, btVector3 *p, btScalar x, btScalar y, btScalar z)
 
btScalar GetDist (btScalar px, btScalar py, btScalar pz, const btScalar *p2)
 

Variables

btScalar planetestepsilon = PAPERWIDTH
 

Macro Definition Documentation

◆ COPLANAR

#define COPLANAR   (0)

Definition at line 136 of file btConvexHull.cpp.

Referenced by PlaneTest().

◆ EPSILON

#define EPSILON   btScalar(0.000001) /* close enough to consider two btScalaring point numbers to be 'the same'. */

◆ OVER

#define OVER   (2)

Definition at line 138 of file btConvexHull.cpp.

Referenced by PlaneTest().

◆ PAPERWIDTH

#define PAPERWIDTH   (btScalar(0.001))

Definition at line 140 of file btConvexHull.cpp.

◆ SPLIT

#define SPLIT   (OVER | UNDER)

Definition at line 139 of file btConvexHull.cpp.

◆ UNDER

#define UNDER   (1)

Definition at line 137 of file btConvexHull.cpp.

Referenced by PlaneTest().

Typedef Documentation

◆ HalfEdge

typedef ConvexH::HalfEdge HalfEdge

Definition at line 144 of file btConvexHull.cpp.

Function Documentation

◆ above()

int above ( btVector3 * vertices,
const int3 & t,
const btVector3 & p,
btScalar epsilon )

Definition at line 289 of file btConvexHull.cpp.

References btDot(), and TriNormal().

◆ addPoint()

static void addPoint ( unsigned int & vcount,
btVector3 * p,
btScalar x,
btScalar y,
btScalar z )
static

Definition at line 802 of file btConvexHull.cpp.

References x, y, and z().

◆ coplanar()

int coplanar ( const btPlane & a,
const btPlane & b )
inline

Definition at line 44 of file btConvexHull.cpp.

References b, and PlaneFlip().

◆ DistanceBetweenLines()

btScalar DistanceBetweenLines ( const btVector3 & ustart,
const btVector3 & udir,
const btVector3 & vstart,
const btVector3 & vdir,
btVector3 * upoint = NULL,
btVector3 * vpoint = NULL )

Definition at line 111 of file btConvexHull.cpp.

References btCross(), btDot(), fabs(), btPlane::normal, and PlaneLineIntersection().

◆ GetDist()

btScalar GetDist ( btScalar px,
btScalar py,
btScalar pz,
const btScalar * p2 )

Definition at line 813 of file btConvexHull.cpp.

◆ hasedge()

int hasedge ( const int3 & t,
int a,
int b )

Definition at line 295 of file btConvexHull.cpp.

References b.

Referenced by shareedge().

◆ hasvert()

int hasvert ( const int3 & t,
int v )

Definition at line 305 of file btConvexHull.cpp.

References v.

◆ maxdirfiltered()

template<class T >
int maxdirfiltered ( const T * p,
int count,
const T & dir,
btAlignedObjectArray< int > & allow )

Definition at line 203 of file btConvexHull.cpp.

References btAssert, btDot(), and count.

Referenced by maxdirsterid().

◆ maxdirsterid()

template<class T >
int maxdirsterid ( const T * p,
int count,
const T & dir,
btAlignedObjectArray< int > & allow )

Definition at line 233 of file btConvexHull.cpp.

References btAssert, btCos(), btCross(), btSin(), count, maxdirfiltered(), orth(), SIMD_RADS_PER_DEG, v, and x.

◆ NormalOf()

btVector3 NormalOf ( const btVector3 * vert,
const int n )

◆ operator==() [1/2]

int operator== ( const btPlane & a,
const btPlane & b )
inline

Definition at line 43 of file btConvexHull.cpp.

References b.

◆ operator==() [2/2]

int operator== ( const int3 & a,
const int3 & b )

Definition at line 279 of file btConvexHull.cpp.

References b.

◆ orth()

btVector3 orth ( const btVector3 & v)

Definition at line 218 of file btConvexHull.cpp.

References b, btCross(), btVector3, and v.

Referenced by maxdirsterid(), and stretchto_evaluate().

◆ PlaneFlip()

btPlane PlaneFlip ( const btPlane & plane)
inline

Definition at line 42 of file btConvexHull.cpp.

Referenced by coplanar().

◆ PlaneLineIntersection()

btVector3 PlaneLineIntersection ( const btPlane & plane,
const btVector3 & p0,
const btVector3 & p1 )

Definition at line 86 of file btConvexHull.cpp.

References btDot().

Referenced by DistanceBetweenLines().

◆ PlaneProject()

btVector3 PlaneProject ( const btPlane & plane,
const btVector3 & point )

Definition at line 96 of file btConvexHull.cpp.

References btDot().

◆ PlaneTest()

int PlaneTest ( const btPlane & p,
const btVector3 & v )

Definition at line 154 of file btConvexHull.cpp.

References btDot(), COPLANAR, btPlane::dist, flag, btPlane::normal, OVER, planetestepsilon, UNDER, and v.

Referenced by SplitTest().

◆ ReleaseHull()

void ReleaseHull ( PHullResult & result)

Definition at line 646 of file btConvexHull.cpp.

Referenced by HullLibrary::CreateConvexHull().

◆ shareedge()

int shareedge ( const int3 & a,
const int3 & b )

Definition at line 310 of file btConvexHull.cpp.

References b, and hasedge().

◆ SplitTest()

int SplitTest ( ConvexH & convex,
const btPlane & plane )

◆ ThreePlaneIntersection()

btVector3 ThreePlaneIntersection ( const btPlane & p0,
const btPlane & p1,
const btPlane & p2 )

Definition at line 52 of file btConvexHull.cpp.

References btAssert, btFabs(), btPlane::dist, btPlane::normal, and result.

◆ TriNormal()

btVector3 TriNormal ( const btVector3 & v0,
const btVector3 & v1,
const btVector3 & v2 )

Definition at line 101 of file btConvexHull.cpp.

References btCross(), btVector3, and v2.

Referenced by above().

Variable Documentation

◆ planetestepsilon

btScalar planetestepsilon = PAPERWIDTH

Definition at line 142 of file btConvexHull.cpp.

Referenced by PlaneTest().