Did not implement edge based collision (performance concerns) merged other modifications
This commit is contained in:
commit
256fef97d9
|
@ -141,6 +141,10 @@ void shape_insert_point(Shape* self, size_t at, Vector point) {
|
||||||
list_insert(&self->points, &point, at);
|
list_insert(&self->points, &point, at);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List* shape_get_points(Shape* self) {
|
||||||
|
return &self->points;
|
||||||
|
}
|
||||||
|
|
||||||
Vector shape_remove_point(Shape* self, size_t at) {
|
Vector shape_remove_point(Shape* self, size_t at) {
|
||||||
Vector point = *list_at_as(Vector, &self->points, at);
|
Vector point = *list_at_as(Vector, &self->points, at);
|
||||||
list_erase(&self->points, at);
|
list_erase(&self->points, at);
|
||||||
|
|
|
@ -120,6 +120,10 @@ Vector vrotatef(Vector a, float t) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
static inline
|
static inline
|
||||||
|
float vanglebetweenf(Vector a, Vector b) {
|
||||||
|
return vdotf(a, b) / (vmagnitudef(a) * vmagnitudef(b));
|
||||||
|
}
|
||||||
|
static inline
|
||||||
Vector vprojectf(Vector onto, Vector from) {
|
Vector vprojectf(Vector onto, Vector from) {
|
||||||
float dot = vdotf(onto, from);
|
float dot = vdotf(onto, from);
|
||||||
return vmulff(onto, dot);
|
return vmulff(onto, dot);
|
||||||
|
|
Loading…
Reference in a new issue