Polyphase Game Engine
Loading...
Searching...
No Matches
LuaUtils.h
Go to the documentation of this file.
1#pragma once
2
3#include "EngineTypes.h"
4#include "Nodes/Node.h"
5
6#include "AssetManager.h"
7
8#include "Engine.h"
9
12
13#if LUA_ENABLED
14
15inline glm::quat LuaVectorToQuat(glm::vec4 vec)
16{
17 glm::quat retQuat;
18 retQuat.x = vec.x;
19 retQuat.y = vec.y;
20 retQuat.z = vec.z;
21 retQuat.w = vec.w;
22 return retQuat;
23}
24
25inline glm::vec4 LuaQuatToVector(glm::quat quat)
26{
27 glm::vec4 retVec;
28 retVec.x = quat.x;
29 retVec.y = quat.y;
30 retVec.z = quat.z;
31 retVec.w = quat.w;
32 return retVec;
33}
34
36 const char* className,
37 const char* classFlag,
38 const char* parentClassName);
39
40#define REGISTER_TABLE_FUNC(L, TableIdx, Func) \
41 OCT_ASSERT(TableIdx >= 1); \
42 lua_pushstring(L, #Func); \
43 lua_pushcfunction(L, Func); \
44 lua_rawset(L, TableIdx);
45
46#define REGISTER_TABLE_FUNC_EX(L, TableIdx, Func, Name) \
47 OCT_ASSERT(TableIdx >= 1); \
48 lua_pushstring(L, Name); \
49 lua_pushcfunction(L, Func); \
50 lua_rawset(L, TableIdx);
51
52#endif
POLYPHASE_API int CreateClassMetatable(const char *className, const char *classFlag, const char *parentClassName)
#define POLYPHASE_API
Definition PolyphaseAPI.h:31