gravitation, no collisions

This commit is contained in:
uan
2025-12-24 10:51:15 +01:00
parent 63bb2eac8c
commit 5792addc4b
3 changed files with 77 additions and 29 deletions

View File

@@ -5,12 +5,13 @@
typedef struct {
Vector3 pos;
Vector3 vel;
float r;
double r;
Color color;
float restitution;
double restitution;
double mass;
} object;
object *newobj(Vector3 pos, float r, Color c, float rest)
object *newobj(Vector3 pos, double r, Color c, double rest, double m)
{
object *obj = (object*)malloc(sizeof(object));
obj->r = r;
@@ -18,5 +19,6 @@ object *newobj(Vector3 pos, float r, Color c, float rest)
obj->color = c;
obj->vel = (Vector3){0, 0, 0};
obj->restitution = rest;
obj->mass = m;
return obj;
}