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

btHeightfieldTerrainShape::btHeightfieldTerrainShape ( int  heightStickWidth,
int  heightStickLength,
void *  heightfieldData,
btScalar  maxHeight,
int  upAxis,
bool  useFloatData,
bool  flipQuadEdges 
)

legacy constructor

The legacy constructor assumes the heightfield has a minimum height of zero. Only unsigned char or floats are supported. For legacy compatibility reasons, heightScale is calculated as maxHeight / 65535 (and is only used when useFloatData = false).

Definition at line 36 of file btHeightfieldTerrainShape.cpp.

References initialize().

{
      // legacy constructor: support only float or unsigned char,
      //    and min height is zero
      PHY_ScalarType hdt = (useFloatData) ? PHY_FLOAT : PHY_UCHAR;
      btScalar minHeight = 0.0;

      // previously, height = uchar * maxHeight / 65535.
      // So to preserve legacy behavior, heightScale = maxHeight / 65535
      btScalar heightScale = maxHeight / 65535;

      initialize(heightStickWidth, heightStickLength, heightfieldData,
                 heightScale, minHeight, maxHeight, upAxis, hdt,
                 flipQuadEdges);
}


Generated by  Doxygen 1.6.0   Back to index