diff options
author | chai <chaifix@163.com> | 2021-11-19 15:33:48 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-19 15:33:48 +0800 |
commit | 1cd31d14c95f9d52e30fbc611df5da4b46f048d9 (patch) | |
tree | 86dbda850f9b8ed26b152c6521adc0a777d6563a /Runtime/Math/Vector2.h | |
parent | 2ab7fad7b308debba0aacbf76831569f360d19a0 (diff) |
*misc
Diffstat (limited to 'Runtime/Math/Vector2.h')
-rw-r--r-- | Runtime/Math/Vector2.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Runtime/Math/Vector2.h b/Runtime/Math/Vector2.h index f83a521..5dd8fe6 100644 --- a/Runtime/Math/Vector2.h +++ b/Runtime/Math/Vector2.h @@ -2,11 +2,12 @@ #include "MathHelper.h" #include "Runtime/Utilities/Assert.h" #include "Runtime/Lua/LuaHelper.h" +#include "ITransData.h" namespace Internal { template<typename T> - struct Vector2T : public LuaBind::ILuaClass + struct Vector2T { Vector2T(T x = 0, T y = 0) { @@ -50,7 +51,7 @@ namespace Internal return res; } - void CastToLuaObject(LuaBind::State& state) const override + void CastToLuaObject(LuaBind::State& state) const { int top = state.GetTop(); if (LuaHelper::GetLuaClass(state, "GameLab.Engine.Math.Vector2")) @@ -68,7 +69,7 @@ namespace Internal } } - void RestoreFromLuaObject(LuaBind::State& state, int index) override + void RestoreFromLuaObject(LuaBind::State& state, int index) { if (lua_isnil(state, index)) return; @@ -84,6 +85,11 @@ namespace Internal y = state.GetField<float>(index, 1, 0); } } + + static int GetDataSize() + { + return 2 * sizeof(T); + } T x, y; |