bl-symmetrize-texture/src/math_util.h

46 lines
1.7 KiB
C

/*
Copyright (C) 2020 Akaneyu
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MATH_UTIL_H_
#define MATH_UTIL_H_
const float PI = 3.1415927f;
void multiplyMatrix4fVector4f(float *out, float *mat, float *v);
void multiplyMatrix4fVector3f(float *out, float *mat, float *v);
void multiplyVector4fValue(float *out, float *v, float val);
void multiplyVector3fValue(float *out, float *v, float val);
void copyVector4f(float *out, float *v);
void copyVector4fValue(float *out, float val);
void copyVector3f(float *out, float *v);
void copyVector3fValue(float *out, float val);
void copyVector3i(int *out, int *v);
void copyVector3iValue(int *out, int val);
void copyVector2f(float *out, float *v);
void copyVector2i(int *out, int *v);
void copyVector2iValue(int *out, int val);
void subtractVector3f(float *out, float *v1, float *v2);
void normalizeVector3f(float *v);
float dotVector3f(float *v1, float *v2);
float crossTriVector2f(float *v1, float *v2, float *v3);
float lenSquaredVector2f(float *v1, float *v2);
void printVector2f(float *v);
void printVector4f(float *v);
void printMatrix4f(float *mat);
#endif // MATH_UTIL_H_