mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
cpp: fix array initializer must be an initializer list
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_translate_to(mat4 m, vec3 v, mat4 dest) {
|
glm_translate_to(mat4 m, vec3 v, mat4 dest) {
|
||||||
mat4 t = GLM_MAT4_IDENTITY;
|
mat4 t = GLM_MAT4_IDENTITY_INIT;
|
||||||
|
|
||||||
#if defined( __SSE__ ) || defined( __SSE2__ )
|
#if defined( __SSE__ ) || defined( __SSE2__ )
|
||||||
_mm_store_ps(dest[3],
|
_mm_store_ps(dest[3],
|
||||||
@@ -149,7 +149,7 @@ void
|
|||||||
glm_rotate_x(mat4 m, float rad, mat4 dest) {
|
glm_rotate_x(mat4 m, float rad, mat4 dest) {
|
||||||
float cosVal;
|
float cosVal;
|
||||||
float sinVal;
|
float sinVal;
|
||||||
mat4 t = GLM_MAT4_IDENTITY;
|
mat4 t = GLM_MAT4_IDENTITY_INIT;
|
||||||
|
|
||||||
cosVal = cosf(rad);
|
cosVal = cosf(rad);
|
||||||
sinVal = sinf(rad);
|
sinVal = sinf(rad);
|
||||||
@@ -167,7 +167,7 @@ void
|
|||||||
glm_rotate_y(mat4 m, float rad, mat4 dest) {
|
glm_rotate_y(mat4 m, float rad, mat4 dest) {
|
||||||
float cosVal;
|
float cosVal;
|
||||||
float sinVal;
|
float sinVal;
|
||||||
mat4 t = GLM_MAT4_IDENTITY;
|
mat4 t = GLM_MAT4_IDENTITY_INIT;
|
||||||
|
|
||||||
cosVal = cosf(rad);
|
cosVal = cosf(rad);
|
||||||
sinVal = sinf(rad);
|
sinVal = sinf(rad);
|
||||||
@@ -185,7 +185,7 @@ void
|
|||||||
glm_rotate_z(mat4 m, float rad, mat4 dest) {
|
glm_rotate_z(mat4 m, float rad, mat4 dest) {
|
||||||
float cosVal;
|
float cosVal;
|
||||||
float sinVal;
|
float sinVal;
|
||||||
mat4 t = GLM_MAT4_IDENTITY;
|
mat4 t = GLM_MAT4_IDENTITY_INIT;
|
||||||
|
|
||||||
cosVal = cosf(rad);
|
cosVal = cosf(rad);
|
||||||
sinVal = sinf(rad);
|
sinVal = sinf(rad);
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
#include "cglm-mat-simd.h"
|
#include "cglm-mat-simd.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#define GLM_MAT4_IDENTITY (mat4){1.0f, 0.0f, 0.0f, 0.0f, \
|
#define GLM_MAT4_IDENTITY_INIT {1.0f, 0.0f, 0.0f, 0.0f, \
|
||||||
0.0f, 1.0f, 0.0f, 0.0f, \
|
0.0f, 1.0f, 0.0f, 0.0f, \
|
||||||
0.0f, 0.0f, 1.0f, 0.0f, \
|
0.0f, 0.0f, 1.0f, 0.0f, \
|
||||||
0.0f, 0.0f, 0.0f, 1.0f}
|
0.0f, 0.0f, 0.0f, 1.0f}
|
||||||
|
|
||||||
|
#define GLM_MAT4_IDENTITY (mat4)GLM_MAT4_IDENTITY_INIT
|
||||||
|
|
||||||
#define glm_mat4_mul_impl(l, r, d) \
|
#define glm_mat4_mul_impl(l, r, d) \
|
||||||
do { \
|
do { \
|
||||||
d[0] = l[0] * r[0] + l[1] * r[4] + l[2] * r[8] + l[3] * r[12]; \
|
d[0] = l[0] * r[0] + l[1] * r[4] + l[2] * r[8] + l[3] * r[12]; \
|
||||||
|
|||||||
Reference in New Issue
Block a user