Browse Source

Need float value

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
f454fb5e1c
  1. 8
      src/engine/InterestManagement/HeightMap.java

8
src/engine/InterestManagement/HeightMap.java

@ -98,10 +98,10 @@ public class HeightMap {
// Calculate the data we do not load from table // Calculate the data we do not load from table
bucketCountX = this.heightmapImage.getWidth() - 1; bucketCountX = this.heightmapImage.getWidth() - 1;
this.bucketWidthX = this.fullExtentsX / bucketCountX; this.bucketWidthX = this.fullExtentsX / (float) bucketCountX;
bucketCountY = this.heightmapImage.getHeight() - 1; bucketCountY = this.heightmapImage.getHeight() - 1;
this.bucketWidthY = this.fullExtentsY / bucketCountY; this.bucketWidthY = this.fullExtentsY / (float) bucketCountY;
// Generate pixel array from image data // Generate pixel array from image data
@ -331,10 +331,10 @@ public class HeightMap {
float yBucket = zoneLoc.y / this.bucketWidthY; float yBucket = zoneLoc.y / this.bucketWidthY;
if (xBucket >= this.bucketCountX) if (xBucket >= this.bucketCountX)
xBucket = this.bucketCountX - 1; xBucket = xBucket - 1;
if (yBucket >= this.bucketCountY) if (yBucket >= this.bucketCountY)
yBucket = this.bucketCountY - 1; yBucket = xBucket - 1;
return new Vector2f(xBucket, yBucket); return new Vector2f(xBucket, yBucket);
} }

Loading…
Cancel
Save