Bullet Collision Detection & Physics Library
btBatchedConstraints.cpp File Reference
#include "btBatchedConstraints.h"
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btMinMax.h"
#include "LinearMath/btStackAlloc.h"
#include "LinearMath/btQuickprof.h"
#include <string.h>
#include <cmath>
Include dependency graph for btBatchedConstraints.cpp:

Go to the source code of this file.

Classes

struct  btBatchedConstraintInfo
 
struct  btBatchInfo
 
struct  ReadSolverConstraintsLoop
 
struct  ExpandConstraintRowsLoop
 
struct  UpdateConstraintBatchIdsForMergesLoop
 
struct  WriteOutConstraintIndicesLoop
 
class  PreallocatedMemoryHelper< N >
 
struct  PreallocatedMemoryHelper< N >::Chunk
 
struct  btIntVec3
 
struct  AssignConstraintsToGridBatchesParams
 
struct  AssignConstraintsToGridBatchesLoop
 

Functions

static void debugDrawSingleBatch (const btBatchedConstraints *bc, btConstraintArray *constraints, const btAlignedObjectArray< btSolverBody > &bodies, int iBatch, const btVector3 &color, const btVector3 &offset)
 
static void debugDrawPhase (const btBatchedConstraints *bc, btConstraintArray *constraints, const btAlignedObjectArray< btSolverBody > &bodies, int iPhase, const btVector3 &color0, const btVector3 &color1, const btVector3 &offset)
 
static void debugDrawAllBatches (const btBatchedConstraints *bc, btConstraintArray *constraints, const btAlignedObjectArray< btSolverBody > &bodies)
 
static void initBatchedBodyDynamicFlags (btAlignedObjectArray< bool > *outBodyDynamicFlags, const btAlignedObjectArray< btSolverBody > &bodies)
 
static int runLengthEncodeConstraintInfo (btBatchedConstraintInfo *outConInfos, int numConstraints)
 
static int initBatchedConstraintInfo (btBatchedConstraintInfo *outConInfos, btConstraintArray *constraints)
 
static void expandConstraintRowsInPlace (int *constraintBatchIds, const btBatchedConstraintInfo *conInfos, int numConstraints, int numConstraintRows)
 
static void expandConstraintRows (int *destConstraintBatchIds, const int *srcConstraintBatchIds, const btBatchedConstraintInfo *conInfos, int numConstraints, int numConstraintRows)
 
static void expandConstraintRowsMt (int *destConstraintBatchIds, const int *srcConstraintBatchIds, const btBatchedConstraintInfo *conInfos, int numConstraints, int numConstraintRows)
 
static void initBatchedConstraintInfoArray (btAlignedObjectArray< btBatchedConstraintInfo > *outConInfos, btConstraintArray *constraints)
 
static void mergeSmallBatches (btBatchInfo *batches, int iBeginBatch, int iEndBatch, int minBatchSize, int maxBatchSize)
 
static void updateConstraintBatchIdsForMerges (int *constraintBatchIds, int numConstraints, const btBatchInfo *batches, int numBatches)
 
static void updateConstraintBatchIdsForMergesMt (int *constraintBatchIds, int numConstraints, const btBatchInfo *batches, int numBatches)
 
bool BatchCompare (const btBatchedConstraints::Range &a, const btBatchedConstraints::Range &b)
 
static void writeOutConstraintIndicesForRangeOfBatches (btBatchedConstraints *bc, const int *constraintBatchIds, int numConstraints, int *constraintIdPerBatch, int batchBegin, int batchEnd)
 
static void writeOutConstraintIndicesMt (btBatchedConstraints *bc, const int *constraintBatchIds, int numConstraints, int *constraintIdPerBatch, int maxNumBatchesPerPhase, int numPhases)
 
static void writeGrainSizes (btBatchedConstraints *bc)
 
static void writeOutBatches (btBatchedConstraints *bc, const int *constraintBatchIds, int numConstraints, const btBatchInfo *batches, int *batchWork, int maxNumBatchesPerPhase, int numPhases)
 
static btVector3 findMaxDynamicConstraintExtent (btVector3 *bodyPositions, bool *bodyDynamicFlags, btBatchedConstraintInfo *conInfos, int numConstraints, int numBodies)
 
static void assignConstraintsToGridBatches (const AssignConstraintsToGridBatchesParams &params, int iConBegin, int iConEnd)
 
static void setupSpatialGridBatchesMt (btBatchedConstraints *batchedConstraints, btAlignedObjectArray< char > *scratchMemory, btConstraintArray *constraints, const btAlignedObjectArray< btSolverBody > &bodies, int minBatchSize, int maxBatchSize, bool use2DGrid)
 
static void setupSingleBatch (btBatchedConstraints *bc, int numConstraints)
 

Variables

const int kNoMerge = -1
 

Function Documentation

◆ assignConstraintsToGridBatches()

static void assignConstraintsToGridBatches ( const AssignConstraintsToGridBatchesParams & params,
int iConBegin,
int iConEnd )
static

Definition at line 705 of file btBatchedConstraints.cpp.

◆ BatchCompare()

bool BatchCompare ( const btBatchedConstraints::Range & a,
const btBatchedConstraints::Range & b )
inline

Definition at line 432 of file btBatchedConstraints.cpp.

◆ debugDrawAllBatches()

static void debugDrawAllBatches ( const btBatchedConstraints * bc,
btConstraintArray * constraints,
const btAlignedObjectArray< btSolverBody > & bodies )
static

Definition at line 145 of file btBatchedConstraints.cpp.

◆ debugDrawPhase()

static void debugDrawPhase ( const btBatchedConstraints * bc,
btConstraintArray * constraints,
const btAlignedObjectArray< btSolverBody > & bodies,
int iPhase,
const btVector3 & color0,
const btVector3 & color1,
const btVector3 & offset )
static

Definition at line 124 of file btBatchedConstraints.cpp.

◆ debugDrawSingleBatch()

static void debugDrawSingleBatch ( const btBatchedConstraints * bc,
btConstraintArray * constraints,
const btAlignedObjectArray< btSolverBody > & bodies,
int iBatch,
const btVector3 & color,
const btVector3 & offset )
static

Definition at line 101 of file btBatchedConstraints.cpp.

◆ expandConstraintRows()

static void expandConstraintRows ( int * destConstraintBatchIds,
const int * srcConstraintBatchIds,
const btBatchedConstraintInfo * conInfos,
int numConstraints,
int numConstraintRows )
static

Definition at line 286 of file btBatchedConstraints.cpp.

◆ expandConstraintRowsInPlace()

static void expandConstraintRowsInPlace ( int * constraintBatchIds,
const btBatchedConstraintInfo * conInfos,
int numConstraints,
int numConstraintRows )
static

Definition at line 265 of file btBatchedConstraints.cpp.

◆ expandConstraintRowsMt()

static void expandConstraintRowsMt ( int * destConstraintBatchIds,
const int * srcConstraintBatchIds,
const btBatchedConstraintInfo * conInfos,
int numConstraints,
int numConstraintRows )
static

Definition at line 323 of file btBatchedConstraints.cpp.

◆ findMaxDynamicConstraintExtent()

static btVector3 findMaxDynamicConstraintExtent ( btVector3 * bodyPositions,
bool * bodyDynamicFlags,
btBatchedConstraintInfo * conInfos,
int numConstraints,
int numBodies )
static

Definition at line 653 of file btBatchedConstraints.cpp.

◆ initBatchedBodyDynamicFlags()

static void initBatchedBodyDynamicFlags ( btAlignedObjectArray< bool > * outBodyDynamicFlags,
const btAlignedObjectArray< btSolverBody > & bodies )
static

Definition at line 175 of file btBatchedConstraints.cpp.

◆ initBatchedConstraintInfo()

static int initBatchedConstraintInfo ( btBatchedConstraintInfo * outConInfos,
btConstraintArray * constraints )
static

Definition at line 234 of file btBatchedConstraints.cpp.

◆ initBatchedConstraintInfoArray()

static void initBatchedConstraintInfoArray ( btAlignedObjectArray< btBatchedConstraintInfo > * outConInfos,
btConstraintArray * constraints )
static

Definition at line 331 of file btBatchedConstraints.cpp.

◆ mergeSmallBatches()

static void mergeSmallBatches ( btBatchInfo * batches,
int iBeginBatch,
int iEndBatch,
int minBatchSize,
int maxBatchSize )
static

Definition at line 342 of file btBatchedConstraints.cpp.

◆ runLengthEncodeConstraintInfo()

static int runLengthEncodeConstraintInfo ( btBatchedConstraintInfo * outConInfos,
int numConstraints )
static

Definition at line 187 of file btBatchedConstraints.cpp.

◆ setupSingleBatch()

static void setupSingleBatch ( btBatchedConstraints * bc,
int numConstraints )
static

Definition at line 1036 of file btBatchedConstraints.cpp.

◆ setupSpatialGridBatchesMt()

static void setupSpatialGridBatchesMt ( btBatchedConstraints * batchedConstraints,
btAlignedObjectArray< char > * scratchMemory,
btConstraintArray * constraints,
const btAlignedObjectArray< btSolverBody > & bodies,
int minBatchSize,
int maxBatchSize,
bool use2DGrid )
static

Definition at line 816 of file btBatchedConstraints.cpp.

◆ updateConstraintBatchIdsForMerges()

static void updateConstraintBatchIdsForMerges ( int * constraintBatchIds,
int numConstraints,
const btBatchInfo * batches,
int numBatches )
static

Definition at line 388 of file btBatchedConstraints.cpp.

◆ updateConstraintBatchIdsForMergesMt()

static void updateConstraintBatchIdsForMergesMt ( int * constraintBatchIds,
int numConstraints,
const btBatchInfo * batches,
int numBatches )
static

Definition at line 424 of file btBatchedConstraints.cpp.

◆ writeGrainSizes()

static void writeGrainSizes ( btBatchedConstraints * bc)
static

Definition at line 515 of file btBatchedConstraints.cpp.

◆ writeOutBatches()

static void writeOutBatches ( btBatchedConstraints * bc,
const int * constraintBatchIds,
int numConstraints,
const btBatchInfo * batches,
int * batchWork,
int maxNumBatchesPerPhase,
int numPhases )
static

Definition at line 530 of file btBatchedConstraints.cpp.

◆ writeOutConstraintIndicesForRangeOfBatches()

static void writeOutConstraintIndicesForRangeOfBatches ( btBatchedConstraints * bc,
const int * constraintBatchIds,
int numConstraints,
int * constraintIdPerBatch,
int batchBegin,
int batchEnd )
static

Definition at line 439 of file btBatchedConstraints.cpp.

◆ writeOutConstraintIndicesMt()

static void writeOutConstraintIndicesMt ( btBatchedConstraints * bc,
const int * constraintBatchIds,
int numConstraints,
int * constraintIdPerBatch,
int maxNumBatchesPerPhase,
int numPhases )
static

Definition at line 489 of file btBatchedConstraints.cpp.

Variable Documentation

◆ kNoMerge

const int kNoMerge = -1

Definition at line 27 of file btBatchedConstraints.cpp.