aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp/gra/WatchBall.h
diff options
context:
space:
mode:
Diffstat (limited to 'meowpp/gra/WatchBall.h')
-rw-r--r--meowpp/gra/WatchBall.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/meowpp/gra/WatchBall.h b/meowpp/gra/WatchBall.h
index c72e2a5..f3d2044 100644
--- a/meowpp/gra/WatchBall.h
+++ b/meowpp/gra/WatchBall.h
@@ -43,14 +43,13 @@ public:
/*!
* @brief constructor
*/
- WatchBall(): self(true) {
+ WatchBall(): self() {
}
/*!
* @brief copy constructor
*/
- WatchBall(WatchBall const& b): self(false) {
- copyFrom(b);
+ WatchBall(WatchBall const& b): self(b.self, Self<Myself>::COPY_FROM) {
}
/*!
@@ -176,12 +175,12 @@ public:
Bitmap<Pixel> ret(height, width, Pixel(0));
for (size_t i = 0; i < height; ++i) {
for (size_t j = 0; j < width; ++j) {
- double theta = (1.0 * j / width - 0.5) * 2 * PI;
+ double theta = (1.0 * j / width - 0.5) * 2 * PI;
double phi = asin(-(1.0 * i / height - 0.5) * 2.0);
ret.pixel(i, j, color(Vector3D<double>(
- sin(-theta) * cos(phi),
+ sin(theta) * cos(phi),
sin(phi),
- cos(-theta) * cos(phi)
+ -cos(theta) * cos(phi)
)));
}
}