Use float height data for HeightField in HeightField scenes in testbed

This commit is contained in:
Daniel Chappuis 2016-03-22 07:29:20 +01:00
parent 4d982ebd31
commit 744484e064
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ HeightField::HeightField(const openglframework::Vector3 &position, float mass,
// Create the collision shape for the rigid body (convex mesh shape) and // Create the collision shape for the rigid body (convex mesh shape) and
// do not forget to delete it at the end // do not forget to delete it at the end
mHeightFieldShape = new rp3d::HeightFieldShape(NB_POINTS_WIDTH, NB_POINTS_LENGTH, mMinHeight, mMaxHeight, mHeightFieldShape = new rp3d::HeightFieldShape(NB_POINTS_WIDTH, NB_POINTS_LENGTH, mMinHeight, mMaxHeight,
mHeightData, rp3d::HeightFieldShape::HEIGHT_INT_TYPE); mHeightData, rp3d::HeightFieldShape::HEIGHT_FLOAT_TYPE);
// Initial position and orientation of the rigid body // Initial position and orientation of the rigid body
rp3d::Vector3 initPosition(position.x, position.y, position.z); rp3d::Vector3 initPosition(position.x, position.y, position.z);

View File

@ -43,7 +43,7 @@ class HeightField : public openglframework::Mesh, public PhysicsObject {
// -------------------- Attributes -------------------- // // -------------------- Attributes -------------------- //
/// Height field data /// Height field data
int mHeightData[NB_POINTS_WIDTH * NB_POINTS_LENGTH]; float mHeightData[NB_POINTS_WIDTH * NB_POINTS_LENGTH];
/// Previous transform (for interpolation) /// Previous transform (for interpolation)
rp3d::Transform mPreviousTransform; rp3d::Transform mPreviousTransform;