repositories
/
SugarCubes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Helix][perf] Reduce number of point calculations.
[SugarCubes.git]
/
ShaheenGandhi.pde
diff --git
a/ShaheenGandhi.pde
b/ShaheenGandhi.pde
index dcdb90800a84c754aa4bbb9a2f20a327d6ab0b24..d562e3bd3fed0b12357611d46d4bb8072c76ebd6 100644
(file)
--- a/
ShaheenGandhi.pde
+++ b/
ShaheenGandhi.pde
@@
-117,11
+117,12
@@
class HelixPattern extends SCPattern {
}
color colorOfPoint(final PVector p) {
}
color colorOfPoint(final PVector p) {
- float t = axis.getTValue(p);
+ final float t = axis.getTValue(p);
+ final PVector axisPoint = axis.getPointAt(t);
// For performance reasons, cut out points that are outside of
// the tube where the toroidal coil lives.
// For performance reasons, cut out points that are outside of
// the tube where the toroidal coil lives.
- if (abs(PVector.dist(p, axis
.getPointAt(t)
) - radius) > girth*.5f) {
+ if (abs(PVector.dist(p, axis
Point
) - radius) > girth*.5f) {
return color(0,0,0);
}
return color(0,0,0);
}