2021-06-29 05:28:17 +02:00
|
|
|
#include "framework.h"
|
|
|
|
#include "GameScriptRotation.h"
|
2021-07-03 23:07:21 +01:00
|
|
|
#include "phd_global.h"
|
2021-06-29 05:28:17 +02:00
|
|
|
|
2021-07-01 19:25:44 +01:00
|
|
|
void GameScriptRotation::Register(sol::state* state)
|
|
|
|
{
|
|
|
|
state->new_usertype<GameScriptRotation>("Rotation",
|
|
|
|
sol::constructors<GameScriptRotation(int, int, int)>(),
|
2021-07-03 23:07:21 +01:00
|
|
|
"X", &GameScriptRotation::x,
|
|
|
|
"Y", &GameScriptRotation::y,
|
|
|
|
"Z", &GameScriptRotation::z
|
|
|
|
);
|
2021-07-01 19:25:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-03 23:07:21 +01:00
|
|
|
GameScriptRotation::GameScriptRotation(int aX, int aY, int aZ)
|
2021-06-29 05:28:17 +02:00
|
|
|
{
|
2021-07-03 23:07:21 +01:00
|
|
|
x = aX;
|
|
|
|
y = aY;
|
|
|
|
z = aZ;
|
2021-06-29 05:28:17 +02:00
|
|
|
}
|
|
|
|
|
2021-07-03 23:07:21 +01:00
|
|
|
void GameScriptRotation::StoreInPHDPos(PHD_3DPOS& pos) const
|
2021-07-01 19:25:44 +01:00
|
|
|
{
|
2021-07-03 23:07:21 +01:00
|
|
|
pos.xRot = x;
|
|
|
|
pos.yRot = y;
|
|
|
|
pos.zRot = z;
|
2021-07-01 19:25:44 +01:00
|
|
|
}
|
|
|
|
|
2021-07-03 23:07:21 +01:00
|
|
|
GameScriptRotation::GameScriptRotation(PHD_3DPOS const & pos)
|
2021-06-29 05:28:17 +02:00
|
|
|
{
|
2021-07-03 23:07:21 +01:00
|
|
|
x = pos.xRot;
|
|
|
|
y = pos.yRot;
|
|
|
|
z = pos.zRot;
|
2021-06-29 05:28:17 +02:00
|
|
|
}
|