reduce dynamic memory allocations in btDbvt::rayTestInternal,
fixes Issue 574, thanks to Anton Breusov
This commit is contained in:
@@ -259,6 +259,7 @@ struct btDbvt
|
|||||||
|
|
||||||
|
|
||||||
btAlignedObjectArray<sStkNN> m_stkStack;
|
btAlignedObjectArray<sStkNN> m_stkStack;
|
||||||
|
mutable btAlignedObjectArray<const btDbvtNode*> m_rayTestStack;
|
||||||
|
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
@@ -955,7 +956,7 @@ inline void btDbvt::rayTestInternal( const btDbvtNode* root,
|
|||||||
|
|
||||||
int depth=1;
|
int depth=1;
|
||||||
int treshold=DOUBLE_STACKSIZE-2;
|
int treshold=DOUBLE_STACKSIZE-2;
|
||||||
btAlignedObjectArray<const btDbvtNode*> stack;
|
btAlignedObjectArray<const btDbvtNode*>& stack = m_rayTestStack;
|
||||||
stack.resize(DOUBLE_STACKSIZE);
|
stack.resize(DOUBLE_STACKSIZE);
|
||||||
stack[0]=root;
|
stack[0]=root;
|
||||||
btVector3 bounds[2];
|
btVector3 bounds[2];
|
||||||
|
|||||||
Reference in New Issue
Block a user