Skip to content

Commit

Permalink
phxParam
Browse files Browse the repository at this point in the history
  • Loading branch information
ctmbl committed Jan 12, 2022
1 parent 9fbee01 commit df7eb14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 3 additions & 6 deletions include/entity/strategies/physical_entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define PHYSICAL_ENTITY
#include "strategy.h"
#include <SFML/Graphics/Transformable.hpp>
#include "lib.h"

class Hitbox{};

Expand All @@ -18,12 +19,8 @@ or damageHitbox != physicalHitbox (like i can touch with my legs) but they can't
//position, rotation etc in the parent class Transformable

Hitbox physicalHitbox; // boolean solid (or touchable ?) in here

unsigned double mass; //mass > 0
signed short gravityReaction; //-1 if the PhysicalEntity is likely to fly
unsigned double bouncyness; // [0,1] absorb every momentum (0) or none (1), maybe it will increase it's internal energy ( to satisfy conservation of energy)
double internalEnergy; //for characters that can absorb energy and then liberate it ?
double electricCharge; //mdr

PhxParam phxParam;

public:
static void correction(Vector<PhysicalEntity> phxEtts, Vector<Vector<double,double>> correctionMatrix);
Expand Down
9 changes: 7 additions & 2 deletions include/lib/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
typedef std::pair<unsigned int, unsigned int> Vec;
typedef std::pair<int, int> Vel;

typedef struct phxParam
typedef struct PhxParam
{
Vec position;
Vel velocity;
} phxParam;

unsigned int mass;
short gravityReaction; //-1 if the PhysicalEntity is likely to fly
unsigned double bouncyness; // [0,1] absorb every momentum (0) or none (1), maybe it will increase it's internal energy ( to satisfy conservation of energy)
double internalEnergy; //for characters that can absorb energy and then liberate it ?
} PhxParam;

enum Force {weight};

Expand Down

0 comments on commit df7eb14

Please sign in to comment.