Skip to content

Commit 9459600

Browse files
committed
code formatting, comments
1 parent ef8d5c3 commit 9459600

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -976,13 +976,13 @@ public boolean intersectsSphere(float r, PVector origin, PVector direction) {
976976
objMatrix.mult(hit, hitInObjCoord);
977977
PVector.sub(hitInObjCoord, origInObjCoord, dirInObjCoord);
978978

979-
return lineIntersectsSphere(origInObjCoord, dirInObjCoord, r);
979+
return rayIntersectsSphere(origInObjCoord, dirInObjCoord, r);
980980
}
981981

982982

983-
// Line-sphere intersecton algorithm as described in:
983+
// Ray-sphere intersecton algorithm as described in:
984984
// http://paulbourke.net/geometry/circlesphere/
985-
private boolean lineIntersectsSphere(PVector orig, PVector dir, float r) {
985+
private boolean rayIntersectsSphere(PVector orig, PVector dir, float r) {
986986
float d = orig.mag();
987987

988988
// The eye is inside the sphere
@@ -996,7 +996,6 @@ private boolean lineIntersectsSphere(PVector orig, PVector dir, float r) {
996996
// Check intersection of ray with sphere
997997
float b = 2 * p;
998998
float c = d * d - r * r;
999-
1000999
float det = b * b - 4 * c;
10011000
return det >= 0;
10021001
}

0 commit comments

Comments
 (0)