reduce dynamic memory allocations in btDbvt::rayTestInternal,

fixes Issue 574, thanks to Anton Breusov
This commit is contained in:
erwin.coumans
2011-12-12 16:52:52 +00:00
parent 606d65d95b
commit e1c9b67ef7

View File

@@ -259,6 +259,7 @@ struct btDbvt
btAlignedObjectArray<sStkNN> m_stkStack;
mutable btAlignedObjectArray<const btDbvtNode*> m_rayTestStack;
// Methods
@@ -955,7 +956,7 @@ inline void btDbvt::rayTestInternal( const btDbvtNode* root,
int depth=1;
int treshold=DOUBLE_STACKSIZE-2;
btAlignedObjectArray<const btDbvtNode*> stack;
btAlignedObjectArray<const btDbvtNode*>& stack = m_rayTestStack;
stack.resize(DOUBLE_STACKSIZE);
stack[0]=root;
btVector3 bounds[2];