mirror of
https://github.com/PoetryInCode/simple-rigid-sim.git
synced 2025-04-19 10:17:13 -04:00
general
This commit is contained in:
parent
356f646f95
commit
de95a6317e
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
CC = clang
|
||||
LINK = -lstdc++ -lSDL2 -lm -ldl -lSDL_gfx
|
||||
LINK = -lstdc++ -lSDL2 -lm -ldl #-lSDL_gfx
|
||||
DBG = -Wall -g -gmodules -O0
|
||||
CC += $(DBG)
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef BOUND
|
||||
#define BOUND
|
||||
|
||||
#include <cstddef>
|
||||
#include "Quad.h"
|
||||
|
||||
class BoundingBox {
|
||||
private:
|
||||
size_t parent;
|
||||
@ -41,4 +43,5 @@ class BoundingBox {
|
||||
BoundingBox();
|
||||
void update();
|
||||
void render(SDL_Renderer *rend);
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
@ -1,10 +1,11 @@
|
||||
#ifndef CIRCLE
|
||||
#define CIRCLE
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <cmath>
|
||||
#include "Vector.h"
|
||||
#include "Color.h"
|
||||
|
||||
#ifndef CIRCLE
|
||||
#define CIRCLE
|
||||
class Circle {
|
||||
private:
|
||||
int testpoint(int x,int y) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef COLOR
|
||||
#define COLOR
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef RED
|
||||
#define RED 255,0,0,255
|
||||
|
@ -96,4 +96,4 @@ bool Quad::isInitialized() {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
}*/
|
||||
|
@ -1,3 +1,5 @@
|
||||
#ifndef QUAD
|
||||
#define QUAD
|
||||
#include <vector>
|
||||
#include "SDL2/SDL.h"
|
||||
#include "Vector.h"
|
||||
@ -17,4 +19,5 @@ class Quad {
|
||||
void render(SDL_Renderer *renderer);
|
||||
void translate(Vector vec);
|
||||
//bool isInitialized();
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
@ -1,3 +1,6 @@
|
||||
#ifndef WINDOW
|
||||
#define WINDOW
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_timer.h>
|
||||
#include "Color.h"
|
||||
@ -12,3 +15,4 @@ class Window {
|
||||
void setClearColor(Color c);
|
||||
void setClearColor(Uint8 r,Uint8 g,Uint8 b,Uint8 a);
|
||||
};
|
||||
#endif
|
||||
|
@ -1,3 +1,6 @@
|
||||
#ifndef PHYS
|
||||
#define PHYS
|
||||
|
||||
#include "BoundingBox.h"
|
||||
#include "Circle.h"
|
||||
#include <vector>
|
||||
@ -7,7 +10,7 @@ class phys_obj {
|
||||
Vector velocity;
|
||||
Circle obj;
|
||||
BoundingBox bounds;
|
||||
bool contact_floor;
|
||||
bool contact_floor;
|
||||
phys_obj();
|
||||
phys_obj(Circle c);
|
||||
phys_obj(Circle c, Vector init_vel);
|
||||
@ -16,7 +19,8 @@ class phys_obj {
|
||||
static void calculate_vectors(std::vector<phys_obj> *objects, Vector win_dim);
|
||||
void translate(Vector vec);
|
||||
bool checkCollision(phys_obj o);
|
||||
float angleTo(phys_obj o);
|
||||
float angleTo(phys_obj o);
|
||||
int distanceTo(Circle c);
|
||||
void setPosition(Vector vec);
|
||||
};
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user