diff --git a/CMakeLists.txt b/CMakeLists.txt index 0969410..1e295c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ set(SOURCES src/utilities/utilities.cpp src/utilities/vector2D.cpp src/utilities/3Dtransform.cpp + src/utilities/trajectory.cpp src/effects/plasma.cpp src/effects/morph.cpp @@ -28,15 +29,18 @@ set(SOURCES src/effects/morphfire.cpp src/effects/linemorph.cpp src/effects/rotozoom.cpp + src/effects/spline.cpp + src/effects/splineblur.cpp ) set(ASSETS_cg assets-cg/fontmatrix.png assets-cg/fontlabel.png + assets-cg/bglens.png assets-cg/tile.png - assets-cg/OptionBox.png + assets-cg/optionbox.png ) fxconv_declare_assets(${ASSETS_cg} WITH_METADATA) diff --git a/TODO.txt b/TODO.txt index 6544fa5..983f7b6 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,6 +4,8 @@ To Add a Spline Morphing Effect with Fire To Add a High Velocity Blur Effect +[WIP] To Add a RainDrops Effect + [Done = OK] Check if the G90+E is powerful enough for Rotozoom Check if the G90+E is powerful enough for Tunnel Effect diff --git a/assets-cg/OptionBox.png b/assets-cg/OptionBox.png deleted file mode 100644 index 1509131..0000000 Binary files a/assets-cg/OptionBox.png and /dev/null differ diff --git a/assets-cg/backup (not used)/fxconv-metadata.txt b/assets-cg/backup (not used)/fxconv-metadata.txt new file mode 100644 index 0000000..a5e9b44 --- /dev/null +++ b/assets-cg/backup (not used)/fxconv-metadata.txt @@ -0,0 +1,34 @@ +fontmatrix.png: + name: font_matrix + type: font + charset: print + grid.size: 9x14 + +fontlabel.png: + type: font + name: font_label + charset: print + grid.size: 10x13 + grid.padding: 0 + grid.border: 0 + proportional: true + +bglens.png: + type: bopti-image + profile: p8 + name: bglens + +tile.png: + type: bopti-image + profile: p8 + name: tilerotozoom + +mosaics.png: + type: bopti-image + profile: p8 + name: mosaics + +optionbox.png: + type: bopti-image + profile: p8_rgb565a + name: optionbox \ No newline at end of file diff --git a/assets-cg/backup (not used)/mosaics.png b/assets-cg/backup (not used)/mosaics.png new file mode 100644 index 0000000..eff4a48 Binary files /dev/null and b/assets-cg/backup (not used)/mosaics.png differ diff --git a/assets-cg/fxconv-metadata.txt b/assets-cg/fxconv-metadata.txt index 5fc737f..1e76562 100644 --- a/assets-cg/fxconv-metadata.txt +++ b/assets-cg/fxconv-metadata.txt @@ -23,7 +23,7 @@ tile.png: profile: p8 name: tilerotozoom -OptionBox.png: +optionbox.png: type: bopti-image profile: p8_rgb565a name: optionbox \ No newline at end of file diff --git a/assets-cg/optionbox.png b/assets-cg/optionbox.png new file mode 100644 index 0000000..d930d29 Binary files /dev/null and b/assets-cg/optionbox.png differ diff --git a/clean b/clean index 0c58279..f6579df 100755 --- a/clean +++ b/clean @@ -1,2 +1,4 @@ rm -r build-cg/ +rm -r build-cg-push/ +rm -r build-fx/ rm *.g3a diff --git a/src/config.h b/src/config.h index 44fa005..6730f6c 100644 --- a/src/config.h +++ b/src/config.h @@ -4,7 +4,7 @@ #define MAXHEIGHT 224 - #define MORE_RAM 0 + #define MORE_RAM 1 diff --git a/src/effects/backup (not used)/effects.h b/src/effects/backup (not used)/effects.h new file mode 100644 index 0000000..eb8e474 --- /dev/null +++ b/src/effects/backup (not used)/effects.h @@ -0,0 +1,91 @@ +#ifndef EFFECTS_H +#define EFFECTS_H + +#include "../config.h" + +#include +#include + + +/* EFFECT #1 : PLASMA EFFECT */ + +char *plasma_text( void ); +void plasma_init( bopti_image_t *screen ); +void plasma_update( bopti_image_t *screen, float dt ); +void plasma_render( bopti_image_t *screen ); +void plasma_deinit( bopti_image_t *screen ); + + +/* EFFECT #2 : MORPHING EFFECT : FROM SPHERE TO TORUS */ + +char *morph_text( void ); +void morph_init( bopti_image_t *screen ); +void morph_update( bopti_image_t *screen, float dt ); +void morph_render( bopti_image_t *screen ); +void morph_deinit( bopti_image_t *screen ); + + +/* EFFECT #3 : MATRIX EFFECT */ + +char *matrix_text( void ); +void matrix_init( bopti_image_t *screen ); +void matrix_update( bopti_image_t *screen, float dt ); +void matrix_render( bopti_image_t *screen ); +void matrix_deinit( bopti_image_t *screen ); + + +/* EFFECT #4 : LENS EFFECT */ + +char *lens_text( void ); +void lens_init( bopti_image_t *screen ); +void lens_update( bopti_image_t *screen, float dt ); +void lens_render( bopti_image_t *screen ); +void lens_deinit( bopti_image_t *screen ); + + +/* EFFECT #5 : CUBEFIRE EFFECT */ + +char *firecube_text( void ); +void firecube_init( bopti_image_t *screen ); +void firecube_update( bopti_image_t *screen, float dt ); +void firecube_render( bopti_image_t *screen ); +void firecube_deinit( bopti_image_t *screen ); +void Blur( bopti_image_t *screen ); +void drawline(bopti_image_t *screen, int x1, int y1, int x2, int y2, uint8_t color); + +/* EFFECT #6 : MORPHING EFFECT WITH FIRE : FROM SPHERE TO TORUS */ + +char *morphfire_text( void ); +void morphfire_init( bopti_image_t *screen ); +void morphfire_update( bopti_image_t *screen, float dt ); +void morphfire_render( bopti_image_t *screen ); +void morphfire_deinit( bopti_image_t *screen ); + + +/* EFFECT #7 : MORPHING EFFECT : BOUNCING LINE ON SCREEN */ + +char *linemorph_text( void ); +void linemorph_init( bopti_image_t *screen ); +void linemorph_update( bopti_image_t *screen, float dt ); +void linemorph_render( bopti_image_t *screen ); +void linemorph_deinit( bopti_image_t *screen ); + + +/* EFFECT #8 : ROTOZOOM EFFECT */ + +char *rotozoom_text( void ); +void rotozoom_init( bopti_image_t *screen ); +void rotozoom_update( bopti_image_t *screen, float dt ); +void rotozoom_render( bopti_image_t *screen ); +void rotozoom_deinit( bopti_image_t *screen ); + + +/* EFFECT #9 : spline */ + +char *spline_text( void ); +void spline_init( bopti_image_t *screen ); +void spline_update( bopti_image_t *screen, float dt ); +void spline_render( bopti_image_t *screen ); +void spline_deinit( bopti_image_t *screen ); + +#endif diff --git a/src/effects/backup (not used)/raindrops.cpp b/src/effects/backup (not used)/raindrops.cpp new file mode 100644 index 0000000..c2e0870 --- /dev/null +++ b/src/effects/backup (not used)/raindrops.cpp @@ -0,0 +1,145 @@ +#include "effects.h" + +#include +#include "../utilities/fast_trig.h" + +#include +#include + +#include + + +extern bopti_image_t mosaics; + + +static const int MAX_ARRAY = DWIDTH * MAXHEIGHT; +static const short amplitudes[4] = { -250, -425, -350, -650}; + +static short *wavemap; +static short *old_wavemap; +static short *p_old; +static short *p_new; + +short *address_new, *address_old, *temp; +short height, xdiff; + +int8_t *pscreen, *pimage; + + + + +void raindrops_init( bopti_image_t *screen ) +{ + wavemap = (short *) kmalloc( DWIDTH * MAXHEIGHT * sizeof( short ), "extram" ); + old_wavemap = (short *) kmalloc( DWIDTH * MAXHEIGHT* sizeof( short ), "extram" ); + p_old = old_wavemap; + p_new = wavemap; + + image_copy_palette( &mosaics, screen, -1 ); + + for (int i = 0; i < MAX_ARRAY; ++i) + { + wavemap[i] = 0; + old_wavemap[i] = 0; + } +} + + +void start_drop() +{ + uint32_t v,w; + static const uint16_t b = DWIDTH - 10; + static const uint16_t c = DWIDTH * 10; + static const uint32_t d = (DWIDTH * MAXHEIGHT) - (DWIDTH * 10); + static uint8_t amp_index = 0; + + /* borders are invalid so keep trying till valid value*/ + do + { + v = rand() % MAX_ARRAY; + w = v % DWIDTH; + } + while (w < 10 || w > b || v < c || v > d); + + wavemap[v] = amplitudes[amp_index++]; + amp_index &= 4; +} + + +void raindrops_update( bopti_image_t *screen, [[Maybe_unused]] float dt ) +{ + uint16_t t; + + start_drop(); + + t = DWIDTH + 1; + address_new = p_new + t; + address_old = p_old + t; + + for (int i = 1; i < MAXHEIGHT - 1; ++i) + { + for (int j = 1; j < DWIDTH - 1; ++j) + { + height = 0; + height += *(address_new + DWIDTH); + height += *(address_new - 1); + height += *(address_new + 1); + height += *(address_new - DWIDTH); + height >>= 1; + height -= *address_old; + height -= height >> 5; + *address_old = height; + address_new++; + address_old++; + } + address_new += 2; /* next scanline starting at pos 1 */ + address_old += 2; + } + + t = screen->stride + 1; + address_old = p_old + t; + pscreen = (int8_t*)screen->data + t; + pimage = (int8_t*)mosaics.data + t; + + /* draw waves */ + for (int i = 1; i < MAXHEIGHT - 1; ++i) + { + for (int j = 1; j < DWIDTH - 1; ++j) + { + xdiff = *(address_old + 1) - *(address_old); + *pscreen = *(pimage + xdiff); + address_old++; + pscreen++; + pimage++; + } + address_old += 2; + pscreen += 2; /* next scanline starting at pos 1 */ + pimage += 2; + } + + /* swap wave tables */ + temp = p_new; + p_new = p_old; + p_old = temp; +} + + +void raindrops_render( bopti_image_t *screen ) +{ + dimage(0,0,screen); +} + + +void raindrops_deinit( bopti_image_t *screen ) +{ + free( wavemap ); + free( old_wavemap ); +} + + +char raindrops_TextToRender[100] = "Rain Drops on Mosaic Tiles > _\0"; + +char *raindrops_text( void ) +{ + return raindrops_TextToRender; +} \ No newline at end of file diff --git a/src/effects/effects.h b/src/effects/effects.h index 0da04cd..017d284 100644 --- a/src/effects/effects.h +++ b/src/effects/effects.h @@ -60,6 +60,7 @@ void morphfire_init( bopti_image_t *screen ); void morphfire_update( bopti_image_t *screen, float dt ); void morphfire_render( bopti_image_t *screen ); void morphfire_deinit( bopti_image_t *screen ); +void pixel( bopti_image_t *screen, uint16_t sx, uint16_t sy, int8_t color ); /* EFFECT #7 : MORPHING EFFECT : BOUNCING LINE ON SCREEN */ @@ -79,4 +80,24 @@ void rotozoom_update( bopti_image_t *screen, float dt ); void rotozoom_render( bopti_image_t *screen ); void rotozoom_deinit( bopti_image_t *screen ); + +/* EFFECT #9 : BLURED SPLINE EFFECT */ + +char *splineblur_text( void ); +void splineblur_init( bopti_image_t *screen ); +void splineblur_update( bopti_image_t *screen, float dt ); +void splineblur_render( bopti_image_t *screen ); +void splineblur_deinit( bopti_image_t *screen ); +void Blur2( bopti_image_t *screen ); + + +/* EFFECT #10 : MOVING SPLINE EFFECT */ + +char *spline_text( void ); +void spline_init( bopti_image_t *screen ); +void spline_update( bopti_image_t *screen, float dt ); +void spline_render( bopti_image_t *screen ); +void spline_deinit( bopti_image_t *screen ); + + #endif diff --git a/src/effects/firecube.cpp b/src/effects/firecube.cpp index df10eb4..79d6c04 100644 --- a/src/effects/firecube.cpp +++ b/src/effects/firecube.cpp @@ -97,7 +97,7 @@ void drawline(bopti_image_t *screen, int x1, int y1, int x2, int y2, uint8_t col dx = (dx >= 0 ? dx : -dx); dy = (dy >= 0 ? dy : -dy); - dest[x1+y1*screen->stride] = color; + pixel(screen, x1, y1, color); if(dx >= dy) { @@ -109,7 +109,7 @@ void drawline(bopti_image_t *screen, int x1, int y1, int x2, int y2, uint8_t col x += sx; cumul += dy; if(cumul > dx) cumul -= dx, y += sy; - dest[x+y*screen->stride] = color; + pixel(screen, x, y, color); } } else @@ -120,11 +120,11 @@ void drawline(bopti_image_t *screen, int x1, int y1, int x2, int y2, uint8_t col y += sy; cumul += dx; if(cumul > dy) cumul -= dy, x += sx; - dest[x+y*screen->stride] = color; + pixel(screen, x, y, color); } } - dest[x2+y2*screen->stride] = color; + pixel(screen, x2, y2, color); } diff --git a/src/effects/morphfire.cpp b/src/effects/morphfire.cpp index b8a79bc..3b15293 100644 --- a/src/effects/morphfire.cpp +++ b/src/effects/morphfire.cpp @@ -131,6 +131,8 @@ void morphfire_update( bopti_image_t *screen, [[Maybe_unused]] float dt ) void pixel( bopti_image_t *screen, uint16_t sx, uint16_t sy, int8_t color ) { + if (sx<0 || sx>DWIDTH || sy<0 || sy> MAXHEIGHT ) return; + int8_t *image = (int8_t *)screen->data; image[ sx + sy * screen->stride ] = color; diff --git a/src/effects/spline.cpp b/src/effects/spline.cpp new file mode 100644 index 0000000..4d80bab --- /dev/null +++ b/src/effects/spline.cpp @@ -0,0 +1,114 @@ +#include "effects.h" + +#include +#include "../utilities/fast_trig.h" +#include +#include +#include "../utilities/trajectory.h" + + +Trajectory MySpline; +#define MAXPT 10 + +libnum::num32 xPointsOrigin[MAXPT]; +libnum::num32 yPointsOrigin[MAXPT]; + +libnum::num32 xPointsVel[MAXPT]; +libnum::num32 yPointsVel[MAXPT]; + +static int current_morph_frame; + + +int random_between( int lower, int upper ) +{ + int number = (rand() % (upper - lower + 1)) + lower; + return number; +} + + +void spline_init( bopti_image_t *screen ) +{ + + for( int i=0; ipalette[u] = C_RGB( 0, 0, 0 ); + screen->palette[u+64] = C_RGB( 0, 0, u/2 ); + screen->palette[u+128] = C_RGB( 0, u/2, 31 ); + screen->palette[u+192] = C_RGB( u/2, 31, 31 ); + } +} + + +void spline_update( bopti_image_t *screen, [[Maybe_unused]] float dt ) +{ + MySpline.RemovePoints(); + + for( int u=0; u=libnum::num32(DWIDTH-10)) xPointsOrigin[u] = DWIDTH-11, xPointsVel[u] = -xPointsVel[u]; + + yPointsOrigin[u] += yPointsVel[u]; + if (yPointsOrigin[u]=libnum::num32(MAXHEIGHT-10)) yPointsOrigin[u] = MAXHEIGHT-11, yPointsVel[u] = -yPointsVel[u]; + + Vector2D *p = new Vector2D( xPointsOrigin[u], yPointsOrigin[u] ); + + MySpline.AddPoint( p ); + } +} + +void spline_render( bopti_image_t *screen ) +{ + image_fill( screen, -128 ); + + float accumulatedTime = 0.0f; + libnum::num32 x0, y0, x1, y1, x2, y2; + + MySpline.CalculatePosition( &accumulatedTime, 0.0f, 0.0f, true, &x0, &y0 ); + + for( int u=0; u +#include "../utilities/fast_trig.h" +#include +#include +#include "../utilities/trajectory.h" + + +Trajectory MySplineBlured; +#define MAXPOINT 12 + +int scalespline = 0, rotate = 0; + +void splineblur_init( bopti_image_t *screen ) +{ + libnum::num32 scalenum = libnum::num32(1)+ FastCosInt(scalespline); + rotate = 0; + + for( int u=0; upalette[u] = C_RGB( 0, 0, 0 ); + screen->palette[u+32] = C_RGB( 0, 0, 0 ); + screen->palette[u+64] = C_RGB( 0, 0, 0 ); + screen->palette[u+96] = C_RGB( 0, 0, 0 ); + screen->palette[u+128] = C_RGB( 0, 0, 0 ); + screen->palette[u+160] = C_RGB( u, 0, 0 ); + screen->palette[u+192] = C_RGB( 31, u, 0 ); + screen->palette[u+224] = C_RGB( 31, 31, u ); + } + + image_fill( screen, -128 ); +} + + +void splineblur_update( bopti_image_t *screen, [[Maybe_unused]] float dt ) +{ + MySplineBlured.RemovePoints(); + + scalespline += 1; + rotate += 1; + + scalespline = scalespline % 360; + rotate = rotate % 360; + + libnum::num32 scalenum = libnum::num32(1) + FastCosInt(scalespline); + + for( int u=0; udata; + int16_t temp; + + uint32_t offset = screen->stride; // pixel(x,y) + + for( int index = 2; index < MAXHEIGHT-2; index++ ) + { + for( int x = 2; x < screen->width - 2; x++ ) + { + temp = dest[ offset + x - 1 ] + // pixel(x-1,y) + dest[ offset + x + 1 ] + // pixel(x+1,y) + dest[ offset + x + screen->stride ] + // pixel(x,y+1) + dest[ offset + x - screen->stride ]; // pixel(x,y-1) + + + dest[offset + x] = temp >> 2; + } + offset += screen->stride; + } +} + + +void splineblur_render( bopti_image_t *screen ) +{ + float accumulatedTime = 0.0f; + libnum::num32 x1, y1, x2, y2; + + for( int u=0; u -#define TOTAL_NB_EFFECT 8 +#define TOTAL_NB_EFFECT 10 typedef void (*PtrToFunc)( bopti_image_t * ); typedef void (*PtrToFuncDt)( bopti_image_t *, float ); typedef char* (*PtrTextFunc)( void ); -PtrTextFunc Effect_Text[] = { &rotozoom_text, &linemorph_text, &plasma_text, &morph_text, &lens_text, &firecube_text, &matrix_text, &morphfire_text }; -PtrToFunc Effects_Init[] = { &rotozoom_init, &linemorph_init, &plasma_init, &morph_init, &lens_init, &firecube_init, &matrix_init, &morphfire_init }; -PtrToFuncDt Effects_Update[] = { &rotozoom_update, &linemorph_update, &plasma_update, &morph_update, &lens_update, &firecube_update, &matrix_update, &morphfire_update }; -PtrToFunc Effects_Render[] = { &rotozoom_render, &linemorph_render, &plasma_render, &morph_render, &lens_render, &firecube_render, &matrix_render, &morphfire_render }; -PtrToFunc Effects_DeInit[] = { &rotozoom_deinit, &linemorph_deinit, &plasma_deinit, &morph_deinit, &lens_deinit, &firecube_deinit, &matrix_deinit, &morphfire_deinit }; +PtrTextFunc Effect_Text[] = { &spline_text, &splineblur_text, &linemorph_text, &rotozoom_text, &plasma_text, &morph_text, &lens_text, &firecube_text, &matrix_text, &morphfire_text }; +PtrToFunc Effects_Init[] = { &spline_init, &splineblur_init, &linemorph_init, &rotozoom_init, &plasma_init, &morph_init, &lens_init, &firecube_init, &matrix_init, &morphfire_init }; +PtrToFuncDt Effects_Update[] = { &spline_update, &splineblur_update, &linemorph_update, &rotozoom_update, &plasma_update, &morph_update, &lens_update, &firecube_update, &matrix_update, &morphfire_update }; +PtrToFunc Effects_Render[] = { &spline_render, &splineblur_render, &linemorph_render, &rotozoom_render, &plasma_render, &morph_render, &lens_render, &firecube_render, &matrix_render, &morphfire_render }; +PtrToFunc Effects_DeInit[] = { &spline_deinit, &splineblur_deinit, &linemorph_deinit, &rotozoom_deinit, &plasma_deinit, &morph_deinit, &lens_deinit, &firecube_deinit, &matrix_deinit, &morphfire_deinit }; int current_effect = 0; @@ -57,7 +56,7 @@ bool skip_intro = false; bool screenshot = false; bool record = false; bool showFPS = false; -bool showName = true; +bool showName = false; bool showOption = false; bool EffectLoop = true; @@ -361,7 +360,7 @@ int main(void) int EntryClockLevel; EntryClockLevel = clock_get_speed(); - clock_set_speed( CLOCK_SPEED_F4 ); + clock_set_speed( CLOCK_SPEED_F5 ); srand( rtc_ticks() ); @@ -459,11 +458,14 @@ int main(void) while (exitToOS==false); + Close(); + + image_free( screen ); + prof_quit(); clock_set_speed( EntryClockLevel ); - image_free( screen ); #if(MORE_RAM) if (canWeAllocateMoreRam) FreeMoreRAM( ); diff --git a/src/utilities/trajectory.cpp b/src/utilities/trajectory.cpp new file mode 100644 index 0000000..d227f38 --- /dev/null +++ b/src/utilities/trajectory.cpp @@ -0,0 +1,89 @@ +#include +#include "../config.h" + +#include "trajectory.h" + +Trajectory::Trajectory( ) +{ +} + + +Trajectory::~Trajectory( ) +{ + for( auto& p : ControlPoints ) + delete( p ); + + ControlPoints.clear(); +} + + +void Trajectory::RemovePoints( ) +{ + for( auto& p : ControlPoints ) + delete( p ); + + ControlPoints.clear(); +} + + +void Trajectory::AddPoint( Vector2D *p ) +{ + ControlPoints.push_back( p ); +} + + +void Trajectory::AddPointAtBegining( Vector2D *p ) +{ + ControlPoints.insert( ControlPoints.begin(), p ); +} + + +int8_t Trajectory::CalculatePosition( float *accumulatedTime, float time, uint16_t speed, bool looped, libnum::num *xreturn, libnum::num *yreturn ) +{ + *accumulatedTime += speed * time / 2000000.0f; + + if( !looped && (*accumulatedTime>ControlPoints.size())) + return -1; + + if (*accumulatedTime>ControlPoints.size()) + *accumulatedTime -= ControlPoints.size(); + + if (*accumulatedTime<0) + *accumulatedTime += ControlPoints.size(); + + + libnum::num t = libnum::num( *accumulatedTime - (int) *accumulatedTime ); + + int p0, p1, p2, p3; + + if (!looped) + { + p1 = std::min( (int) *accumulatedTime + 1, (int) (ControlPoints.size()-1)); + p2 = std::min( p1 + 1, (int) (ControlPoints.size()-1)); + p3 = std::min( p2 + 1, (int) (ControlPoints.size()-1)); + p0 = std::min( p1 - 1, (int) (ControlPoints.size()-1)); + } + else + { + p1 = (int) *accumulatedTime; + p2 = (p1 + 1) % ControlPoints.size(); + p3 = (p2 + 1) % ControlPoints.size(); + p0 = p1 >= 1 ? p1 - 1 : ControlPoints.size() - 1; + } + + libnum::num tt = t * t; + libnum::num ttt = tt * t; + + libnum::num q1 = -ttt + 2*tt - t; + libnum::num q2 = 3*ttt - 5*tt + libnum::num( 2 ); + libnum::num q3 = -3*ttt + 4*tt + t; + libnum::num q4 = ttt - tt; + + libnum::num tx = libnum::num( 0.5f ) * (ControlPoints[p0]->x * q1 + ControlPoints[p1]->x * q2 + ControlPoints[p2]->x * q3 + ControlPoints[p3]->x * q4); + libnum::num ty = libnum::num( 0.5f ) * (ControlPoints[p0]->y * q1 + ControlPoints[p1]->y * q2 + ControlPoints[p2]->y * q3 + ControlPoints[p3]->y * q4); + + *xreturn = tx; + *yreturn = ty; + + return 0; +} diff --git a/src/utilities/trajectory.h b/src/utilities/trajectory.h new file mode 100644 index 0000000..d436b78 --- /dev/null +++ b/src/utilities/trajectory.h @@ -0,0 +1,30 @@ +#ifndef TRAJECTORY_H +#define TRAJECTORY_H + + +#include +#include +#include + +#include +#include "../utilities/vector2D.h" + + +class Trajectory +{ + public: + Trajectory( ); + ~Trajectory( ); + + void AddPoint( Vector2D *p ); + void AddPointAtBegining( Vector2D *p ); + int8_t CalculatePosition( float *accumulatedTime, float time, uint16_t speed, bool looped, libnum::num *xreturn, libnum::num *yreturn ); + + void RemovePoints( ); + + std::vector ControlPoints; + bool isLoop; +}; + + +#endif \ No newline at end of file