#include <cmath>
#include <cstdio>
#include <cstdlib>
#include "mathtools.h"
Go to the source code of this file.
◆ V3D_TO_V2D
#define V3D_TO_V2D |
( |
|
v3, |
|
|
|
v2, |
|
|
|
width, |
|
|
|
height, |
|
|
|
distance |
|
) |
| |
Value:{ \
int Xp; \
int Yp; \
if ((v3).z > 2) { \
F2I(((distance) * (v3).x / (v3).z),Xp) ; \
F2I(((distance) * (v3).y / (v3).z),Yp) ; \
(v2).x = Xp + ((width)>>1); \
(v2).y = -Yp + ((height)>>1); \
} \
else (v2).x=(v2).y=-666; \
}
Definition at line 24 of file v3d.h.
◆ Y_ROTATE_V3D
#define Y_ROTATE_V3D |
( |
|
vi, |
|
|
|
vf, |
|
|
|
sina, |
|
|
|
cosa |
|
) |
| |
Value:{\
(vf).x = (vi).x * (cosa) - (vi).z * (sina);\
(vf).z = (vi).x * (sina) + (vi).z * (cosa);\
(vf).y = (vi).y;\
}
Definition at line 41 of file v3d.h.
◆ TRANSLATE_V3D
#define TRANSLATE_V3D |
( |
|
vsrc, |
|
|
|
vdest |
|
) |
| |
Value:{\
(vdest).x += (vsrc).x;\
(vdest).y += (vsrc).y;\
(vdest).z += (vsrc).z;\
}
Definition at line 51 of file v3d.h.
◆ MUL_V3D
#define MUL_V3D |
( |
|
lf, |
|
|
|
v |
|
) |
| {(v).x*=(lf);(v).y*=(lf);(v).z*=(lf);} |
Definition at line 58 of file v3d.h.