33 lines
685 B
C
33 lines
685 B
C
#ifndef PHYS_H
|
|
#define PHYS_H
|
|
#include "Vector.h"
|
|
#include "Primitives.h"
|
|
|
|
struct Phys {
|
|
Vector position;
|
|
Vector velocity;
|
|
Vector direction;
|
|
Vector acceleration;
|
|
double radius;
|
|
float mass;
|
|
float inverse_mass;
|
|
};
|
|
int doPhys(struct Phys *phys);
|
|
void cleanPhys(struct Phys *phys);
|
|
|
|
int collPhysBox(struct Phys *phys, struct Box *box);
|
|
|
|
int turnToVector(struct Phys *phys, struct Vector vector, float speed);
|
|
int faceVector(struct Phys *phys, struct Vector vector);
|
|
int addForce(struct Phys *phys, float force);
|
|
int doVelocity(struct Phys *phys);
|
|
|
|
struct Circle {
|
|
float x;
|
|
float y;
|
|
float radius;
|
|
};
|
|
int collPhysCircle(struct Phys *phys, struct Circle *circle);
|
|
|
|
#endif
|