Page 1 of 1
btConvexPointCloudShape not scaling
Posted: Sat Jan 12, 2019 11:08 pm
by mgs_oleg
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)
Re: btConvexPointCloudShape not scaling
Posted: Sun Jan 13, 2019 12:49 pm
by mgs_oleg
can someone help me here how to properly use this collision shape ?
Re: btConvexPointCloudShape not scaling
Posted: Tue Jan 15, 2019 9:04 am
by niad
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);
Re: btConvexPointCloudShape not scaling
Posted: Tue Jan 15, 2019 9:19 am
by mgs_oleg
thanks niad. let me try. I will get back in short with results