btHeightFieldTerrainShape, init new member
instead height of example terrain
This commit is contained in:
@@ -491,7 +491,7 @@ getRawHeightfieldData
|
|||||||
for (int j = 0; j < width; ++j)
|
for (int j = 0; j < width; ++j)
|
||||||
{
|
{
|
||||||
float y = j * s_gridSpacing;
|
float y = j * s_gridSpacing;
|
||||||
float z = double(image[i*3+width*j*3])*(4./256.);
|
float z = double(image[i*3+width*j*3])*(40./256.);
|
||||||
convertFromFloat(p, z, type);
|
convertFromFloat(p, z, type);
|
||||||
p += bytesPerElement;
|
p += bytesPerElement;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ btHeightfieldTerrainShape::btHeightfieldTerrainShape(
|
|||||||
int heightStickWidth, int heightStickLength, const void* heightfieldData,
|
int heightStickWidth, int heightStickLength, const void* heightfieldData,
|
||||||
btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis,
|
btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis,
|
||||||
PHY_ScalarType hdt, bool flipQuadEdges)
|
PHY_ScalarType hdt, bool flipQuadEdges)
|
||||||
|
:m_userIndex2(-1)
|
||||||
{
|
{
|
||||||
initialize(heightStickWidth, heightStickLength, heightfieldData,
|
initialize(heightStickWidth, heightStickLength, heightfieldData,
|
||||||
heightScale, minHeight, maxHeight, upAxis, hdt,
|
heightScale, minHeight, maxHeight, upAxis, hdt,
|
||||||
@@ -28,6 +29,7 @@ btHeightfieldTerrainShape::btHeightfieldTerrainShape(
|
|||||||
}
|
}
|
||||||
|
|
||||||
btHeightfieldTerrainShape::btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength, const void* heightfieldData, btScalar maxHeight, int upAxis, bool useFloatData, bool flipQuadEdges)
|
btHeightfieldTerrainShape::btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength, const void* heightfieldData, btScalar maxHeight, int upAxis, bool useFloatData, bool flipQuadEdges)
|
||||||
|
:m_userIndex2(-1)
|
||||||
{
|
{
|
||||||
// legacy constructor: support only float or unsigned char,
|
// legacy constructor: support only float or unsigned char,
|
||||||
// and min height is zero
|
// and min height is zero
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ protected:
|
|||||||
int m_vboundsGridLength;
|
int m_vboundsGridLength;
|
||||||
int m_vboundsChunkSize;
|
int m_vboundsChunkSize;
|
||||||
|
|
||||||
|
int m_userIndex2;
|
||||||
|
|
||||||
virtual btScalar getRawHeightFieldValue(int x, int y) const;
|
virtual btScalar getRawHeightFieldValue(int x, int y) const;
|
||||||
void quantizeWithClamp(int* out, const btVector3& point, int isMax) const;
|
void quantizeWithClamp(int* out, const btVector3& point, int isMax) const;
|
||||||
|
|
||||||
@@ -186,7 +188,7 @@ public:
|
|||||||
//debugging
|
//debugging
|
||||||
virtual const char* getName() const { return "HEIGHTFIELD"; }
|
virtual const char* getName() const { return "HEIGHTFIELD"; }
|
||||||
|
|
||||||
int m_userIndex2;
|
|
||||||
void setUserIndex2(int index)
|
void setUserIndex2(int index)
|
||||||
{
|
{
|
||||||
m_userIndex2 = index;
|
m_userIndex2 = index;
|
||||||
|
|||||||
Reference in New Issue
Block a user