Logo Search packages:      
Sourcecode: blender version File versions  Download package

btScalar btHeightfieldTerrainShape::getRawHeightFieldValue ( int  x,
int  y 
) const [protected, virtual]

This returns the "raw" (user's initial) height, not the actual height. The actual height needs to be adjusted to be relative to the center of the heightfield's AABB.

Definition at line 152 of file btHeightfieldTerrainShape.cpp.

References m_heightStickWidth.

Referenced by getVertex().

{
      btScalar val = 0.f;
      switch (m_heightDataType)
      {
      case PHY_FLOAT:
            {
                  val = m_heightfieldDataFloat[(y*m_heightStickWidth)+x];
                  break;
            }

      case PHY_UCHAR:
            {
                  unsigned char heightFieldValue = m_heightfieldDataUnsignedChar[(y*m_heightStickWidth)+x];
                  val = heightFieldValue * m_heightScale;
                  break;
            }

      case PHY_SHORT:
            {
                  short hfValue = m_heightfieldDataShort[(y * m_heightStickWidth) + x];
                  val = hfValue * m_heightScale;
                  break;
            }

      default:
            {
                  btAssert(!"Bad m_heightDataType");
            }
      }

      return val;
}


Generated by  Doxygen 1.6.0   Back to index