diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-06-12 13:48:17 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-06-12 13:48:17 +0200 |
commit | b5d16ef340208bbe1a76f33f7498fb168f6405b6 (patch) | |
tree | 86b2f31585b0621130d9c5300a77f2be9c30c808 /src/math/conv.h | |
parent | a8665d204255b4b0ad9ae6982f77ecd5e053c1b6 (diff) | |
download | colobot-b5d16ef340208bbe1a76f33f7498fb168f6405b6.tar.gz colobot-b5d16ef340208bbe1a76f33f7498fb168f6405b6.tar.bz2 colobot-b5d16ef340208bbe1a76f33f7498fb168f6405b6.zip |
Fixes in math module
- rewritten RotateAngle() function and test for it in geometry_test.cpp
- added conv.h - conversion functions
- added comments in math3d.h and d3dmath.h pointing to new functions
- other minor fixes
Diffstat (limited to 'src/math/conv.h')
-rw-r--r-- | src/math/conv.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/math/conv.h b/src/math/conv.h new file mode 100644 index 0000000..8b77db9 --- /dev/null +++ b/src/math/conv.h @@ -0,0 +1,33 @@ +/* math/conv.h + + Temporary conversion functions for D3DVECTOR and FPOINT */ + +#pragma once + +#define STRICT +#define D3D_OVERLOADS +#include <d3d.h> + +#include "common/struct.h" +#include "vector.h" +#include "point.h" + +inline D3DVECTOR V_TO_D3D(Math::Vector vec) +{ + return D3DVECTOR(vec.x, vec.y, vec.z); +} + +inline Math::Vector D3D_TO_V(D3DVECTOR vec) +{ + return Math::Vector(vec.x, vec.y, vec.z); +} + +inline FPOINT P_TO_FP(Math::Point pt) +{ + return FPOINT(pt.x, pt.y); +} + +inline Math::Point FP_TO_P(FPOINT pt) +{ + return Math::Point(pt.x, pt.y); +} |