mirror of
https://github.com/recp/cglm.git
synced 2026-01-04 22:30:05 +00:00
fix test build, supress warnings, update header guards for struct api
This commit is contained in:
@@ -29,8 +29,8 @@
|
||||
CGLM_INLINE void glms_decompose(mat4s m, vec4s t, mat4s * r, vec3s * s);
|
||||
*/
|
||||
|
||||
#ifndef cglm_affines_h
|
||||
#define cglm_affines_h
|
||||
#ifndef cglms_affines_h
|
||||
#define cglms_affines_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -117,8 +117,8 @@ glms_translate_make(vec3s v) {
|
||||
/*!
|
||||
* @brief creates NEW scale matrix by v vector
|
||||
*
|
||||
* @param[out] m affine transfrom
|
||||
* @param[in] v scale vector [x, y, z]
|
||||
* @returns affine transfrom
|
||||
*/
|
||||
CGLM_INLINE
|
||||
mat4s
|
||||
@@ -334,4 +334,4 @@ glms_decompose(mat4s m, vec4s * __restrict t, mat4s * __restrict r, vec3s * __re
|
||||
glm_decompose(m.raw, t->raw, r->raw, s->raw);
|
||||
}
|
||||
|
||||
#endif /* cglm_affines_h */
|
||||
#endif /* cglms_affines_h */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Full license can be found in the LICENSE file
|
||||
*/
|
||||
|
||||
#ifndef cglm_boxs_h
|
||||
#define cglm_boxs_h
|
||||
#ifndef cglms_boxs_h
|
||||
#define cglms_boxs_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -178,7 +178,7 @@ glms_aabb_radius(vec3s box[2]) {
|
||||
* @brief computes center point of AABB
|
||||
*
|
||||
* @param[in] box bounding box
|
||||
* @param[out] dest center of bounding box
|
||||
* @returns center of bounding box
|
||||
*/
|
||||
CGLM_INLINE
|
||||
vec3s
|
||||
@@ -253,4 +253,4 @@ glms_aabb_contains(vec3s box[2], vec3s other[2]) {
|
||||
return glm_aabb_contains(rawBox, rawOther);
|
||||
}
|
||||
|
||||
#endif /* cglm_boxs_h */
|
||||
#endif /* cglms_boxs_h */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Full license can be found in the LICENSE file
|
||||
*/
|
||||
|
||||
#ifndef cglm_colors_h
|
||||
#define cglm_colors_h
|
||||
#ifndef cglms_colors_h
|
||||
#define cglms_colors_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -24,4 +24,4 @@ glms_luminance(vec3s rgb) {
|
||||
return glm_luminance(rgb.raw);
|
||||
}
|
||||
|
||||
#endif /* cglm_colors_h */
|
||||
#endif /* cglms_colors_h */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Full license can be found in the LICENSE file
|
||||
*/
|
||||
|
||||
#ifndef cglm_curves_h
|
||||
#define cglm_curves_h
|
||||
#ifndef cglms_curves_h
|
||||
#define cglms_curves_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -37,4 +37,4 @@ glms_smc(float s, mat4s m, vec4s c) {
|
||||
return glm_smc(s, m.raw, c.raw);
|
||||
}
|
||||
|
||||
#endif /* cglm_curves_h */
|
||||
#endif /* cglms_curves_h */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Full license can be found in the LICENSE file
|
||||
*/
|
||||
|
||||
#ifndef cglm_frustums_h
|
||||
#define cglm_frustums_h
|
||||
#ifndef cglms_frustums_h
|
||||
#define cglms_frustums_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -152,4 +152,4 @@ glms_frustum_corners_at(vec4s corners[8],
|
||||
glms_vec4_pack(planeCorners, rawPlaneCorners, 8);
|
||||
}
|
||||
|
||||
#endif /* cglm_frustums_h */
|
||||
#endif /* cglms_frustums_h */
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
CGLM_INLINE void glm_versor_print(versor vec, FILE *ostream);
|
||||
*/
|
||||
|
||||
#ifndef cglm_ios_h
|
||||
#define cglm_ios_h
|
||||
#ifndef cglms_ios_h
|
||||
#define cglms_ios_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../io.h"
|
||||
@@ -79,4 +79,4 @@ glms_aabb_print(vec3s bbox[2],
|
||||
glm_aabb_print(rawBbox, tag, ostream);
|
||||
}
|
||||
|
||||
#endif /* cglm_ios_h */
|
||||
#endif /* cglms_ios_h */
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
CGLM_INLINE float glms_mat3_rmc(vec3s r, mat3s m, vec3s c);
|
||||
*/
|
||||
|
||||
#ifndef cglm_mat3s_h
|
||||
#define cglm_mat3s_h
|
||||
#ifndef cglms_mat3s_h
|
||||
#define cglms_mat3s_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -286,4 +286,4 @@ glms_mat3_rmc(vec3s r, mat3s m, vec3s c) {
|
||||
return glm_mat3_rmc(r.raw, m.raw, c.raw);
|
||||
}
|
||||
|
||||
#endif /* cglm_mat3s_h */
|
||||
#endif /* cglms_mat3s_h */
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
CGLM_INLINE float glms_mat4_rmc(vec4s r, mat4s m, vec4s c);
|
||||
*/
|
||||
|
||||
#ifndef cglm_mat4s_h
|
||||
#define cglm_mat4s_h
|
||||
#ifndef cglms_mat4s_h
|
||||
#define cglms_mat4s_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -463,5 +463,4 @@ glms_mat4_rmc(vec4s r, mat4s m, vec4s c) {
|
||||
return glm_mat4_rmc(r.raw, m.raw, c.raw);
|
||||
}
|
||||
|
||||
#endif /* cglm_mat4s_h */
|
||||
|
||||
#endif /* cglms_mat4s_h */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Full license can be found in the LICENSE file
|
||||
*/
|
||||
|
||||
#ifndef cglm_planes_h
|
||||
#define cglm_planes_h
|
||||
#ifndef cglms_planes_h
|
||||
#define cglms_planes_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -37,4 +37,4 @@ glms_plane_normalize(vec4s plane) {
|
||||
return plane;
|
||||
}
|
||||
|
||||
#endif /* cglm_planes_h */
|
||||
#endif /* cglms_planes_h */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Full license can be found in the LICENSE file
|
||||
*/
|
||||
|
||||
#ifndef cglm_projects_h
|
||||
#define cglm_projects_h
|
||||
#ifndef cglms_projects_h
|
||||
#define cglms_projects_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -91,7 +91,7 @@ glms_unproject(vec3s pos, mat4s m, vec4s vp) {
|
||||
* @param[in] pos object coordinates
|
||||
* @param[in] m MVP matrix
|
||||
* @param[in] vp viewport as [x, y, width, height]
|
||||
* @param[out] dest projected coordinates
|
||||
* @returns projected coordinates
|
||||
*/
|
||||
CGLM_INLINE
|
||||
vec3s
|
||||
@@ -101,4 +101,4 @@ glms_project(vec3s pos, mat4s m, vec4s vp) {
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif /* cglm_projects_h */
|
||||
#endif /* cglms_projects_h */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Full license can be found in the LICENSE file
|
||||
*/
|
||||
|
||||
#ifndef cglm_spheres_h
|
||||
#define cglm_spheres_h
|
||||
#ifndef cglms_spheres_h
|
||||
#define cglms_spheres_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -90,4 +90,4 @@ glms_sphere_point(vec4s s, vec3s point) {
|
||||
return glm_sphere_point(s.raw, point.raw);
|
||||
}
|
||||
|
||||
#endif /* cglm_spheres_h */
|
||||
#endif /* cglms_spheres_h */
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
CGLM_INLINE vec3s glms_vec3_sqrt(vec3s v);
|
||||
*/
|
||||
|
||||
#ifndef cglm_vec3s_ext_h
|
||||
#define cglm_vec3s_ext_h
|
||||
#ifndef cglms_vec3s_ext_h
|
||||
#define cglms_vec3s_ext_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -195,4 +195,4 @@ glms_vec3_sqrt(vec3s v) {
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif /* cglm_vec3s_ext_h */
|
||||
#endif /* cglms_vec3s_ext_h */
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
Functions:
|
||||
CGLM_INLINE vec3s glms_vec3(vec4s v4);
|
||||
CGLM_INLINE vec3s glms_vec3_copy(vec3s v);
|
||||
CGLM_INLINE void glms_vec3_pack(vec3s dst[], vec3 src[], size_t len);
|
||||
CGLM_INLINE void glms_vec3_unpack(vec3 dst[], vec3s src[], size_t len);
|
||||
CGLM_INLINE vec3s glms_vec3_zero();
|
||||
@@ -66,8 +65,8 @@
|
||||
CGLM_INLINE vec3s glms_normalize(vec3s v);
|
||||
*/
|
||||
|
||||
#ifndef cglm_vec3s_h
|
||||
#define cglm_vec3s_h
|
||||
#ifndef cglms_vec3s_h
|
||||
#define cglms_vec3s_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -99,20 +98,6 @@ glms_vec3(vec4s v4) {
|
||||
return r;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief copy all members of [a] to [dest]
|
||||
*
|
||||
* @param[in] a source
|
||||
* @returns destination
|
||||
*/
|
||||
CGLM_INLINE
|
||||
vec3s
|
||||
glms_vec3_copy(vec3s v) {
|
||||
vec3s r;
|
||||
glm_vec3_copy(v.raw, r.raw);
|
||||
return r;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief pack an array of vec3 into an array of vec3s
|
||||
*
|
||||
@@ -150,7 +135,6 @@ glms_vec3_unpack(vec3 dst[], vec3s src[], size_t len) {
|
||||
/*!
|
||||
* @brief make vector zero
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @returns zero vector
|
||||
*/
|
||||
CGLM_INLINE
|
||||
@@ -164,7 +148,6 @@ glms_vec3_zero() {
|
||||
/*!
|
||||
* @brief make vector one
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @returns one vector
|
||||
*/
|
||||
CGLM_INLINE
|
||||
@@ -237,7 +220,7 @@ glms_vec3_add(vec3s a, vec3s b) {
|
||||
/*!
|
||||
* @brief add scalar to v vector store result in dest (d = v + s)
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @param[in] a vector
|
||||
* @param[in] s scalar
|
||||
* @returns destination vector
|
||||
*/
|
||||
@@ -267,7 +250,7 @@ glms_vec3_sub(vec3s a, vec3s b) {
|
||||
/*!
|
||||
* @brief subtract scalar from v vector store result in dest (d = v - s)
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @param[in] a vector
|
||||
* @param[in] s scalar
|
||||
* @returns destination vector
|
||||
*/
|
||||
@@ -342,7 +325,7 @@ glms_vec3_div(vec3s a, vec3s b) {
|
||||
/*!
|
||||
* @brief div vector with scalar: d = v / s
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @param[in] a vector
|
||||
* @param[in] s scalar
|
||||
* @returns result = (a[0]/s, a[1]/s, a[2]/s)
|
||||
*/
|
||||
@@ -764,4 +747,4 @@ glms_normalize(vec3s v) {
|
||||
return v;
|
||||
}
|
||||
|
||||
#endif /* cglm_vec3s_h */
|
||||
#endif /* cglms_vec3s_h */
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
CGLM_INLINE vec4s glms_vec4_sqrt(vec4s v);
|
||||
*/
|
||||
|
||||
#ifndef cglm_vec4s_ext_h
|
||||
#define cglm_vec4s_ext_h
|
||||
#ifndef cglms_vec4s_ext_h
|
||||
#define cglms_vec4s_ext_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -195,4 +195,4 @@ glms_vec4_sqrt(vec4s v) {
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif /* cglm_vec4s_ext_h */
|
||||
#endif /* cglms_vec4s_ext_h */
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
CGLM_INLINE vec4s glms_vec4_cubic(float s);
|
||||
*/
|
||||
|
||||
#ifndef cglm_vec4s_h
|
||||
#define cglm_vec4s_h
|
||||
#ifndef cglms_vec4s_h
|
||||
#define cglms_vec4s_h
|
||||
|
||||
#include "../common.h"
|
||||
#include "../types-struct.h"
|
||||
@@ -85,8 +85,8 @@ glms_vec4(vec3s v3, float last) {
|
||||
/*!
|
||||
* @brief copy first 3 members of [a] to [dest]
|
||||
*
|
||||
* @param[in] a source
|
||||
* @returns destination
|
||||
* @param[in] v source
|
||||
* @returns vec3
|
||||
*/
|
||||
CGLM_INLINE
|
||||
vec3s
|
||||
@@ -163,7 +163,6 @@ glms_vec4_unpack(vec4 dst[], vec4s src[], size_t len) {
|
||||
/*!
|
||||
* @brief make vector zero
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @returns zero vector
|
||||
*/
|
||||
CGLM_INLINE
|
||||
@@ -177,7 +176,6 @@ glms_vec4_zero() {
|
||||
/*!
|
||||
* @brief make vector one
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @returns one vector
|
||||
*/
|
||||
CGLM_INLINE
|
||||
@@ -579,4 +577,4 @@ glms_vec4_cubic(float s) {
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif /* cglm_vec4s_h */
|
||||
#endif /* cglms_vec4s_h */
|
||||
|
||||
Reference in New Issue
Block a user