#ifndef SWIFT_MATHS_VEC3F_H
#define SWIFT_MATHS_VEC3F_H

#include <swift/stdlib.h>

#include <swift/maths/api.h>

typedef union swift_mat3f_t swift_mat3f_t;
typedef union swift_vec3f_t swift_vec3f_t;
typedef union swift_vec3u_t swift_vec3u_t;

union swift_vec3f_t {
	struct {
		float x, y, z;
	}xyz;

	struct {
		float r, g, b;
	}rgb;

	float data[3];
};

union swift_vec3u_t {
	struct {
		uint32_t x, y, z;
	}xyz;

	struct {
		uint32_t r, g, b;
	}rgb;

	uint32_t data[3];
};

#define SWIFT_VEC3F(...) ((swift_vec3f_t){__VA_ARGS__})

SWIFT_MATHS_API swift_vec3f_t swift_vec3f_neg(swift_vec3f_t vec);
SWIFT_MATHS_API swift_vec3f_t swift_vec3f_add_scalar(swift_vec3f_t lhs,
	float rhs);
SWIFT_MATHS_API swift_vec3f_t swift_vec3f_sub_scalar(swift_vec3f_t lhs,
	float rhs);
SWIFT_MATHS_API swift_vec3f_t swift_vec3f_mul_scalar(swift_vec3f_t lhs,
	float rhs);
SWIFT_MATHS_API swift_vec3f_t swift_vec3f_div_scalar(swift_vec3f_t lhs,
	float rhs);
SWIFT_MATHS_API swift_vec3f_t swift_vec3f_add(swift_vec3f_t lhs,
	swift_vec3f_t rhs);
SWIFT_MATHS_API swift_vec3f_t swift_vec3f_sub(swift_vec3f_t lhs,
	swift_vec3f_t rhs);
SWIFT_MATHS_API float swift_vec3f_dot(swift_vec3f_t lhs,
	swift_vec3f_t rhs);
SWIFT_MATHS_API swift_vec3f_t swift_vec3f_cross(swift_vec3f_t lhs,
	swift_vec3f_t rhs);
SWIFT_MATHS_API swift_mat3f_t swift_vec3f_tensor(swift_vec3f_t lhs,
	swift_vec3f_t rhs);
SWIFT_MATHS_API float swift_vec3f_norm(swift_vec3f_t vec);
SWIFT_MATHS_API swift_vec3f_t swift_vec3f_normalise(swift_vec3f_t vec);

#endif /* SWIFT_MATHS_VEC3F_H */
