Commit d6b87637 authored by BrutPitt's avatar BrutPitt
Browse files

ver 1.6.0 WiP - reorganize attractorsBase (h/cpp) files : move trigonometric...

ver 1.6.0 WiP - reorganize attractorsBase (h/cpp) files : move trigonometric class attractors, in separate files
parent 1a9d8aac
//------------------------------------------------------------------------------
// Copyright (c) 2018-2020 Michele Morrone
// All rights reserved.
//
// https://michelemorrone.eu - https://BrutPitt.com
//
// twitter: https://twitter.com/BrutPitt - github: https://github.com/BrutPitt
//
// mailto:brutpitt@gmail.com - mailto:me@michelemorrone.eu
//
// This software is distributed under the terms of the BSD 2-Clause license
//------------------------------------------------------------------------------
#include "glWindow.h"
////////////////////////////////////////////////////////////////////////////
void KingsDream::Step(vec4 &v, vec4 &vp)
{
vp.x = sin(v.z * kVal[0]) + kVal[3] * sin(v.x * kVal[0]);
vp.y = sin(v.x * kVal[1]) + kVal[4] * sin(v.y * kVal[1]);
vp.z = sin(v.y * kVal[2]) + kVal[5] * sin(v.z * kVal[2]);
}
////////////////////////////////////////////////////////////////////////////
void Pickover::Step(vec4 &v, vec4 &vp)
{
vp.x = sin(kVal[0]*v.y) - v.z*cos(kVal[1]*v.x);
vp.y = v.z*sin(kVal[2]*v.x) - cos(kVal[3]*v.y);
vp.z = sin(v.x) ;
}
////////////////////////////////////////////////////////////////////////////
void SinCos::Step(vec4 &v, vec4 &vp)
{
vp.x = cos(kVal[0]*v.x) + sin(kVal[1]*v.y) - sin(kVal[2]*v.z);
vp.y = sin(kVal[3]*v.x) - cos(kVal[4]*v.y) + sin(kVal[5]*v.z);
vp.z = -cos(kVal[6]*v.x) + cos(kVal[7]*v.y) + cos(kVal[8]*v.z);
}
//------------------------------------------------------------------------------
// Copyright (c) 2018-2020 Michele Morrone
// All rights reserved.
//
// https://michelemorrone.eu - https://BrutPitt.com
//
// twitter: https://twitter.com/BrutPitt - github: https://github.com/BrutPitt
//
// mailto:brutpitt@gmail.com - mailto:me@michelemorrone.eu
//
// This software is distributed under the terms of the BSD 2-Clause license
//------------------------------------------------------------------------------
#pragma once
////////////////////////////////////////////////////////////////////////////
class KingsDream : public attractorScalarK
{
public:
KingsDream() {
stepFn = (stepPtrFn) &KingsDream::Step;
vMin = -0.5; vMax = 0.5; kMin = -2.0; kMax = 2.0;
m_POV = vec3( 0.f, 0, 10.f);
}
protected:
void Step(vec4 &v, vec4 &vp);
void startData();
void searchAttractor() { searchLyapunov(); }
};
////////////////////////////////////////////////////////////////////////////
class Pickover : public attractorScalarK
{
public:
Pickover() {
stepFn = (stepPtrFn) &Pickover::Step;
vMin = -1.0; vMax = 1.0; kMin = -3.0; kMax = 3.0;
m_POV = vec3( 0.f, 0, 7.f);
}
protected:
void Step(vec4 &v, vec4 &vp);
void startData();
void searchAttractor() { searchLyapunov(); }
};
// SinCos base class
////////////////////////////////////////////////////////////////////////////
class SinCos : public attractorScalarK
{
public:
SinCos() {
stepFn = (stepPtrFn) &SinCos::Step;
kMin = -T_PI;
kMax = T_PI;
vMin = -1.0; vMax = 1.0;
m_POV = vec3( 0.f, 0, 12.f);
}
protected:
void Step(vec4 &v, vec4 &vp);
void startData();
void searchAttractor() { searchLyapunov(); }
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment