When I am using btConvexPointCloudShape and setting localScaling it is not afftected
How properly scale btConvexPointCloudShape object ?
my scale is
vec3(3.000000, 6.000000, 1.000000)
btConvexPointCloudShape not scaling
-
- Posts: 10
- Joined: Mon Jun 08, 2015 6:25 pm
Re: btConvexPointCloudShape not scaling
can someone help me here how to properly use this collision shape ?
-
- Posts: 7
- Joined: Sun Mar 11, 2018 9:34 am
Re: btConvexPointCloudShape not scaling
I don't use that class, but glancing at the code(localGetSupportingVertexWithoutMargin) I'd say the scaling is applied too late-- shouldn't matter if you are doing uniform scaling but with (3,6,1) I'd guess it would produce incorrect results.
Try changing this code in localGetSupportingVertexWithoutMargin:
int index = (int)vec.maxDot(&m_unscaledPoints[0], m_numPoints, maxDot); //FIXME: may violate encapsulation of m_unscaledPoints
return getScaledPoint(index);
To This:
vec = vec * m_localScaling;
int index = (int)vec.maxDot(&m_unscaledPoints[0], m_numPoints, maxDot); //FIXME: may violate encapsulation of m_unscaledPoints
return getScaledPoint(index);
Try changing this code in localGetSupportingVertexWithoutMargin:
int index = (int)vec.maxDot(&m_unscaledPoints[0], m_numPoints, maxDot); //FIXME: may violate encapsulation of m_unscaledPoints
return getScaledPoint(index);
To This:
vec = vec * m_localScaling;
int index = (int)vec.maxDot(&m_unscaledPoints[0], m_numPoints, maxDot); //FIXME: may violate encapsulation of m_unscaledPoints
return getScaledPoint(index);
-
- Posts: 10
- Joined: Mon Jun 08, 2015 6:25 pm
Re: btConvexPointCloudShape not scaling
thanks niad. let me try. I will get back in short with results