63 lines
1.2 KiB
C
63 lines
1.2 KiB
C
/*
|
|
* Sweet is a small library for basic math and small matrix operations.
|
|
* Copyright 2014 Luc Girod.
|
|
*
|
|
* This library is free software: you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation, either
|
|
* version 3 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
|
|
#ifndef SWEET_TYPES_H
|
|
#define SWEET_TYPES_H
|
|
|
|
typedef struct mat4 {
|
|
float v[16];
|
|
} mat4;
|
|
|
|
typedef struct mat3 {
|
|
float v[9];
|
|
} mat3;
|
|
|
|
typedef struct mat2 {
|
|
float v[4];
|
|
} mat2;
|
|
|
|
typedef struct vec4 {
|
|
float x;
|
|
float y;
|
|
float z;
|
|
float w;
|
|
} vec4;
|
|
|
|
typedef struct vec3 {
|
|
float x;
|
|
float y;
|
|
float z;
|
|
} vec3;
|
|
|
|
typedef struct vec2 {
|
|
float x;
|
|
float y;
|
|
} vec2;
|
|
|
|
|
|
typedef struct complex {
|
|
float r;
|
|
float i;
|
|
} complex;
|
|
|
|
typedef vec4 quaternion;
|
|
|
|
#endif
|
|
|