|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic common:TrapMode common:TrapModeWithThreshold mmf:MMF_TrapModeSmoothWithThreshold mmf:MMF_TrapModeSmoothSecondFarthest
class
Returns the difference in the values from the farthest trapped
iteration within the threshold and the second farthest.
class MMF_TrapModeSmoothSecondFarthest(MMF_TrapModeSmoothWithThreshold) { ; Returns the difference in the values from the farthest trapped ; iteration within the threshold and the second farthest.<br> public: import "common.ulb" func MMF_TrapModeSmoothSecondFarthest(Generic pparent) MMF_TrapModeSmoothWithThreshold.MMF_TrapModeSmoothWithThreshold(pparent) endfunc func Init(complex pz) MMF_TrapModeSmoothWithThreshold.Init(pz) m_Solid = true endfunc func Iterate(complex pz, complex pzt, float pdistance, float ptexture) if m_wastrapped m_OldDistances[0] = m_Distances[0] m_OldTextures[0] = m_Textures[0] m_OldUntransformedPoints[0] = m_UntransformedPoints[0] m_OldTransformedPoints[0] = m_TransformedPoints[0] m_OldIterationPoints[0] = m_IterationPoints[0] m_OldDistances[1] = m_Distances[1] m_OldTextures[1] = m_Textures[1] m_OldUntransformedPoints[1] = m_UntransformedPoints[1] m_OldTransformedPoints[1] = m_TransformedPoints[1] m_OldIterationPoints[1] = m_IterationPoints[1] endif m_Iterations = m_Iterations + 1 if pdistance >= m_Distances[0] && pdistance < m_Threshold m_Distances[1] = m_Distances[0] m_Textures[1] = m_Textures[0] m_UntransformedPoints[1] = m_UntransformedPoints[0] m_TransformedPoints[1] = m_TransformedPoints[0] m_IterationPoints[1] = m_IterationPoints[0] m_Distances[0] = pdistance m_Textures[0] = ptexture m_UntransformedPoints[0] = pz m_TransformedPoints[0] = pzt m_IterationPoints[0] = m_Iterations m_wastrapped = true m_Solid = false elseif pdistance>=m_Distances[1] && pdistance < m_Threshold m_Distances[1] = pdistance m_Textures[1] = ptexture m_UntransformedPoints[1] = pz m_TransformedPoints[1] = pzt m_IterationPoints[1] = m_Iterations m_wastrapped = true m_Solid = false endif endfunc func IterateSilent() if m_wastrapped m_OldDistances[0] = m_Distances[0] m_OldTextures[0] = m_Textures[0] m_OldUntransformedPoints[0] = m_UntransformedPoints[0] m_OldTransformedPoints[0] = m_TransformedPoints[0] m_OldIterationPoints[0] = m_IterationPoints[0] m_OldDistances[1] = m_Distances[1] m_OldTextures[1] = m_Textures[1] m_OldUntransformedPoints[1] = m_UntransformedPoints[1] m_OldTransformedPoints[1] = m_TransformedPoints[1] m_OldIterationPoints[1] = m_IterationPoints[1] m_wastrapped = false endif m_Iterations = m_Iterations + 1 endfunc func Result() m_Distances[0] = abs(m_Distances[0] - m_Distances[1]) m_Textures[0] = m_Textures[0] - m_Textures[1] m_UntransformedPoints[0] = m_UntransformedPoints[0] \ - m_UntransformedPoints[1] m_TransformedPoints[0] = m_TransformedPoints[0] \ - m_TransformedPoints[1] m_IterationPoints[0] = abs(m_IterationPoints[0] \ - m_IterationPoints[1]) endfunc func OldResult() if m_OldIterationPoints[1]>0 m_Distances[0] = abs(m_OldDistances[0] - m_OldDistances[1]) m_Textures[0] = m_OldTextures[0] - m_OldTextures[1] m_UntransformedPoints[0] = m_OldUntransformedPoints[0] \ - m_OldUntransformedPoints[1] m_TransformedPoints[0] = m_OldTransformedPoints[0] \ - m_OldTransformedPoints[1] m_IterationPoints[0] = abs(m_OldIterationPoints[0] \ - m_OldIterationPoints[1]) m_Iterations = m_Iterations - 1 endif endfunc default: title = "Smooth Second Farthest" rating = recommended }
Constructor Summary | |
---|---|
MMF_TrapModeSmoothSecondFarthest()
|
|
MMF_TrapModeSmoothSecondFarthest(Generic pparent)
|
Method Summary | |
---|---|
void |
Init(complex pz)
call this at the beginning of each sequence |
void |
Iterate(complex pz,
complex pzt,
float pdistance,
float ptexture)
call this for each point |
void |
IterateSilent()
call this for each point that is ignored (for smooth orbit traps) if the last point was trapped then copy the current values into the "old" ones |
void |
OldResult()
call this to compute penultimate results |
void |
Result()
call this to compute final results |
Methods inherited from class common:TrapModeWithThreshold |
---|
GetThreshold, SetThreshold, UsesThreshold |
Methods inherited from class common:TrapMode |
---|
GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, IsSolid |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public MMF_TrapModeSmoothSecondFarthest(Generic pparent)
public MMF_TrapModeSmoothSecondFarthest()
Method Detail |
---|
public void Init(complex pz)
MMF_TrapModeSmoothWithThreshold
Init
in class MMF_TrapModeSmoothWithThreshold
pz
- the initial z valuepublic void Iterate(complex pz, complex pzt, float pdistance, float ptexture)
MMF_TrapModeSmoothWithThreshold
Note that derived functions should always copy all used parameters to the "old" versions when they are changed as here.
m_wastrapped should be set to true in the derived
function when the main (current) values get changed
Iterate
in class MMF_TrapModeSmoothWithThreshold
pz
- the z valuepzt
- the transformed z valuepdistance
- the trap distanceptexture
- tyhe texture valuepublic void IterateSilent()
MMF_TrapModeSmoothWithThreshold
IterateSilent
in class MMF_TrapModeSmoothWithThreshold
public void Result()
TrapMode
Result
in class TrapMode
public void OldResult()
MMF_TrapModeSmoothWithThreshold
This should only be called after previously calling Result()
and getting the actual result value using the Trap Color Mode
since the original result values are destroyed by this call.
OldResult
in class MMF_TrapModeSmoothWithThreshold
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |