upAxis in btHeightfieldTerrainShape constructor

Werner291
Posts: 1
Joined: Thu Jun 14, 2012 12:20 pm

upAxis in btHeightfieldTerrainShape constructor

Post by Werner291 »

Hello,

the construcor of btHeightfieldTerrainShape has an argument "upAxis".

It simply asks for an int without really saying what it wants.

According to the cpp file (see below), 0 = X, 1 = Y, 2 = Z, anything else is invalid.
Could this be added to the documentation / header comments above the constructor?

// determine min/max axis-aligned bounding box (aabb) values
switch (m_upAxis)
{
case 0:
{
m_localAabbMin.setValue(m_minHeight, 0, 0);
m_localAabbMax.setValue(m_maxHeight, m_width, m_length);
break;
}
case 1:
{
m_localAabbMin.setValue(0, m_minHeight, 0);
m_localAabbMax.setValue(m_width, m_maxHeight, m_length);
break;
};
case 2:
{
m_localAabbMin.setValue(0, 0, m_minHeight);
m_localAabbMax.setValue(m_width, m_length, m_maxHeight);
break;
}
default:
{
//need to get valid m_upAxis
btAssert(0 && "Bad m_upAxis");
}
}