5 #include "cudaType_CPU.h"
12 Sphere(cpu::float3 centre
, float r
, float hue
) :
25 void setCentre(const cpu::float3
& centre
)
27 this->centre
= centre
;
38 void setHueInitial(float hue
)
40 this->hueInitial
= hue
;
44 float hCarre(cpu::float2 xySol
)
46 float a
= (centre
.x
- xySol
.x
);
47 float b
= (centre
.y
- xySol
.y
);
52 bool isEnDessous(float hCarre
)
54 return hCarre
< rCarre
;
58 float dz(float hCarre
)
60 return sqrtf(rCarre
- hCarre
);
64 float brightness(float dz
)
70 float distance(float dz
)
78 return this->hueInitial
;
82 float hue(float t
) // usefull for animation
84 return 0.5 + 0.5 * sin(t
+ T
+ 3 * PI
/ 2);
93 float T
; // Utilisé pour l'animation.