class Standard_TrapShapeWaves(common.ulb:TrapShape) {
public:
float func Iterate(complex pz)
float d
float d2
if @style == "Normal"
d = abs(abs(imag(pz) + sin(real(pz)*@trapfreq)*@traporder) - @diameter)
elseif @style == "Mirrored"
d = abs(abs(imag(pz)) - @diameter + sin(real(pz)*@trapfreq)*@traporder)
elseif @style == "Mirrored 2"
d2 = @diameter - sin(real(pz)*@trapfreq)*@traporder ; compute wave height
d = abs(abs(imag(pz)) - d2) ; distance to each wave
d2 = abs(abs(imag(pz)) + d2)
if d2 < d
d = d2
endif
elseif @style == "Radial"
d2 = atan2(pz)
d = abs(cabs(pz) * (1 - sin(d2*@trapfreq)*@traporder*0.5) - @diameter)
else ; "Radial 2"
d2 = atan2(pz)
d2 = sin(d2*@trapfreq)*@traporder*0.5
d = abs(cabs(pz) * (1 - d2) - @diameter)
d2 = abs(cabs(pz) * (1 + d2) - @diameter)
if d2 < d
d = d2
endif
endif
return d
endfunc
default:
title = "Waves"
int param style
caption = "Style"
enum = "Normal" "Mirrored" "Mirrored 2" "Radial" "Radial 2"
default = 0
hint = "Chooses between various types of waves."
endparam
float param diameter
caption = "Diameter"
default = 1
hint = "This is the distance between the waves."
endparam
float param traporder
caption = "Height"
default = 1
hint = "This is the height of the waves. In the old Orbit Traps coloring \
algorithm, this is the trap order divided by 4."
endparam
float param trapfreq
caption = "Frequency"
default = 1
hint = "This is the frequency of the waves."
endparam
}