mmf
Class MMF_TrapShapeOldAngles

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by mmf:MMF_TrapShapeZold
              extended by mmf:MMF_TrapShapeOldAngles

class 
MMF_TrapShapeZold:MMF_TrapShapeOldAngles

Trap various old angle values.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_TrapShapeOldAngles(MMF_TrapShapeZold) {
 ; Trap various old angle values.<br>
 public:
   import "common.ulb"
 
   func MMF_TrapShapeOldAngles(Generic pparent)
     MMF_TrapShapeZold.MMF_TrapShapeZold(pparent)
   endfunc
   
   float func Iterate(complex pz)
 ;    m_Iterations = m_Iterations + 1 not used in this trapshape<br>
     m_LastZ = pz
     float r = recip(0.0)
     if (@mode=="Raw Old Angles" || @mode=="Absolute Old Angles" \
        || @mode=="All Old Angles" || @mode=="Old Cosines" \
        || @mode=="All Old Angles 2") && m_zoldok
       if @mode=="Raw Old Angles"
         r = atan2(pz + @offset - m_zold)
       elseif @mode=="Absolute Old Angles"
         r = abs(atan2(pz + @offset - m_zold))
       elseif @mode=="All Old Angles"
         r = #pi + atan2(pz + @offset - m_zold)
       elseif @mode=="Old Cosines"
         r = cos(0.5*atan2(pz + @offset - m_zold))
       elseif @mode=="All Old Angles 2"
         r = atan2(pz + @offset - m_zold)
         if r<0.0
           r = r + 2.0*#pi
         endif
       endif
     elseif (@mode=="Raw Older Angles" || @mode=="Absolute Older Angles" \
        || @mode=="All Older Angles" || @mode=="Older Cosines" \
        || @mode=="All Older Angles 2") && m_zolderok
       if @mode=="Raw Older Angles"
         r = atan2(pz + @offset - m_zolder)
       elseif @mode=="Absolute Older Angles"
         r = abs(atan2(pz + @offset - m_zolder))
       elseif @mode=="All Older Angles"
         r = #pi + atan2(pz + @offset - m_zolder)
       elseif @mode=="Older Cosines"
         r = cos(0.5*atan2(pz + @offset - m_zolder))
       elseif @mode=="All Older Angles 2"
         r = atan2(pz + @offset - m_zolder)
         if r<0.0
           r = r + 2.0*#pi
         endif
       endif
     endif
     m_zolder = m_zold
     m_zold = pz
     m_zolderok = m_zoldok
     m_zoldok = true
     return r
   endfunc
 
 default:
   title = "Angles (of z-zold or z-zolder)"
   heading
     text = "Intended for use with 'MMF Smooth Orbit Traps (Gradient)' or \
             similar smoothing formulas since smoothing is usually required."
   endheading
   int param mode
     caption = "Method"
     enum = "Raw Old Angles" "Absolute Old Angles" "All Old Angles" \
            "Old Cosines" "All Old Angles 2" "Raw Older Angles" \
            "Absolute Older Angles" "All Older Angles" "Older Cosines" \
            "All Older Angles 2"
     default = 3
     hint = "Inspired by Cilia mode colouring."
   endparam
   complex param offset
     caption = "Z Offset"
     default = (0,0)
     hint = "Offsets z by this amount, useful for animation."
   endparam
 }
 


Constructor Summary
MMF_TrapShapeOldAngles()
           
MMF_TrapShapeOldAngles(Generic pparent)
           
 
Method Summary
 float Iterate(complex pz)
          call this for each iteration being trapped
 
Methods inherited from class mmf:MMF_TrapShapeZold
Init, IterateSilent, IterateSilentZold
 
Methods inherited from class common:TrapShape
GetColorChannel, GetTextureValue, GetTransformedPoint, SetThreshold
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_TrapShapeOldAngles

public MMF_TrapShapeOldAngles(Generic pparent)

MMF_TrapShapeOldAngles

public MMF_TrapShapeOldAngles()
Method Detail

Iterate

public float Iterate(complex pz)
Description copied from class: MMF_TrapShapeZold
call this for each iteration being trapped

It's up to the derived function to copy zold to zolder and pz to zold after using the values of zolder, zold and pz (without modifying them obviously).

And to (finally) copy zoldok to zolderok and set zoldok to true.

Note that if there's no result (due to no zold or zolder) then the function could return +infinity as the value to ensure the value is outside any threshold.

Overrides:
Iterate in class MMF_TrapShapeZold
Parameters:
pz - the z value
Returns:
trap distance