Browse Source

planfunc

place-stuff
alistair 4 years ago
parent
commit
5ed9b79adf
  1. 4
      distfuncs.c
  2. 3
      distfuncs.h

4
distfuncs.c

@ -294,6 +294,10 @@ new_object(struct vec* position, double rotation, double scale, @@ -294,6 +294,10 @@ new_object(struct vec* position, double rotation, double scale,
return new_obj;
}
struct object new_plane(struct vec* position, double rotation, double scale) {
return new_object(position, rotation, scale, sdf_hplane, yeet_pho);
}
struct object new_sphere(struct vec* position, double rotation, double scale) {
return new_object(position, rotation, scale, sdf_sphere, yeet_pho);
}

3
distfuncs.h

@ -10,6 +10,8 @@ struct object* new_tree(struct vec *, double, double); @@ -10,6 +10,8 @@ struct object* new_tree(struct vec *, double, double);
struct object new_object(struct vec *, double, double, double (*) (struct vec *),
struct colour (*)(struct ray *, struct object *));
struct object new_plane(struct vec* position, double rotation, double scale);
double sdf_box(struct vec *);
double sdf_hplane(struct vec *);
double sdf_phat_vert_line(struct vec *);
@ -20,5 +22,6 @@ struct colour yeet_col(struct ray *); @@ -20,5 +22,6 @@ struct colour yeet_col(struct ray *);
double sdf_3ellipsoid(struct vec *x);
double sdf_4ellipsoid(struct vec *x);
#endif

Loading…
Cancel
Save