comment style consistency
This commit is contained in:
16
physics.c
16
physics.c
@@ -8,16 +8,20 @@
|
|||||||
#define FRAMERATE 60
|
#define FRAMERATE 60
|
||||||
#define GRAVITY 0.001f
|
#define GRAVITY 0.001f
|
||||||
|
|
||||||
// Points store position, position in previous frame and forces
|
/*
|
||||||
// velocity is calculated from the distance between (x,y) and (px,py)
|
* Points store position, position in previous frame and forces
|
||||||
|
* velocity is calculated from the distance between (x,y) and (px,py)
|
||||||
|
*/
|
||||||
typedef struct Point{
|
typedef struct Point{
|
||||||
double x, y,
|
double x, y,
|
||||||
px, py,
|
px, py,
|
||||||
fx, fy;
|
fx, fy;
|
||||||
} Point;
|
} Point;
|
||||||
|
|
||||||
// Links connect two points such that their distance is constant
|
/*
|
||||||
// these can be used to make rigid bodies
|
* Links connect two points such that their distance is constant
|
||||||
|
* these can be used to make rigid bodies
|
||||||
|
*/
|
||||||
typedef struct Link {
|
typedef struct Link {
|
||||||
Point* a;
|
Point* a;
|
||||||
Point* b;
|
Point* b;
|
||||||
@@ -85,7 +89,9 @@ int main(){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns distance of two points
|
/*
|
||||||
|
* Returns distance of two points
|
||||||
|
*/
|
||||||
double distance(Point* a, Point* b){
|
double distance(Point* a, Point* b){
|
||||||
double dx = a->x - b->x;
|
double dx = a->x - b->x;
|
||||||
double dy = b->y - b->y;
|
double dy = b->y - b->y;
|
||||||
|
|||||||
Reference in New Issue
Block a user