Fix barycentric coordinates calculation (#2)
Reviewed-on: #2 * Set up for debugging * Replace get_barycentric_coords with different calculation * Update commented lines * Add V3_ELEM_COUNT macro * Change loop in barycentric coordinates calculation function * Update debug values * Simplify barycentric coordinates function * Remove debug lines Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com> Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit was merged in pull request #2.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include "typed_list.h"
|
||||
#include <math.h>
|
||||
|
||||
#define V3_ELEM_COUNT 3
|
||||
|
||||
typedef struct i64x2 V2i;
|
||||
struct i64x2 {
|
||||
i64 x;
|
||||
@@ -32,16 +34,21 @@ struct f32x2 {
|
||||
typedef struct f32x3 V3f;
|
||||
struct f32x3 {
|
||||
union {
|
||||
f32 x;
|
||||
f32 r;
|
||||
};
|
||||
union {
|
||||
f32 y;
|
||||
f32 g;
|
||||
};
|
||||
union {
|
||||
f32 z;
|
||||
f32 b;
|
||||
f32 elements[V3_ELEM_COUNT];
|
||||
struct {
|
||||
union {
|
||||
f32 x;
|
||||
f32 r;
|
||||
};
|
||||
union {
|
||||
f32 y;
|
||||
f32 g;
|
||||
};
|
||||
union {
|
||||
f32 z;
|
||||
f32 b;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user