ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
llmath.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef WATCHMAKER_LLMATH_H
23 #define WATCHMAKER_LLMATH_H
24 
25 #include "watchmaker/t3d.h"
26 
27 namespace Watchmaker {
28 
29 void t3dMatCopy(t3dM3X3F *d, t3dM3X3F *s);
30 void t3dMatIdentity(t3dM3X3F *d);
31 void t3dMatSet(t3dM3X3F *d,
32  t3dF32 _m11, t3dF32 _m12, t3dF32 _m13,
33  t3dF32 _m21, t3dF32 _m22, t3dF32 _m23,
34  t3dF32 _m31, t3dF32 _m32, t3dF32 _m33);
35 void t3dMatMul(t3dM3X3F *Dest, t3dM3X3F *a, t3dM3X3F *b);
36 void t3dMatRotAxis(t3dM3X3F *m, t3dF32 x, t3dF32 y, t3dF32 z, t3dF32 rad);
37 void t3dMatRot(t3dM3X3F *matrix, t3dF32 x, t3dF32 y, t3dF32 z);
38 void t3dMatReflect(t3dM3X3F *Matrix, t3dV3F *mirrorpos, t3dNORMAL *n);
39 void t3dMatView(t3dM3X3F *dest, t3dV3F *eye, t3dV3F *center);
40 void t3dVectTransform(t3dV3F *d, t3dV3F *s, t3dM3X3F *mat);
41 void t3dVectTransformInv(t3dV3F *d, t3dV3F *s, t3dM3X3F *mat);
42 void t3dVectInit(t3dV3F *a, t3dF32 x, t3dF32 y, t3dF32 z);
43 void t3dVectCross(t3dV3F *d, t3dV3F *v2, t3dV3F *v3);
44 void t3dVectSub(t3dV3F *d, t3dV3F *a, t3dV3F *b); // d = a - b
45 void t3dVectAdd(t3dV3F *d, t3dV3F *a, t3dV3F *b); // d = a - b
46 void t3dVectFill(t3dV3F *d, t3dF32 a);
47 void t3dVectCopy(t3dV3F *d, t3dV3F *s);
48 t3dF32 t3dVectMod(t3dV3F *c);
49 t3dF32 t3dVectDistance(t3dV3F *a, t3dV3F *b);
50 t3dF32 t3dVectSquaredDistance(t3dV3F *a, t3dV3F *b);
51 t3dF32 t3dPointSquaredDistance(t3dV3F *c);
52 void t3dVectNormalize(t3dV3F *c);
53 t3dF32 t3dVectDot(t3dV3F *a, t3dV3F *b);
54 void t3dMatMulInv(t3dM3X3F *Dest, t3dM3X3F *a, t3dM3X3F *b);
55 void t3dVectReflection(t3dV3F *r, t3dV3F *p1, t3dNORMAL *plane, t3dF32 dist);
56 void t3dMatInv(t3dM3X3F *d, t3dM3X3F *s);
57 void t3dPlaneNormal(t3dNORMAL *n, t3dV3F *p0, t3dV3F *p1, t3dV3F *p2);
58 void t3dVector2dTo3d(t3dV3F *end, t3dV2F *start);
59 int32 t3dFloatToInt(t3dF32 nfloat);
60 t3dF32 t3dVectPlaneDistance(t3dV3F start, t3dNORMAL n); //return the distance of start from plane normal n
61 uint8 t3dVectPlaneIntersection(t3dV3F *inter, t3dV3F start, t3dV3F end, t3dNORMAL n); //if return value !=0 inter contains the intersection point
62 uint8 t3dVectTriangleIntersection(t3dV3F *inter, t3dV3F start, t3dV3F end, t3dV3F v1, t3dV3F v2, t3dV3F v3, t3dNORMAL n); //return 1 if the vector from start to end pass trought the triangle v1,v2,v3
63 
64 } // End of namespace Watchmaker
65 
66 #endif // WATCHMAKER_LLMATH_H
Definition: 2d_stuff.h:30