[WIP] creation of movement trajectory based on Catmull-Rom
This commit is contained in:
parent
6f5f06bfd0
commit
a08add12de
|
@ -22,6 +22,9 @@ set(SOURCES
|
|||
src/enemy.cpp
|
||||
src/starfieldshader.cpp
|
||||
|
||||
src/point2D.cpp
|
||||
src/trajectory.cpp
|
||||
|
||||
# ...
|
||||
)
|
||||
set(ASSETS_cg
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "MyAzurShaders.h"
|
||||
#include "impact.h"
|
||||
|
||||
#include "trajectory.h"
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#include "point2D.h"
|
||||
|
||||
|
||||
Point2D::Point2D( )
|
||||
{
|
||||
x = libnum::num( 0 );
|
||||
y = libnum::num( 0 );
|
||||
}
|
||||
|
||||
|
||||
Point2D::Point2D( int16_t _x, int16_t _y )
|
||||
{
|
||||
x = libnum::num( _x );
|
||||
y = libnum::num( _y );
|
||||
}
|
||||
|
||||
|
||||
Point2D::~Point2D( )
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef POINT2D_H
|
||||
#define POINT2D_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <stdlib.h>
|
||||
#include <num/num.h>
|
||||
|
||||
|
||||
class Point2D
|
||||
{
|
||||
public:
|
||||
libnum::num x, y;
|
||||
Point2D( );
|
||||
Point2D( int16_t _x, int16_t _y );
|
||||
~Point2D( );
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,13 @@
|
|||
#include "trajectory.h"
|
||||
|
||||
Trajectory::Trajectory( )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
Trajectory::~Trajectory( )
|
||||
{
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef TRAJECTORY_H
|
||||
#define TRAJECTORY_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <stdlib.h>
|
||||
#include <num/num.h>
|
||||
|
||||
#include <vector>
|
||||
#include "point2D.h"
|
||||
|
||||
|
||||
class Trajectory
|
||||
{
|
||||
public:
|
||||
Trajectory( );
|
||||
~Trajectory( );
|
||||
|
||||
|
||||
std::vector<Point2D*> ControlPoints;
|
||||
bool isLoop;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue