Skip to content

Commit

Permalink
Fix getSurfacePoints method in model implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Henrique committed Dec 18, 2016
1 parent c58229a commit 693c343
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tracer/model/Sphere.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Vector3 getCenter() {
public Vector3[] getSurfacePoints(int count) {
Vector3[] surfacePoints = new Vector3[count];
for (int i = 0; i < count; i++) {
surfacePoints[i] = this.surfacePoints[TTRand.range(0, count)];
surfacePoints[i] = this.surfacePoints[TTRand.range(0, this.surfacePoints.length - 1)];
}
return surfacePoints;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tracer/model/Triangle.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public Vector3 getCenter() {
public Vector3[] getSurfacePoints(int count) {
Vector3[] surfacePoints = new Vector3[count];
for (int i = 0; i < count; i++) {
surfacePoints[i] = surfacePoints[TTRand.range(0, count)];
surfacePoints[i] = this.surfacePoints[TTRand.range(0, this.surfacePoints.length - 1)];
}
return surfacePoints;
}
Expand Down

0 comments on commit 693c343

Please sign in to comment.