Blender
V3.3
|
#include <btDbvt.h>
Classes | |
struct | IClone |
struct | ICollide |
struct | IWriter |
struct | sStkCLN |
struct | sStkNN |
struct | sStknNN |
struct | sStkNP |
struct | sStkNPS |
Public Types | |
enum | { SIMPLE_STACKSIZE = 64 , DOUBLE_STACKSIZE = SIMPLE_STACKSIZE * 2 } |
Public Attributes | |
btDbvtNode * | m_root |
btDbvtNode * | m_free |
int | m_lkhd |
int | m_leaves |
unsigned | m_opath |
btAlignedObjectArray< sStkNN > | m_stkStack |
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes (aabb tree). This btDbvt is used for soft body collision detection and for the btDbvtBroadphase. It has a fast insert, remove and update of nodes. Unlike the btQuantizedBvh, nodes can be dynamically moved around, which allows for change in topology of the underlying data structure.
btDbvt::btDbvt | ( | ) |
btDbvt::~btDbvt | ( | ) |
|
inlinestatic |
Definition at line 436 of file btDbvt.h.
References btAlignedObjectArray< T >::pop_back(), btAlignedObjectArray< T >::push_back(), and btAlignedObjectArray< T >::size().
Referenced by collideOCL().
void btDbvt::clear | ( | ) |
Definition at line 477 of file btDbvt.cpp.
References btAlignedFree, m_free, m_lkhd, m_opath, m_root, m_stkStack, and recursedeletenode().
Referenced by btSoftBody::initializeFaceTree(), btDeformableBodySolver::predictDeformableMotion(), btSoftBody::predictMotion(), btSoftBody::rebuildNodeTree(), btDbvtBroadphase::resetPool(), and ~btDbvt().
Definition at line 644 of file btDbvt.cpp.
References btDbvt::IClone::CloneLeaf(), createnode(), dest, e, m_leaves, m_root, btAlignedObjectArray< T >::pop_back(), btAlignedObjectArray< T >::push_back(), btAlignedObjectArray< T >::reserve(), and btAlignedObjectArray< T >::size().
|
inlinestatic |
Definition at line 1350 of file btDbvt.h.
References btAssert, btDbvtNode::childs, btDbvtAabbMm::Classify(), count, DBVT_CHECKTYPE, enumLeaves(), btDbvtNode::isinternal(), btDbvt::sStkNP::mask, btDbvt::sStkNP::node, normals, usdtokens::out(), btAlignedObjectArray< T >::pop_back(), btAlignedObjectArray< T >::push_back(), btAlignedObjectArray< T >::reserve(), SIMPLE_STACKSIZE, btAlignedObjectArray< T >::size(), and btDbvtNode::volume.
|
inlinestatic |
Definition at line 1410 of file btDbvt.h.
References allocate(), btAssert, btDbvtNode::childs, btDbvtAabbMm::Classify(), count, DBVT_CHECKTYPE, id, btDbvtNode::isinternal(), btDbvt::sStkNPS::mask, nearest(), btDbvt::sStkNPS::node, normals, usdtokens::out(), btAlignedObjectArray< T >::pop_back(), btDbvtAabbMm::ProjectMinimum(), btAlignedObjectArray< T >::push_back(), btAlignedObjectArray< T >::reserve(), SIMPLE_STACKSIZE, btAlignedObjectArray< T >::size(), btDbvt::sStkNPS::value, and btDbvtNode::volume.
|
inline |
Definition at line 822 of file btDbvt.h.
References btDbvt::sStkNN::a, btDbvt::sStkNN::b, btDbvtNode::childs, DBVT_CHECKTYPE, DOUBLE_STACKSIZE, Intersect(), btDbvtNode::isinternal(), btAlignedObjectArray< T >::resize(), btAlignedObjectArray< T >::size(), and btDbvtNode::volume.
Referenced by btSoftBody::defaultCollisionHandler(), btSoftBody::geometricCollisionHandler(), and btSoftColliders::CollideCL_SS::ProcessSoftSoft().
|
inline |
Definition at line 1015 of file btDbvt.h.
References btDbvt::sStkNN::a, btDbvt::sStkNN::b, btDbvtNode::childs, DBVT_CHECKTYPE, DOUBLE_STACKSIZE, Intersect(), btDbvtNode::isinternal(), m_stkStack, and btDbvtNode::volume.
Referenced by btDbvtBroadphase::collide(), btDbvtBroadphase::setAabb(), and btDbvtBroadphase::setAabbForceUpdate().
|
inlinestatic |
Definition at line 1531 of file btDbvt.h.
References btDbvtNode::childs, DBVT_CHECKTYPE, btDbvtNode::isinternal(), btAlignedObjectArray< T >::pop_back(), btAlignedObjectArray< T >::push_back(), btAlignedObjectArray< T >::reserve(), SIMPLE_STACKSIZE, and btAlignedObjectArray< T >::size().
|
inline |
Definition at line 1148 of file btDbvt.h.
References ATTRIBUTE_ALIGNED16, btDbvtNode::childs, DBVT_CHECKTYPE, btAlignedObjectArray< T >::initializeFromBuffer(), Intersect(), btDbvtNode::isinternal(), btAlignedObjectArray< T >::pop_back(), btAlignedObjectArray< T >::push_back(), btAlignedObjectArray< T >::reserve(), btAlignedObjectArray< T >::resize(), SIMPLE_STACKSIZE, btAlignedObjectArray< T >::size(), and btDbvtNode::volume.
Referenced by btDbvtBroadphase::aabbTest(), btDbvtBroadphase::collide(), btDbvtBroadphase::createProxy(), btSoftBody::defaultCollisionHandler(), and btSoftColliders::CollideCL_RS::ProcessColObj().
|
inline |
Definition at line 1189 of file btDbvt.h.
References ATTRIBUTE_ALIGNED16, btDbvtNode::childs, DBVT_CHECKTYPE, Intersect(), btDbvtNode::isinternal(), btAlignedObjectArray< T >::pop_back(), btAlignedObjectArray< T >::push_back(), btAlignedObjectArray< T >::reserve(), btAlignedObjectArray< T >::resize(), SIMPLE_STACKSIZE, btAlignedObjectArray< T >::size(), and btDbvtNode::volume.
|
static |
Definition at line 684 of file btDbvt.cpp.
References node.
|
inline |
Definition at line 314 of file btDbvt.h.
References m_root.
Referenced by btDeformableBodySolver::predictDeformableMotion(), btSoftBody::predictMotion(), btSoftBody::rayFaceTest(), and btSoftBody::rayTest().
|
inlinestatic |
Definition at line 805 of file btDbvt.h.
References btDbvtNode::childs, DBVT_CHECKTYPE, and btDbvtNode::isinternal().
Referenced by collideKDOP().
|
inlinestatic |
Definition at line 791 of file btDbvt.h.
References btDbvtNode::childs, DBVT_CHECKTYPE, and btDbvtNode::isinternal().
Referenced by write().
|
static |
Definition at line 693 of file btDbvt.cpp.
References node, and btAlignedObjectArray< T >::push_back().
btDbvtNode * btDbvt::insert | ( | const btDbvtVolume & | box, |
void * | data | ||
) |
Definition at line 535 of file btDbvt.cpp.
References createnode(), data, insertleaf(), m_leaves, and m_root.
Referenced by btSoftBody::appendNode(), btSoftBody::btSoftBody(), btDbvtBroadphase::collide(), createAabbTreeFromChildren(), btDbvtBroadphase::createProxy(), btDbvtBroadphase::setAabb(), btDbvtBroadphase::setAabbForceUpdate(), and btSoftBody::updateClusters().
|
static |
Definition at line 676 of file btDbvt.cpp.
References getmaxdepth(), and node.
|
inlinestatic |
Definition at line 423 of file btDbvt.h.
References Freestyle::a, l, and v.
Referenced by collideOCL().
void btDbvt::optimizeBottomUp | ( | ) |
Definition at line 489 of file btDbvt.cpp.
References bottomup(), fetchleaves(), m_leaves, m_root, btAlignedObjectArray< T >::reserve(), and btAlignedObjectArray< T >::size().
void btDbvt::optimizeIncremental | ( | int | passes | ) |
Definition at line 514 of file btDbvt.cpp.
References btDbvtNode::childs, m_leaves, m_opath, m_root, node, sort(), and update().
Referenced by btDbvtBroadphase::collide(), and btSoftBody::predictMotion().
void btDbvt::optimizeTopDown | ( | int | bu_treshold = 128 | ) |
Definition at line 502 of file btDbvt.cpp.
References fetchleaves(), m_leaves, m_root, btAlignedObjectArray< T >::reserve(), btAlignedObjectArray< T >::size(), and topdown().
Referenced by btDbvtBroadphase::optimize().
|
inlinestatic |
rayTest is a re-entrant ray test, and can be called in parallel as long as the btAlignedAlloc is thread-safe (uses locking etc) rayTest is slower than rayTestInternal, because it builds a local stack, using memory allocations, and it recomputes signs/rayDirectionInverses each time
what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
Definition at line 1276 of file btDbvt.h.
References bounds(), BT_LARGE_FLOAT, btAssert, btRayAabb(), btRayAabb2(), btVector3, DBVT_CHECKTYPE, DOUBLE_STACKSIZE, btAlignedObjectArray< T >::initializeFromBuffer(), node, btAlignedObjectArray< T >::resize(), and btAlignedObjectArray< T >::size().
Referenced by btSoftBody::rayFaceTest(), btSoftBody::rayTest(), and btCollisionWorld::rayTestSingleInternal().
|
inline |
rayTestInternal is faster than rayTest, because it uses a persistent stack (to reduce dynamic memory allocations to a minimum) and it uses precomputed signs/rayInverseDirections rayTestInternal is used by btDbvtBroadphase to accelerate world ray casts
Definition at line 1223 of file btDbvt.h.
References bounds(), btRayAabb2(), btVector3, DBVT_CHECKTYPE, DOUBLE_STACKSIZE, node, btAlignedObjectArray< T >::resize(), btAlignedObjectArray< T >::size(), and void.
Referenced by btDbvtBroadphase::rayTest().
void btDbvt::remove | ( | btDbvtNode * | leaf | ) |
Definition at line 611 of file btDbvt.cpp.
References deletenode(), m_leaves, and removeleaf().
Referenced by btDbvtBroadphase::collide(), btSoftBody::cutLink(), btDbvtBroadphase::destroyProxy(), btSoftBody::refine(), btSoftBody::releaseCluster(), removeChildShapeByIndex(), btDbvtBroadphase::setAabb(), and btDbvtBroadphase::setAabbForceUpdate().
|
inline |
Definition at line 887 of file btDbvt.h.
References btDbvt::sStknNN::a, btDbvntNode::angle, btDbvt::sStknNN::b, btDbvntNode::childs, DBVT_CHECKTYPE, DOUBLE_STACKSIZE, Intersect(), btDbvntNode::isinternal(), btAlignedObjectArray< T >::resize(), SIMD_PI, btAlignedObjectArray< T >::size(), and btDbvntNode::volume.
Referenced by btSoftBody::defaultCollisionHandler(), and btSoftBody::geometricCollisionHandler().
|
inline |
Definition at line 951 of file btDbvt.h.
References btDbvt::sStkNN::a, btDbvt::sStkNN::b, btDbvtNode::childs, DBVT_CHECKTYPE, DOUBLE_STACKSIZE, Intersect(), btDbvtNode::isinternal(), btAlignedObjectArray< T >::resize(), btAlignedObjectArray< T >::size(), and btDbvtNode::volume.
void btDbvt::update | ( | btDbvtNode * | leaf, |
btDbvtVolume & | volume | ||
) |
Definition at line 563 of file btDbvt.cpp.
References insertleaf(), m_lkhd, m_root, btDbvtNode::parent, removeleaf(), and btDbvtNode::volume.
bool btDbvt::update | ( | btDbvtNode * | leaf, |
btDbvtVolume & | volume, | ||
btScalar | margin | ||
) |
Definition at line 602 of file btDbvt.cpp.
References btVector3, btDbvtAabbMm::Contain(), btDbvtAabbMm::Expand(), update(), and btDbvtNode::volume.
bool btDbvt::update | ( | btDbvtNode * | leaf, |
btDbvtVolume & | volume, | ||
const btVector3 & | velocity | ||
) |
Definition at line 593 of file btDbvt.cpp.
References btDbvtAabbMm::Contain(), btDbvtAabbMm::SignedExpand(), update(), and btDbvtNode::volume.
bool btDbvt::update | ( | btDbvtNode * | leaf, |
btDbvtVolume & | volume, | ||
const btVector3 & | velocity, | ||
btScalar | margin | ||
) |
Definition at line 583 of file btDbvt.cpp.
References btVector3, btDbvtAabbMm::Contain(), btDbvtAabbMm::Expand(), btDbvtAabbMm::SignedExpand(), update(), and btDbvtNode::volume.
void btDbvt::update | ( | btDbvtNode * | leaf, |
int | lookahead = -1 |
||
) |
Definition at line 544 of file btDbvt.cpp.
References insertleaf(), m_root, btDbvtNode::parent, and removeleaf().
Referenced by optimizeIncremental(), btSoftBody::predictMotion(), btSoftBody::scale(), btDbvtBroadphase::setAabb(), btDbvtBroadphase::setAabbForceUpdate(), btSoftBody::transform(), update(), updateChildTransform(), and btSoftBody::updateClusters().
Definition at line 619 of file btDbvt.cpp.
References btDbvtNode::childs, enumNodes(), btAlignedObjectArray< T >::findLinearSearch(), btDbvtNode::isinternal(), m_leaves, m_root, btDbvtNodeEnumerator::nodes, btDbvtNode::parent, btDbvt::IWriter::Prepare(), btAlignedObjectArray< T >::reserve(), btAlignedObjectArray< T >::size(), btDbvt::IWriter::WriteLeaf(), and btDbvt::IWriter::WriteNode().
btDbvtNode* btDbvt::m_free |
Definition at line 303 of file btDbvt.h.
Referenced by btDbvt(), clear(), createnode(), and deletenode().
int btDbvt::m_leaves |
Definition at line 305 of file btDbvt.h.
Referenced by btDbvt(), btDbvtBroadphase::calculateOverlappingPairs(), clone(), btDbvtBroadphase::collide(), insert(), optimizeBottomUp(), optimizeIncremental(), optimizeTopDown(), remove(), btDbvtBroadphase::resetPool(), and write().
int btDbvt::m_lkhd |
unsigned btDbvt::m_opath |
Definition at line 306 of file btDbvt.h.
Referenced by btDbvt(), clear(), and optimizeIncremental().
btDbvtNode* btDbvt::m_root |
Definition at line 302 of file btDbvt.h.
Referenced by btDbvt(), clear(), clone(), btSoftBody::defaultCollisionHandler(), btSoftBodyHelpers::DrawClusterTree(), btSoftBodyHelpers::DrawFaceTree(), btSoftBodyHelpers::DrawNodeTree(), empty(), btSoftBody::geometricCollisionHandler(), btDbvtBroadphase::getBroadphaseAabb(), btSoftBody::initializeFaceTree(), insert(), insertleaf(), optimizeBottomUp(), optimizeIncremental(), optimizeTopDown(), btCompoundCompoundCollisionAlgorithm::processCollision(), btSoftColliders::CollideCL_RS::ProcessColObj(), btSoftColliders::CollideCL_SS::ProcessSoftSoft(), btSoftBody::rayFaceTest(), btSoftBody::rayTest(), btCollisionWorld::rayTestSingleInternal(), btSoftBody::rebuildNodeTree(), recursedeletenode(), removeleaf(), update(), btSoftBody::updateFaceTree(), btSoftBody::updateNodeTree(), and write().
btAlignedObjectArray<sStkNN> btDbvt::m_stkStack |
Definition at line 308 of file btDbvt.h.
Referenced by clear(), and collideTTpersistentStack().