Minor cleanup.
parent
8aa06fb3d6
commit
0c53f3fd8b
|
@ -9,7 +9,7 @@ extern "C" {
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "vectorial/simd4x4f.h"
|
#include "vectorial/simd4x4f.h"
|
||||||
8
|
|
||||||
inline bool sch_simd4f_equal(simd4f a, simd4f b) {
|
inline bool sch_simd4f_equal(simd4f a, simd4f b) {
|
||||||
return (simd4f_get_x(simd4f_length4_squared(simd4f_sub(a, b))) == 0.f);
|
return (simd4f_get_x(simd4f_length4_squared(simd4f_sub(a, b))) == 0.f);
|
||||||
}
|
}
|
||||||
|
@ -101,9 +101,9 @@ SchHullResult sch_builder_create_hull(sch_hull_builder* builder, sch_hull* out_h
|
||||||
// Calculations
|
// Calculations
|
||||||
//
|
//
|
||||||
|
|
||||||
float sch_plane_distance(sch_plane* plane, simd4f* v);
|
float sch_plane_distance(const sch_plane* plane, const simd4f* v);
|
||||||
|
|
||||||
void sch_edge_get_dir(sch_edge* edge, simd4f* dir);
|
void sch_edge_get_dir(const sch_edge* edge, simd4f* out_dir);
|
||||||
|
|
||||||
void sch_hull_free_memory (sch_hull* hull);
|
void sch_hull_free_memory (sch_hull* hull);
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ void sch_create_face(int num_vert, simd4f* vertices, sch_face* out_face);
|
||||||
|
|
||||||
#ifdef SCONVCOL_IMPLEMENTATION
|
#ifdef SCONVCOL_IMPLEMENTATION
|
||||||
|
|
||||||
float sch_plane_distance(sch_plane* plane, simd4f* v) {
|
float sch_plane_distance(const sch_plane* plane, const simd4f* v) {
|
||||||
return simd4f_dot3_scalar(simd4f_sub(*v, plane->p), plane->n);
|
return simd4f_dot3_scalar(simd4f_sub(*v, plane->p), plane->n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ void sch_create_face(int num_vert, simd4f* vertices, sch_face* out_face) {
|
||||||
out_face->edge = &f_edges[0];
|
out_face->edge = &f_edges[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
void sch_edge_get_dir(sch_edge* edge, simd4f* out_dir) {
|
void sch_edge_get_dir(const sch_edge* edge, simd4f* out_dir) {
|
||||||
*out_dir = simd4f_sub(edge->next->vert->p, edge->vert->p);
|
*out_dir = simd4f_sub(edge->next->vert->p, edge->vert->p);
|
||||||
float recip_len = 1.f / sqrtf(simd4f_dot3_scalar(*out_dir, *out_dir));
|
float recip_len = 1.f / sqrtf(simd4f_dot3_scalar(*out_dir, *out_dir));
|
||||||
*out_dir = simd4f_mul(*out_dir, simd4f_splat(recip_len));
|
*out_dir = simd4f_mul(*out_dir, simd4f_splat(recip_len));
|
||||||
|
|
Loading…
Reference in New Issue