bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.

Home Page:http://bulletphysics.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in btGImpactQuantizedBvh::refit function with scaling the mesh

kochol opened this issue · 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);
}