bulletphysics/bullet3

Bug in btGImpactQuantizedBvh::refit function with scaling the mesh

kochol opened this issue · 0 comments

I have a program that uses btGImpactMeshShape to create a mesh shape and when I scale it the collision detection won't work anymore.

But when I remove the below if and call the m_box_set.buildSet() function everything works as expected.

if (m_box_set.getNodeCount() == 0)
{
m_box_set.buildSet();
}

I think the bug is in the below function.

SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB& bound) const
{
bound.m_min = bt_unquantize(
m_node_array[nodeindex].m_quantizedAabbMin,
m_global_bound.m_min, m_bvhQuantization);
bound.m_max = bt_unquantize(
m_node_array[nodeindex].m_quantizedAabbMax,
m_global_bound.m_min, m_bvhQuantization);
}